Import javax.jms cannot be resolved

This is error i am getting The import javax.jms cannot be resolved even though
my class path contains mail.jar and activation.jar.
please suggest me, to resolve above error
Thanks in advance

sir
These below import packages are not resloved by class path
import javax.jms.ObjectMessage;
import javax.jms.Session;
import javax.jms.Topic;
import javax.jms.TopicConnection;
import javax.jms.TopicConnectionFactory;
import javax.jms.TopicPublisher;
import javax.jms.TopicSession;
and below packages are resolved
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

Similar Messages

  • Getting an error like this The import javax.servlet cannot be resolved

    HI
    i am getting an error like this "The import javax.servlet cannot be resolved".wht i ahve done in eclipse right click->open->servlet->packge name->servlet name->next->nexyt>finish.hereinterfaces is javax.servlet.Servlet.
    do i need add jar for it.can any one tell me why i got error like this.
    vijay

    Please don't doublepost. Answer is given here: http://forum.java.sun.com/thread.jspa?threadID=5220686

  • Import javax.ejb cannot be resolved

    Hi,
    There are some libraries missing in the following code.
    package era.budget;
    import javax.ejb.*;
    import era.budget.BudgetVO;
    public class BudgetItemVO implements java.io.Serializable
         private Integer itemId;
         private BudgetVO budget;
         private int type;
         private String itemDetails;
         private int amount;
    // -------------- BEGIN GET/SET METHODS --------------
    public BudgetItemVO(Integer id)
              this.itemId = id;
         public BudgetItemVO()
         public Integer getItemId()
              return itemId;
    public BudgetVO getBudget()
              return budget;
         public void setBudget(BudgetVO budget)
              this.budget=budget;
    public int getType()
              return type;
         public void setType(int id)
         this.type=id;
    public String getItemDetails()
              return this.itemDetails;
    public void setItemDetails(String details)
              this.itemDetails=details;
    public int getAmount()
              return this.amount;
    public void setAmount(int amount)
    this.amount=amount;
    As aresult of these missing libraries there are some compilation errors..Some of the errors are as follows
         1)The import javax.ejb cannot be resolved     
         2)EntityBean cannot be resolved to a type     
    3)EntityContext cannot be resolved to a type     
    4)EJBLocalObject cannot be resolved to a type     
    Thanx & Regards
    Maria.

    try: in your project properties choose 'Java Build Path' and add javaee.jar (from J2EE_HOME\lib) as external jar

  • Import javax.persistence cannot be resolved

    I am running Weblogic Workshop 9.2.0 and Eclipse-Helios v3.6.2, and am running both jdk1.6 and jdk1.5. Going through the Java 5 Tutorial on Web Tier technologies, I am experiencing the above error.
    On investigating the jdk, I am unable to find the jar file that contains the above package. Can someone point me in the correct direction to resolve this issue?
    Thank you.
    Stevenson

    The class is not in the JDK, it is part of the JEE5/JEE6 platform and thus provided by weblogic itself. Generally you have a few options;
    - figure out which libraries of weblogic you have to add (the documentation should tell you this)
    - if using an IDE, you can generally setup a server runtime in your project; in doing so the correct libraries are automatically added
    - IDEs generally give access to a generic 'stub' implementation of the JEE classes that you can compile against. You don't need to deploy anything because as said the server already provides the libraries during runtime.

  • The import javax.ejb cannot be resolved

    Hi all,
    I have a bean working fine when deployed as jar on weblogic but it gives the above error when deployed as ear. Deployment goes ok but when I try to use it I get the error.
    Anybody has any idea of what the problem could be?
    Thanks,
    A.

    I figured out that if I include j2ee.jar in the ear file and the entry j2ee.jar in the Class-Path of the manifest file inside the jar then everything works, but I can't understand why...do I ALWAYS need to include j2ee.jar for every aplication that I deploy?
    A.

  • EJB and JMs cannot be resolved

    hello,
    I was running an example of message bean driven and it worked.
    I am on Windows XP, j2sdk 1.4.1_02, and jonas 3.1 and eclipse 2.1. all my classpath seem to be set correctly.
    I use a ant script to compile it but when I run on the concole this is the same error.
    But today nothing works when I am compiling the code I 've got the following error:
    [javac] ----------
    [javac] 1. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbBean.java (at line 34)
    [javac] import javax.ejb.MessageDrivenBean;
    [javac] ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    [javac] The import javax.ejb cannot be resolved
    [javac] ----------
    [javac] 2. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbBean.java (at line 35)
    [javac] import javax.ejb.MessageDrivenContext;
    [javac] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    [javac] The import javax.ejb cannot be resolved
    [javac] ----------
    [javac] 3. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbBean.java (at line 36)
    [javac] import javax.jms.JMSException;
    [javac] ^^^^^^^^^^^^^^^^^^^^^^
    [javac] The import javax.jms cannot be resolved
    [javac] ----------
    [javac] 4. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbBean.java (at line 37)
    [javac] import javax.jms.Message;
    [javac] ^^^^^^^^^^^^^^^^^
    [javac] The import javax.jms cannot be resolved
    [javac] ----------
    [javac] 5. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbBean.java (at line 38)
    [javac] import javax.jms.MessageListener;
    [javac] ^^^^^^^^^^^^^^^^^^^^^^^^^
    [javac] The import javax.jms cannot be resolved
    [javac] ----------
    [javac] 6. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbBean.java (at line 39)
    [javac] import javax.jms.TextMessage;
    [javac] ^^^^^^^^^^^^^^^^^^^^^
    [javac] The import javax.jms cannot be resolved
    [javac] ----------
    [javac] 7. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbBean.java (at line 49)
    [javac] public class MdbBean implements MessageDrivenBean, MessageListener {
    [javac] ^^^^^^^^^^^^^^^^^
    [javac] MessageDrivenBean cannot be resolved or is not a valid superinterface
    [javac] ----------
    [javac] 8. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbBean.java (at line 49)
    [javac] public class MdbBean implements MessageDrivenBean, MessageListener {
    [javac] ^^^^^^^^^^^^^^^
    [javac] MessageListener cannot be resolved or is not a valid superinterface
    [javac] ----------
    [javac] 9. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbBean.java (at line 51)
    [javac] private transient MessageDrivenContext mdbContext;
    [javac] ^^^^^^^^^^^^^^^^^^^^
    [javac] MessageDrivenContext cannot be resolved (or is not a valid type) for the field MdbBean.mdbContext
    [javac] ----------
    [javac] 10. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbBean.java (at line 78)
    [javac] public void setMessageDrivenContext(MessageDrivenContext ctx) {
    [javac] ^^^^^^^^^^^^^^^^^^^^
    [javac] MessageDrivenContext cannot be resolved (or is not a valid type) for the argument ctx of the method setMessageDrivenContext
    [javac] ----------
    [javac] 11. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbBean.java (at line 80)
    [javac] mdbContext = ctx;
    [javac] ^^^^^^^^^^
    [javac] mdbContext cannot be resolved
    [javac] ----------
    [javac] 12. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbBean.java (at line 107)
    [javac] public void onMessage(Message message) {
    [javac] ^^^^^^^
    [javac] Message cannot be resolved (or is not a valid type) for the argument message of the method onMessage
    [javac] ----------
    [javac] 13. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbBean.java (at line 110)
    [javac] TextMessage mess = (TextMessage)message;
    [javac] ^^^^^^^^^^^
    [javac] TextMessage cannot be resolved or is not a type
    [javac] ----------
    [javac] 14. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbBean.java (at line 110)
    [javac] TextMessage mess = (TextMessage)message;
    [javac] ^^^^^^^^^^^
    [javac] TextMessage cannot be resolved or is not a type
    [javac] ----------
    [javac] 15. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbBean.java (at line 112)
    [javac] }catch(JMSException ex){
    [javac] ^^^^^^^^^^^^
    [javac] JMSException cannot be resolved or is not a type
    [javac] ----------
    [javac] ----------
    [javac] 16. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbClient.java (at line 34)
    [javac] import javax.jms.Session;
    [javac] ^^^^^^^^^^^^^^^^^
    [javac] The import javax.jms cannot be resolved
    [javac] ----------
    [javac] 17. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbClient.java (at line 35)
    [javac] import javax.jms.TextMessage;
    [javac] ^^^^^^^^^^^^^^^^^^^^^
    [javac] The import javax.jms cannot be resolved
    [javac] ----------
    [javac] 18. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbClient.java (at line 36)
    [javac] import javax.jms.Topic;
    [javac] ^^^^^^^^^^^^^^^
    [javac] The import javax.jms cannot be resolved
    [javac] ----------
    [javac] 19. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbClient.java (at line 37)
    [javac] import javax.jms.TopicConnection;
    [javac] ^^^^^^^^^^^^^^^^^^^^^^^^^
    [javac] The import javax.jms cannot be resolved
    [javac] ----------
    [javac] 20. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbClient.java (at line 38)
    [javac] import javax.jms.TopicConnectionFactory;
    [javac] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    [javac] The import javax.jms cannot be resolved
    [javac] ----------
    [javac] 21. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbClient.java (at line 39)
    [javac] import javax.jms.TopicPublisher;
    [javac] ^^^^^^^^^^^^^^^^^^^^^^^^
    [javac] The import javax.jms cannot be resolved
    [javac] ----------
    [javac] 22. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbClient.java (at line 40)
    [javac] import javax.jms.TopicSession;
    [javac] ^^^^^^^^^^^^^^^^^^^^^^
    [javac] The import javax.jms cannot be resolved
    [javac] ----------
    [javac] 23. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbClient.java (at line 53)
    [javac] static TopicConnectionFactory tcf = null;
    [javac] ^^^^^^^^^^^^^^^^^^^^^^
    [javac] TopicConnectionFactory cannot be resolved (or is not a valid type) for the field MdbClient.tcf
    [javac] ----------
    [javac] 24. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbClient.java (at line 54)
    [javac] static TopicPublisher tp = null;
    [javac] ^^^^^^^^^^^^^^
    [javac] TopicPublisher cannot be resolved (or is not a valid type) for the field MdbClient.tp
    [javac] ----------
    [javac] 25. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbClient.java (at line 55)
    [javac] static Topic topic = null;
    [javac] ^^^^^
    [javac] Topic cannot be resolved (or is not a valid type) for the field MdbClient.topic
    [javac] ----------
    [javac] 26. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbClient.java (at line 66)
    [javac] tcf = (TopicConnectionFactory) ictx.lookup(conFactName );
    [javac] ^^^
    [javac] tcf cannot be resolved
    [javac] ----------
    [javac] 27. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbClient.java (at line 66)
    [javac] tcf = (TopicConnectionFactory) ictx.lookup(conFactName );
    [javac] ^^^^^^^^^^^^^^^^^^^^^^
    [javac] TopicConnectionFactory cannot be resolved or is not a type
    [javac] ----------
    [javac] 28. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbClient.java (at line 67)
    [javac] System.out.println("JMS client: tcf = " + tcf.toString());
    [javac] ^^^
    [javac] tcf cannot be resolved
    [javac] ----------
    [javac] 29. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbClient.java (at line 69)
    [javac] topic = (Topic) ictx.lookup(topicName);
    [javac] ^^^^^
    [javac] topic cannot be resolved
    [javac] ----------
    [javac] 30. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbClient.java (at line 69)
    [javac] topic = (Topic) ictx.lookup(topicName);
    [javac] ^^^^^
    [javac] Topic cannot be resolved or is not a type
    [javac] ----------
    [javac] 31. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbClient.java (at line 75)
    [javac] TopicConnection tc = null;
    [javac] ^^^^^^^^^^^^^^^
    [javac] TopicConnection cannot be resolved or is not a type
    [javac] ----------
    [javac] 32. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbClient.java (at line 76)
    [javac] TopicSession session = null;
    [javac] ^^^^^^^^^^^^
    [javac] TopicSession cannot be resolved or is not a type
    [javac] ----------
    [javac] 33. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbClient.java (at line 78)
    [javac] tc = tcf.createTopicConnection();
    [javac] ^^^
    [javac] tcf cannot be resolved
    [javac] ----------
    [javac] 34. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbClient.java (at line 80)
    [javac] session = tc.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
    [javac] ^^^^^^^^^^^^^^^^^^^^^^^^
    [javac] Session cannot be resolved
    [javac] ----------
    [javac] 35. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbClient.java (at line 81)
    [javac] tp = session.createPublisher(topic);
    [javac] ^^
    [javac] tp cannot be resolved
    [javac] ----------
    [javac] 36. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbClient.java (at line 81)
    [javac] tp = session.createPublisher(topic);
    [javac] ^^^^^
    [javac] topic cannot be resolved
    [javac] ----------
    [javac] 37. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbClient.java (at line 90)
    [javac] TextMessage message;
    [javac] ^^^^^^^^^^^
    [javac] TextMessage cannot be resolved or is not a type
    [javac] ----------
    [javac] 38. ERROR in C:\Java\Workspace\MDBTest\com\iratensolutions\test\MdbClient.java (at line 94)
    [javac] tp.publish(message);
    [javac] ^^
    [javac] tp cannot be resolved
    [javac] ----------
    [javac] 38 problems (38 errors)
    [javac] BUILD FAILED: file:C:/Java/Workspace/MDBTest/com/iratensolutions/test/build.xml:107: Compile failed; see the compiler error output for details.
    Total time: 610 milliseconds
    Thank you for your help

    Hi,
    You need to place ejb.jar and jms.jar present in
    <jonAs-home>\lib\common\j2ee directory in the classpath.
    -Amol

  • Import from javax.mail cannot be resolved

    Hi,
    After migration from Netweaver 7.0 to 7.1 CE, the import of the package  import javax.mail.*
    The error is javax.mail cannot be resolved.
    Do I have to add special Dependencies to my DC?
    Best regards,
    Peter

    Hi
    Please refer following thread.
    [external jar in CE|import a external jar in web dynpro project;
    [external library insight webdynpro |Problem in Reading Excel File from Webdynpro;
    Best Regards
    Satish Kumar

  • Javax.ejb cannot be resolved

    Hey there, im using this code in my portal application:
    import javax.ejb.CreateException;
    Im using it to connect to a DataSource, but my NWDS keeps saying: Javax.ejb cannot be resolved. I tried several hints and tips from all over but i cant get it fixed. I added j2ee.jar to my classpath and to my NWDS config but nothing seems to work.
    Any pointers?!

    Hi Hans,
    the javax.ejb.CreateException is located in the ejb20.jar
    ...usr\sap\[SID]\JC[InstNo]\cluster\server0\bin\ext\ejb20
    for any kind of class location probs use the classlocator - nice plugin for eclipse and your NWDS
    http://sourceforge.net/projects/classlocator
    Greets Jens

  • The import org.apache cannot be resolved

    Hi All,
    I am a Java\Eclipse newbie. I am trying to import the org.apache.xerces package, and the import is failing with this error:The import org.apache cannot be resolved
    I am not using Maven\Ant for building the project. I know I need to download some class files\jar files to get this to work, but I am not sure where to download these packages from. Could someone please help me out here?
    import org.w3c.dom.Node;
    import org.apache.xerces.parsers.DOMParser;
    import org.apache.xerces.dom.traversal.TreeWalkerImpl;
    import org.apache.xerces.domx.traversal.NodeFilter;
    import org.apache.xerces.dom.DocumentImpl;
    THanks a lot!

    Well, if you are in fact looking to download the JARs for the Apache Xerces project, you should be able to find them at the Apache Xerces project page.
    If you already have the JARs downloaded, you need to make sure that they appear on your CLASSPATH, otherwise your application will never find them. Since you are using an IDE, this should be as easy as adding the JARs to your project.

  • The import com.crystaldecisions cannot be resolved

    Hi,
    I installed Eclipse Java EE IDE for Web Developers (Version: Helios Service Release 1) and the Crystal Reports SDK via Eclipse "Install New Software" feature described at http://www.sdn.sap.com/irj/sdn/crystalreports-java
    I have a sample code now and get in one of the JSP-files in Eclipse the error message:
    Multiple annotations found at this line:
         - The import com.crystaldecisions cannot be
          resolved
         - The import com.crystaldecisions cannot be
          resolved
    I got the Crystal Reports for Eclipse Developer Guide and configured my project in Eclipse: menu Project -> Properties and added the CR library to the Java Build Path and activated CR at "Project Facets". I still get the error message... what's missing?
    Thanks!

    Hi Stefan,
    Instead of adding the "Add external class folder" try out to add to your Java Build Libraries "Add External JARs"
    When you click on this button you can select the path of all the jar files from your Business Objects installation directory.
    E.g. C:\Program Files\Business Objects\common\4.0\java\lib"
    and "C:\Program Files\Business Objects\common\4.0\java\lib\external"
    Regards,
    Anu

  • Cannot import javax.jms

    I've installed J2SE 1.3.1_01 and J2EE 1.3_01. I use Forte for Java CE 3.0. When I type import javax.
    I get nothing!
    Why I cant use javax ????
    Please help an new Java-Fan

    Typing! It's realy a bad thing. I thought I can use the J2EE Packeges (J2EE.JAR), but the only way I can do it is in building a own Package of the class-files included there!
    Have you an idea?

  • The import org.apache cannot be resolved and I am not sure why?

    Alright, so I decided to build myself the simplest of simplest ftp client so that I could understand how this works:
    Ok, I have parts built but I am trying to include the following things:
    import org.apache.commons.net.ftp.FTPClient;
    import org.apache.commons.net.ftp.FTPFile;The error I am getting from eclipse (which is the editor that I am using) is:
    The import org.apache cannot be resolvedThe same thing happens when I try to do:
    import com.jscape.inet.ftp.*;I have an idea what is going on with this but I am not entirely sure. I think I need a package that I must download from apache or somewhere that might give me access to libraries?
    I would be grateful to any help...
    Thanks,
    Adam Scott

    Yes you need to have the classes that you want to import. If you have them then you need to add them to your project's classpath.

  • Javax.servlet cannot be resolved - HELP

    I am using Eclipse to develop a Servlet application but Eclipse cannot resolve the javax.servelet package. Is there a special j2ee package I am suppose to download or do all the j2ee packages come with the JDK? I am running J2SE 1.5. I did not download the JDK seperately because I assumed in came with Eclipse.
    What do I have to do so that Eclipse can resolve the javax.servlet package and all j2ee packages?

    Do you mean that I have to define a new Environment
    variable in WinXP that point to the location of
    servlet.jar?no
    >
    I don't have a servelet.jar file BTW.servlet.jar is a part of the j2ee download so if you
    just have j2se it may not be there.
    it is bundled with tomcat also and should be in the
    <tomcat home>common/lib directory.
    it is also bundled with netbeans in the directory
    <netbeans home>/tomcat/common/lib
    you can download it from sun and add it in the java home lib directory

  • Cannot access class javax.jms.TextMessage;

    Hi,
    I am trying to run standard page from JDev and i am getting below error from EOImpl.java.
    " cannot access class javax.jms.TextMessage; file javax\jms\TextMessage.class not found "
    I tried to import javax/jms dir to my local machine but i could not find jms directory under javax in OS. Can you guys pls help me to resolve this.
    Thanks,

    Hi Scott,
    Not sure wht you wanted me to try...
    I have something like this in the code which is causing that error..
    BusinessEvent businessevent = new BusinessEvent(s1, s2);
    businessevent.setData("Opportunity " + s2 + "updated");
    ArrayList arraylist = new ArrayList(1);
    arraylist.add(oadbtransaction);
    businessevent.setObject(arraylist);
    businessevent.setStringProperty("pLeadId", getLeadId().toString());
    java.sql.Connection connection1 = oadbtransaction.getJdbcConnection();
    businessevent.raise(connection1);
    Its asking me to import jms..but ii could not find those files in Unix..is there anyway to import these files OR any other solution to fix this error?
    Please help..

  • BO XI 3.1 SDK and Eclipse: import cannot be resolved

    I am preparing my Eclipse 3.4.1 installation to develop using the BO XI 3.1 SDK; I got some samples from the SAP Developer network, however, Eclipse always shows import errors like "The import com.crystaldecisions cannot be resolved"
    I added the paths "C:\Program Files\Business Objects\common\4.0\java\lib" and "C:\Program Files\Business Objects\common\4.0\java\lib\external" to my project (rigt click -> Properties -> Java Build Path -> Libraries -> "Add external class folder" button) but I am still getting these errors.
    I also tried Netbeans 6.5 but it shows similar errors: "package com.crystaldecisions.sdk does not exist".
    It's a BO XI 3.1 server installation.
    What am I doing wrong?
    Thanks!

    Hi Stefan,
    Instead of adding the "Add external class folder" try out to add to your Java Build Libraries "Add External JARs"
    When you click on this button you can select the path of all the jar files from your Business Objects installation directory.
    E.g. C:\Program Files\Business Objects\common\4.0\java\lib"
    and "C:\Program Files\Business Objects\common\4.0\java\lib\external"
    Regards,
    Anu

Maybe you are looking for