facebook

method completition problem (javax.jms package) [Closed]

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #209096 Reply

    neos76
    Member

    Hi,

    I’m writing a jms client but ME doesn’t show me methods for javax.jms.Connection class. The only methods available are those for java.lang.Object class.
    All this in a web module project. In a standard java project there is not problem.

    It’s a bug?

    Thx
    A.

    #209097 Reply

    support-michael
    Keymaster

    Hi Neos,

    1) To get started on this case please help us by providing your configuration and environment per the posting guidelines.

    2) Please describe how you created your project. For example MyEclipse has 3 J2EE project types: 1) Enterprise (EAR) Project, 2) Web (WAR) Project, and 3) EJB Project. If you used the MyEclipse new project wizards to create any of these type of projects then the project’s classpath will include J2EE 1.3 libraries and will support that level of code completion.

    To help us help you remember that more info is better.

    #209098 Reply

    neos76
    Member

    Hi,

    I created a web module project

    File -> New -> Project -> (J2EE) Web Module Project. The wizard ask me only the project name.

    The J2EE libraries are in project but the error persist. My example following:

    package test;

    import javax.jms.*;
    import javax.naming.*;

    public class ServiceJms {

    public static void subscribeJmsMessage(String username,String password,String name,String surname,String email) throws Exception {
    Queue queue = null;
    ConnectionFactory factory = null;
    Context ctx = null;
    Connection connection = null;
    Session jmsSession = null;
    MessageProducer producer = null;

    try {
    ctx = (Context) new InitialContext().lookup(“java:comp/env”);
    queue = (Queue) ctx.lookup(“jms/SubscribeQueue”);
    if(queue == null) {
    throw new Exception(“`java:comp/env/jms/SubscribeQueue’ lookup failed”);
    }

    factory = (ConnectionFactory) ctx.lookup(“jms/QueueConnectionFactory”);
    if(factory == null) {
    throw new Exception(“`java:comp/env/jms/QueueConnectionFactory’ lookup failed”);
    }

    connection = factory.createConnection();
    jmsSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

    producer = jmsSession.createProducer(queue);

    On row “connection = factory.createConnection();” I’ve

    The method createConnection() is undefined for the type ConnectionFactory

    Thx
    A.

    – System Setup ——————————-
    Operating System and version:
    Eclipse version: 3.0 RC2
    Eclipse build id:
    Fresh Eclipse install (y/n): y
    If not, was it upgraded to its current version using the update manager?
    Other installed external plugins:
    Number of plugins in the <eclipse>/plugins directory that begin with org.eclipse.pde.*:
    MyEclipse version: 030800Beta1
    Eclipse JDK version: j2sdk1.4.2_02
    Application Server JDK version: j2sdk1.4.2_02
    Are there any exceptions in the Eclipse log file? no

    – Message Body ——————————-

    #209103 Reply

    Riyad Kalla
    Member

    neos,
    The error message is correct, our J2EE Library Set is 1.3, it looks like you developed this app against J2EE 1.4. In 1.3 there is no createConnection method, in 1.4 there is.
    1.3: http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/jms/ConnectionFactory.html
    1.4: http://java.sun.com/j2ee/1.4/docs/api/javax/jms/ConnectionFactory.html

    Double check which libraries you have added to your normal Java project that make it compile correctly, and duplicate that for your web module project.

    #209111 Reply

    neos76
    Member

    Ok,

    you are right. But in any way there is a poblem. ConnectionFacotry class has a method getClientID() and it’s not showed in the methods list. If you look in jboss-j2ee.jar, in package javax.jms, the class javax.jms.ConnectionFactory has 0 methods. Why? I suppose there is a problem in libray classes.

    Thx
    A.

    #209113 Reply

    Riyad Kalla
    Member

    ConnectionFacotry class has a method getClientID() and it’s not showed in the methods list. If you look in jboss-j2ee.jar, in package javax.jms, the class javax.jms.ConnectionFactory has 0 methods. Why?

    From looking at the Javadoc above, it seems that it does not have any defined methods for J2EE 1.3… where do you see the getClientID() method from?

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: method completition problem (javax.jms package) [Closed]

You must be logged in to post in the forum log in