Classpath problems in EAR packaging?

I try to access an EJB from a JSP. The JSP resides in web.war and the bean is in ejb.jar, and both of these are packaged together in an ear.
I get a compile error when I try opening a JSP. I've had this problem in all my attempts to use my bean classes from JSP.
My browser reports that the compiler cannot find the beans package. I have servlets within the war-file that are able to find the beans package, but the JSPs aren't.
My ear-file contains 3 files
ejb.jar
web.war
META-INF\MANIFEST.MF
The manifest classpath points to ejb.jar and web.war
My guess is that this has something to do with the way this is deployed by GlassFish.
The application is deployed in the
domains\mydomain\applications\j2ee-apps\myear\
This directory contains the expanded files:
ejb_jar\
web_war\
META-INF
So the Java classes under web_war\ are able to see the Java classes under ejb_jar\ (i.e. my servlets)
However; when GlassFish creates Java files from the JSPs and then tries to compile them, these files are placed under
domains\mydomain\generated\jsp\j2ee-apps\myear\web_war\org\apache\jsp\jsp
This might be correct for all I know, but apparently the compiler is unable to find the Java classes located under the mydomain\applications\.. directory when compiling classes located under the mydomain\generated\.. directory. There are no other files from my ear anywhere in the "generated" directory.
So to me this seems to be some kind of classpath problem, as the compiler cannot find the needed files.
Does this make any sense to anyone?
PS
In my ear, the JSPs are placed in the web.war. The war file looks like this:
jsp\
   myjsp.jsp
META-INF
   MANIFEST.MF
WEB-INF
   web.xml
   lib\
      mylib.jarThanks
\\Marius

Marius,
If you want communicate the bean you have to do following things.
. Create a factory for the correct protocol
. Obtain a Home
. Use the Home to create stubs to the remote object
So you want to call the Home and Remote interfaces to access the bean. When you run the client program, it will create the remote object that time it has to search the Home and Remote interfaces. So you have included those files for references in following location
WEB-INF/classes
     -- <Home Interface File Name>.class
     -- <Remote Interface File Name>.class
Or
WEB-INF/lib
     -- <Bean Jar file name>.jar
I think you will understand.
-Mani

