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.

Similar Messages

  • 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

  • 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.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;

  • 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

  • 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.

  • 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.

  • Import javax.ejb.EJBHome; cannot resolve symbol

    Hi i wonder if anyone can help me. I have read alot of the posts regarding this issue and have tried everything to do with the paths and environmental variables and even reinstalled everything.
    import javax.ejb.EJBHome; cannot resolve symbol
    This is the problem i keep getting and here are the paths that i set:
    SET PATH=c:\j2sdkee1.3\bin;c:\jdk1.3.1_01\bin;c:\jakarta-ant-1.3\bin
    SET ANT_HOME=c:\jakarta-ant-1.3
    SET JAVA_HOME=c:\jdk1.3.1_01
    SET J2EE_HOME=c:\j2sdkee1.3
    SET CLASSPATH=c:\j2sdkee1.3\lib\j2ee.jar;c:\jakarta-ant-1.3\lib\ant.jar;c:\jdk1.3.1_01\lib\tools.jar
    What am i doing wrong???

    Im not sure, everything looks ok to me, but here is what i tried:
    I wrote this little test class, and compiled it
    import javax.ejb.EJBHome;
    public class test
    public test()
    I got the same error you did (or similar)
    D:\>javac test.java
    test.java:1: package javax.ejb does not exist
    import javax.ejb.EJBHome;
    ^
    1 error
    then I added the j2ee.jar to my classpath and everything worked fine.
    here are my env vars:
    JAVA_HOME=d:\dev\jdk
    J2EE_HOME=d:\dev\j2sdkee
    CLASSPATH=...;%J2EE_HOME%\lib\j2ee.jar
    If I were you I would double check all the paths you have set up then try a simple case like the one above. If your running NT/2000 make sure the JAVA_HOME, J2EE_HOME and CLASSPATH are system variables not user variables. Another thing you can try is adding the j2ee.jar to the classpath with the -classpath compiler switch.
    javac -classpath %CLASSPATH%;d:\dev\j2sdkee\lib\j2ee.jar test.java
    Other than those things I'm not sure
    Good Luck

  • 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

  • Could not import javax.ejb.* package

    On compiling my EJB program the following errors appears
    C:\bea\wlserver6.0sp1\samples\examples\ejb\basic\ValidateBean>javac ValidateBean
    .java
    ValidateBean.java:3: Package javax.ejb not found in import.
    import javax.ejb.*;
    ^
    ValidateBean.java:4: Class javax.ejb.CreateException not found in import.
    import javax.ejb.CreateException;
    ^
    ValidateBean.java:5: Class javax.ejb.SessionBean not found in import.
    import javax.ejb.SessionBean;
    ^
    ValidateBean.java:6: Class javax.ejb.SessionContext not found in import.
    import javax.ejb.SessionContext;
    ^
    ValidateBean.java:7: Class javax.naming.InitialContext not found in import.
    import javax.naming.InitialContext;
    ^
    ValidateBean.java:8: Class javax.naming.NamingException not found in import.
    import javax.naming.NamingException;
    ^
    ValidateBean.java:9: Package javax.sql not found in import.
    import javax.sql.*;
    ^
    ValidateBean.java:15: Interface javax.ejb.SessionBean of class examples.ejb.basi
    c.ValidateBean.ValidateBean not found.
    public class ValidateBean implements SessionBean {
    ^
    8 errors
    for these errors do i have to install any other package and
    what are the classpath settings required.
    and in which *.jar file, these classes and packages are available

    javax.ejb.* is in j2ee.jar
    if you use weblogic6.0, you need download ejb20.jar from http://www.weblogic.com
    if you use weblogic6.1 ,you need't this file.

  • Importing javax.ejb problems

    Hi,
    I have started learning EJB using netbeans 6.5 running on a mac os X 10.5.6. When i am trying to import javax.ejb and error stating that package javax.ejb does not exist.
    From a search on the net i have learned that on windows os it is a problem of class paths. I don't know how to solve this problem on mac.
    Thanks
    Ray

    Here is what I have done recently:
    I tried it in Eclipse, which also isn't able to find javax.ejb and java.ejb
    What is going wrong? It seems like j2ee.jar doesn't provide these libraries.
    Thank you.

  • Import javax.ejb.*

    Hello,
    i was able to import javax.ejb.*
    i did
    set classpath=c:\j2sdkee1.3.1\lib\j2ee.jar
    then compiled my file, i also need a class file which is in the c:\pro\project3
    called Item.class
    i'm getting an error where i'm doing
    public Item
    it say, can't fine class Item.
    how can i use j2ee.jar and also use Item.class
    thanks alot

    set classpath=c:\j2sdkee1.3.1\lib\j2ee.jar;c:\pro\project3

  • Import javax.ejb errors when compiling

    Hi,
    when I am compiling my EJBs, (I am using Eclipse 2.1.1 , but I got the same thing using Bluej) I am getting errors that point to my import statements such as:
    import javax.ejb.SessionBean;
    do I need to install some jar files anywhere and configure my classpath? in order to be able to use EJBs?
    many thanks
    yan

    thanks,
    I already have j2ee installed and I have the j2ee.jar file in my classpath
    I was wondering if it was something more specific than this
    yan

Maybe you are looking for

  • CS4 / Win: How can I observe a table (insert and delete)

    Hi How can i observe the insertion oder deletion of a table in my Indesign document? I have implemented a doc change observer. But I don't know if it is possible to observe the tables in this observer or how I can do that. Any help? Thanks. Hans

  • How to make GB respond to a program change

    I'm using m-audio keystation 49e and I can get all the different instruments but I can't get Garagebend to recognize the instrument I'm playing, the musical typing function and the playback play it as #0 acoustic piano. I was messing around with it a

  • Some fonts do not convert to PDF

    I'm using Pagemaker 7.0.1a on WinXP. Some fonts such as Sanvito (open type) and Myriad Pro (true type) appear fine in PM but do not convert to PDF where they appear as X placeholders as shown below. Top group is Sanvito, bottom is Myriad, Times worke

  • BAPI's from BW to Java-Urgent!!

    Hello Gurus,       Just wanted to know if anyone has written BAPIs or RFCs ( function modules ) to retrieve data from BW cubes so that the reports could be generated on JAVA application. Which means it doesn't have any table or field information as r

  • Disable Html button in validation process using pl/sql

    Hi, I need to disable a html page button. It gets re-enabled afer a validation process is run on the page and errors for the form are returned. I need a way of writing a validation process using pl/sql returning boolean, that can disable the button a