Similar Messages

  • Problem in importing package

    i am new to java and facing problems in importing package which are self made.
    secondly does JDK 1.1.3 can support swing

    Hi,
    I had some problems myself. I will add few lines, maybe it helps:
    OK, let's assume that you work in a directory. In this case, set classpath to this hierarchy as well as to "." ('this' hierarchy - like in DOS).
    Now, assume that you want to use packages MyPack1 and MyPack2. The source files of classes belonging to MyPack1 must:
    - start with command
    package MyPack1;
    - be located all in the directory MyPack1
    (and the same for MyPack2, of course)
    If you want to use MyPack1 within MyPack2, you have to include:
    import MyPack1.*;
    even though MyPack1 is, in fact, located on path: ../MyPack1/*
    (trust the classpath is important here)

  • Classpath problem

    i am here stuck..
    my dir structure is
    c:\my\xxx\yyy\zzz
    i have a code ...
    package xxx.yyy.zzz;
    class A
    // some code
    }i have compiled sucessfully and put the clsss file into c:\my\xxx\yyy\zzz folder.
    now i want to import it in another class
    like...
    package xxx.yyy; // note this
    import xxx.yyy.zzz.*; // note this
    class B
    // some code
    // creating instance of class A here
    }question is how do i compile and run it ?
    i am at c:\my---> what should be the command to compile and run the above code?
    plz give me the explicit command so that i can test and verify . i have given the dir structure.
    i have tried several ways but got class not found exception and errors . i know its a classpath problem but i could not figure out what should i type at the c:\my prompt.
    can u give exact command to run and compile the above code in steps ?
    thanx

    question is how do i compile and run it ?You don't with that code. You've defined class A to have "package visibility," meaning it can't be used from outside its package. You should declare it with public visibility instead, like "public class A {...".
    Once you change that, use these commands to compile and run:c:\my\>javac xxx/yyy/zzz/A.java
    c:\my\>javac xxx/yyy/B.java
    c:\my\>java xxx.yyy.B

  • Classpath Problem (Using JSAPI)

    Hi,
    I using IBM Via Voice as a the implementation of the JSAPI on my system. I've downloaded the speech for java pack from IBM Alphaworks and put it in the directory of
    c:\ibmjs
    This gives you access to the speech packages for utilisation in your programs so I should be able to import javax.speech in my programs. However the system doesn't see these classes.
    Heres my Autoexec...
    path=%path%;c:\jdk1.3.1_01\bin;c:\ibmjs\lib;
    CLASSPATH=%CLASSPATH%;c:\ibmjs\lib\ibmjs.jar;
    I presume the whole thing is just a classpath problem, does anybody have any idea from the above paths where I am going wrong?

    i guess you have to put some of ibm's dll files coming with speech for java in the path (not classpath). it's not sufficient to have the directories in the path.
    anyway, there come's an installation manual with speech for java which explaines all that.

  • Coldfusion 7.0 ear package running on websphere application server 6.1

    I try to run a coldfusion ear package on a webspehere 6.1
    application server. It all seems to install correct but when I try
    to open the specific url I get this error:
    Error 500: The Security service is not available.
    Does anyone know what is to be done here to get this ear file
    working.
    This ear file contains the complete coldfusion module as it
    seems and just a small simple script for testing reasons but it
    won't work.
    If anybody can help me with this it would be great.

    This would fall into the realm of anecdotal evidence.
    Business Objects XI 3.1 SP2 FP2.7
    Websphere Application Server 6.1 on Windows, have run environments with fix pack 19, fix pack 23, and fix pack 33 without Websphere related problems.  The list for supported Websphere platforms for Windows is the same as AIX.
    Now having said that, I would suspect that SAP does not test Business Objects with each of the available Websphere fix packs.

  • Again classpath problem

    again classpath problem.... i have tried to solve it in many ways but all failed. here is one
    instance of my effort which did not give me success.
    i have a FOLDER > c:/com/abc/def/ijk
    and files......
    MyClass.java
    ==============
    package com.abc.def.ijk
    class MyClass
    // blah
    // blah
    }c:\com\abc\def\ijk>javac MyClass.java ===>compiled fine and created a class file.
    and also one more file.....
    OneMoreClass.java
    =================
    import com.abc.def.ijk.MyClass
    class OneMoreClass
    // blah
    // blah
    }c:\com\abc\def\ijk>javac OneMoreClass.java ===> Error!!! package com.abc.def.ijk does not exist !!!!
    how can i solve it ?

    yea, this works....eariler i also usued to do this
    way. but this time i forgot.
    by the way, why individually it did not work !!!.Because you were in the package directory itself, and the classpath was set to the cwd, so java was looking for package directories at this level.
    and also when i specify directly by
    c:\com\abc\def\ijk
    javac  -classpath c:\com\abc\def\ijk\MyClass
    OneMoreClass.java ...it does not work!!.
    STRANGE! why ?Because by stating the package directory as classpath, you do the same as explained above. Stay out of package directories, stay one level above them, don't regard them as common directories. When declaring classpaths, don't mention package directories but the directories that contain them.

  • How can I solve a Parse Error: "There was a problem parsing this package"

    Hello;
    I developed a really simple app in Flash Pro CC for android. I published it using AIR 13.0 for Android. When I tried to install it I received the Parse Error: "There was a problem parsing this package"
    Im not sure if the problem has something to do with my app xml file, but here it is:
    <?xml version="1.0" encoding="UTF-8"?>
    <application xmlns="http://ns.adobe.com/air/application/13.0">
         <id>TOeatorNOTTOeat</id>
         <versionNumber>1.0.0</versionNumber>
         <versionLabel>TouchEvent</versionLabel>
         <filename>TO eat or NOT TO eat</filename>
         <description/>
         <name>TO eat or NOT TO eat</name>
         <copyright/>
         <initialWindow>
              <content>TO%20eat%20or%20NOT%20TO%20eat.swf</content>
              <systemChrome>standard</systemChrome>
              <transparent>false</transparent>
              <visible>true</visible>
              <fullScreen>true</fullScreen>
              <aspectRatio>landscape</aspectRatio>
              <renderMode>gpu</renderMode>
              <autoOrients>false</autoOrients>
         </initialWindow>
         <icon>
              <image36x36>icons/icon36x36.png</image36x36>
              <image48x48>icons/icon48x48.png</image48x48>
              <image72x72>icons/icon72x72.png</image72x72>
              <image96x96>icons/icon96x96.png</image96x96>
         </icon>
         <customUpdateUI>false</customUpdateUI>
         <allowBrowserInvocation>false</allowBrowserInvocation>
        <android>
              <manifestAdditions>
                   <![CDATA[<manifest> </manifest>]]>
              </manifestAdditions>
         </android>
         <supportedLanguages>en</supportedLanguages>
    </application>
    What do you think is the best to check?

    i don't see any problem with your manifest.
    try saving your fla and the published files to a new directory and see if the error resolves.

  • Problem Running SSIS Package with a SQL Server Agent

    SQL Server: SQL Server 2012
    VS: Visual Studio 2012
    Hello,
          I have been having a problem running SSIS packages by using a SQL Server Agent job. I first created these SSIS packages in a separate IS project in Visual Studio. I imported the packages to the Integration Services (Package
    Store) instance on my SQL Server and tried to create a job that would run them from there.
          At first I read around about needing a proxy account to allow the agent/packages to access the file system since these packages are importing data from a flat file in the SQL database. So I created a temporary admin user to
    use as the user for the agent. I did this by going to Services.msc on the server and linked the account the agent's "logon as". Then arose another issue where I am getting an error about using the incorrect type for my connection managers.
    The connection manager "TestFile" is an incorrect type.  The type required is "OLEDB". The type available to the component is "FLATFILE". Source: Data Flow Task Flat File Destination [2]     Description:
    Cannot open the datafile "O:\*****\Success.txt"
    I am not sure what this even means as I am getting this error even with a test package that doesn't do anything with the database. I have just two flat file connection managers  in this test project one for grabbing the source file and one for
    creating the new test file.
    I am not sure what to do.
    Thanks in advance,
    Matt

    I accidently created two posts. The newest one has the details.
    I did not mean to.
    SQL Server: SQL Server 2012
    VS: Visual Studio 2012
    Hello,
          I have been having a problem running SSIS packages by using a SQL Server Agent job. I first created these SSIS packages in a separate IS project in Visual Studio. I imported the packages to the Integration Services (Package
    Store) instance on my SQL Server and tried to create a job that would run them from there.
          At first I read around about needing a proxy account to allow the agent/packages to access the file system since these packages are importing data from a flat file in the SQL database. So I created a temporary admin user to
    use as the user for the agent. I did this by going to Services.msc on the server and linked the account the agent's "logon as". Then arose another issue where I am getting an error about using the incorrect type for my connection managers.
    The connection manager "TestFile" is an incorrect type.  The type required is "OLEDB". The type available to the component is "FLATFILE". Source: Data Flow Task Flat File Destination [2]     Description:
    Cannot open the datafile "O:\*****\Success.txt"
    I am not sure what this even means as I am getting this error even with a test package that doesn't do anything with the database. I have just two flat file connection managers  in this test project one for grabbing the source file and one for
    creating the new test file.
    I am not sure what to do.
    Thanks in advance,
    Matt

  • Unable to update itunes. help. error message when trying to update to latest version of itunes. "the installer has encountered an unexpected error installing this package. this may indicate a problem with this package. error code 2721"

    unable to update itunes. help. error message when trying to update to latest version of itunes. "the installer has encountered an unexpected error installing this package. this may indicate a problem with this package. error code 2721"

    Hello chae84swangin,
    I recommend following the steps in the article below when getting an error message trying to install iTunes:
    Trouble installing iTunes or QuickTime for Windows
    http://support.apple.com/kb/HT1926
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • Problem with ear speaker

    hello. when i make a call i hear some shshshsh in ear speaker . is that normal too it not very high sound but its still there ..but when i use my headset i didnt hear shshsh sound . its new phone i just bought it yesterday .. is that normal or i go back to store to fix it .. its not very high sound but when i focus i hear shshshshsh in ear speaker 

     the problem at number 2 look at picture when i speak i hear some shshsh..the sim card new and its very good too problem with ear speaker i think i want to know its normal or not becouse when i use headset i didnt hear that shssh sound .. 

  • How to access ejb jar in ear package from other war web package?

    How to access ejb in jar packed in ear package from other war web package?

    Typically you would just look the EJB Home up in JNDI. If you're
    looking for example code, the medrec example in WLS 8.1 or petstore has
    plenty of webapps calling EJBs.
    -- Rob
    CottonXu wrote:
    How to access ejb in jar packed in ear package from other war web package?

  • Fragment Bundle Classpath problems

    Does anyone have any tips for solving classpath problems in fragment bundles? I'm getting a no-class-def that I can't explain.
    I've used maven to create a fragment, hosted by com.day.crx.sling.server, to create a custom login. It needs to call a web service, so I've included httpclient-4.2.3.jar. I can see this jar listed on the deployed fragment's Bundle-ClassPath, via the osgi>bundle console. When I inspect the bundle that maven created, I can find this jar contained in the bundle jar, in the directory specified in the Bundle-ClassPath. I even oppened the httpclient jar to ensure that the offending class (org/apache/http/client/HttpClient) is there.
    This is the first fragment that I've tried to build. Is there something I don't know about how they load classes?
    Does anyone have any tips or tricks on solving osgi classpath problems? I read that felix has some tools, but I haven't found any documentation about them.

    I'm still not sure why the classes didn't load, but I have a solution to my problem - don't try to include the jars in the fragment bundle. I tracked down osgi-ready versions of the libraries that I needed and and installed them.

  • Problem with oracle packages CREATE PACKAGE some packagename in MaxDB

    Hi All,
    I am having Problems in Creating Packages from MaxDB ..Does MaxDB supports the CREATE PACKAGE <some packagename>concept ? if so please help me how to achieve in creating packages ..
    My sample Oracle package Creation is as follows:
    CREATE OR REPLACE PACKAGE BODY acs
    AS
      FUNCTION add_user (
        user_id     IN users.user_id%TYPE DEFAULT NULL,
        object_type     IN acs_objects.object_type%TYPE DEFAULT 'user',
        creation_date   IN acs_objects.creation_date%TYPE DEFAULT sysdate,
        creation_user   IN acs_objects.creation_user%TYPE DEFAULT NULL,
        creation_ip     IN acs_objects.creation_ip%TYPE DEFAULT NULL,
      ) RETURN users.user_id%TYPE
      IS
        v_user_id       users.user_id%TYPE;
        v_rel_id        membership_rels.rel_id%TYPE;
      BEGIN
        v_user_id := acs_user.new (user_id, object_type, creation_date,
                    creation_user, creation_ip, email, ...
        RETURN v_user_id;
      END;
    END acs;
    show errors Can you Please Explain me how to write the same Package in MaxDB?
    Thanks & Regards,
    Shanmukh
    Edited by: shanmukh babu on May 16, 2008 10:11 AM

    Hi Shanmukh,
    MaxDB does not have packages like you'll find them in Oracle.
    But you can define your own functions and procedures.
    From the code-example you posted, I would say that a procedure will do it ...
    I suggest that you first read the documentation on procedures [CREATE DBPROC Statement|http://maxdb.sap.com/doc/7_6/a7/41ee11605911d3a98800a0c9449261/frameset.htm]
    There you'll also find an example in the Tutorial section.
    Be aware that the procedural capabilities of MaxDB are far less enlarged as in Oracle - but they do exist and work in their realm.
    So porting a full PL/SQL application layer to MaxDB procedures may turn out to be quite difficult and/or not the best choice at all.
    KR Lars

  • URGENT :   EP 7.0 /ECC 5.0  -   Problem with Business Package : ESS/MSS

    Dear Portal Gurus,
    We are facing a problem with business package for ESS/MSS
    Our system Info is as under :
    Portal:- NW 2004s
    ERP2004: - (R3 ECC 5.0)
    ESS:- BP for Employee Self-Service (mySAP ERP 2004) 60.2
    MSS:- BP for Manager Self-Service (mySAP ERP 2004) 60.1.1
    SAP XSS  à (SAP ESS 100, SAP MSS 100 and SAP PCUI_GP 100 , all upto SP 12)
    After the Business Packages were installed,found that some  ess apps where not deployed...so manually deployed it.
    The JCO connections are OK.
    Do we need to set up the backend Homepage Framework for the same......even for preview.....was thinking not.
    Also, here is the error and exception that we get when we preview any ESS iview.
    A critical error has occured. Processing of the service had to be terminated. Unsaved data has been lost.
    Please contact your system administrator.
    You dont have the authorization to start service sap.com/pcui_gp~xssutils/XssMenuArea.
    com.sap.pcuigp.xssfpm.java.FPMRuntimeException: You dont have the authorization to start service sap.com/pcui_gp~xssutils/XssMenuArea.
    at com.sap.pcuigp.xssfpm.java.MessageManager.raiseException(MessageManager.java:111)
    at com.sap.pcuigp.xssfpm.java.MessageManager.raiseException(MessageManager.java:121)
    at com.sap.pcuigp.xssfpm.wd.BackendConnections.initBackend(BackendConnections.java:234)
    at com.sap.pcuigp.xssfpm.wd.BackendConnections.connectModel(BackendConnections.java:159)
    at com.sap.pcuigp.xssfpm.wd.wdp.InternalBackendConnections.connectModel(InternalBackendConnections.java:183)
    Thanks.
    Message was edited by: Ashutosh Rana

    I got the same problem :/
    not the authorization, but the fields in working time is displaying wrong.. (too big)
    Any solution to this?
    Best Regards
    Kristoffer Engh

  • Another simple classpath problem question

    Hi All
    Yes I know, there are a lots of questions about this matter, but I couldn't found a solution to my problem.
    I have a simple program:
    public class prueba {
            public static void main(String[] args) {
                    System.out.println("Ahi va...");
    }placed in /tmp/javier/prueba.java
    After compiled, I've tried to run it from / and then problems started:
    cd /
    java /tmp/javier/prueba
    Exception in thread "main" java.lang.NoClassDefFoundError: /tmp/javier/prueba (wrong name: prueba)
    I said, ok...it could be a classpath problem...then:
    java -cp /tmp/javier/ /tmp/javier/prueba
    Exception in thread "main" java.lang.NoClassDefFoundError: /tmp/javier/prueba
    Damn, another try...
    java -cp .:/tmp/javier/ /tmp/javier/prueba
    Exception in thread "main" java.lang.NoClassDefFoundError: /tmp/javier/prueba (wrong name: prueba)
    Jesus Christ....may be the last slash....
    java -cp .:/tmp/javier /tmp/javier/prueba
    Exception in thread "main" java.lang.NoClassDefFoundError: /tmp/javier/prueba (wrong name: prueba)
    Oh...no.... may be classpath to java classes..
    java -cp .:/usr/java/j2sdk1.4.2_01/lib/jre/:/tmp/javier/ /tmp/javier/prueba
    Exception in thread "main" java.lang.NoClassDefFoundError: /tmp/javier/prueba (wrong name: prueba)
    Well, I don't know why this error happens....
    Please, could somebody help me !!!
    Thanks in advance...
    <jl>

    It's not too early to start following the Sun coding
    conventions for Java:
    http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.
    tmlHi
    thanks for your reply.
    Yes, I agree. I use conventions with my programs. But my real problem was with a real application and then I did quickly this simple code to help others to understand the problem and give a fast reply...
    Let me know if that works. (It was fine on my
    machine.) - MODYes it works fine, thanks.... and Damn...Murphys law again, the only option I didn't tried is the solution to my problem... :)
    Thanks again...

Maybe you are looking for