Problems creating session ejbs in a startup class

public class startupTest implements T3StartupDef
     private T3ServicesDef services;
     public startupTest()
     public String startup(String name, Hashtable args) throws Exception
     try{
          Context initialContext = getContext("t3://localhost:7001");
     DruckAuftragHome dah =     (DruckAuftragHome)initialContext.lookup(
"DruckAuftrag" );
          javax.ejb.EJBObject o = dah.create();
          DruckAuftrag da = (DruckAuftrag) o;
          System.out.println("EEEEEEEEEEEEEEEEEEEEEEEE"+da.makePDF());
          catch(Exception e)
               e.printStackTrace();
          return "";
private static Context getContext(String wlUrl)
throws javax.naming.NamingException
Hashtable env = new Hashtable();
env.put(Context.PROVIDER_URL, wlUrl);
env.put(Context.INITIAL_CONTEXT_FACTORY,
weblogic.jndi.WLInitialContextFactory.class.getName());
Context ctx = new InitialContext(env);
return ctx;
     public void setServices(T3ServicesDef services)
          this.services = services;
Calling the Bean Method works form Servlets and form standalone Clients, but at
startup
java.lang.NullPointerException
at weblogic.utils.io.UnsyncByteArrayInputStream.<init>(UnsyncByteArrayInputStream.java:57)
at weblogic.rmi.internal.ServerRequest.getInputStream(ServerRequest.java:91)
at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:87)
at com.bmw.tais.appserver.ipa.produkt.druckauftrag.DruckAuftragBeanHomeImpl_WLStub.create(DruckAuftragBeanHomeIm
pl_WLStub.java:151)
at com.bmw.tais.helper.startupTest.startup(C:/ipa_wa/IPA/com/bmw/tais/helper/startupTest.java:49)
at weblogic.t3.srvr.StartupThread.runStartup(StartupThread.java:182)
at weblogic.t3.srvr.StartupThread.doWork(StartupThread.java:146)
at weblogic.t3.srvr.PropertyExecuteThread.run(PropertyExecuteThread.java:62)
if i call the bean in a tread over and over again the first exception is a nullpointer
(shown above) and then i get a ClassCastException calling
the create Methode on the DruckAuftragBeanHomeImpl_WLStub.create(DruckAuftragBeanHomeIm
pl_WLStub.java:151)
any ideas?
thanks
regars robert

Hi Robert,
You need to let the server to warm up before
starting using it's services. Check weblogic doc's
for samples.
Regards,
Slava Imeshev
"robert neumaier" <[email protected]> wrote in message
news:[email protected]...
>
public class startupTest implements T3StartupDef
private T3ServicesDef services;
public startupTest()
public String startup(String name, Hashtable args) throws Exception
try{
Context initialContext = getContext("t3://localhost:7001");
DruckAuftragHome dah =(DruckAuftragHome)initialContext.lookup(
"DruckAuftrag" );
javax.ejb.EJBObject o = dah.create();
DruckAuftrag da = (DruckAuftrag) o;
System.out.println("EEEEEEEEEEEEEEEEEEEEEEEE"+da.makePDF());
catch(Exception e)
e.printStackTrace();
return "";
private static Context getContext(String wlUrl)
throws javax.naming.NamingException
Hashtable env = new Hashtable();
env.put(Context.PROVIDER_URL, wlUrl);
env.put(Context.INITIAL_CONTEXT_FACTORY,
weblogic.jndi.WLInitialContextFactory.class.getName());
Context ctx = new InitialContext(env);
return ctx;
public void setServices(T3ServicesDef services)
this.services = services;
Calling the Bean Method works form Servlets and form standalone Clients,but at
startup
java.lang.NullPointerException
atweblogic.utils.io.UnsyncByteArrayInputStream.<init>(UnsyncByteArrayInputStre
am.java:57)
atweblogic.rmi.internal.ServerRequest.getInputStream(ServerRequest.java:91)
atweblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:87)
atcom.bmw.tais.appserver.ipa.produkt.druckauftrag.DruckAuftragBeanHomeImpl_WLS
tub.create(DruckAuftragBeanHomeIm
pl_WLStub.java:151)
atcom.bmw.tais.helper.startupTest.startup(C:/ipa_wa/IPA/com/bmw/tais/helper/st
artupTest.java:49)
atweblogic.t3.srvr.StartupThread.runStartup(StartupThread.java:182)
at weblogic.t3.srvr.StartupThread.doWork(StartupThread.java:146)
atweblogic.t3.srvr.PropertyExecuteThread.run(PropertyExecuteThread.java:62)
>
if i call the bean in a tread over and over again the first exception is anullpointer
(shown above) and then i get a ClassCastException calling
the create Methode on theDruckAuftragBeanHomeImpl_WLStub.create(DruckAuftragBeanHomeIm
pl_WLStub.java:151)
any ideas?
thanks
regars robert

Similar Messages

  • Invalid guid error looking up EJB from a startup class

    Gentlemen,
    I am receiving an "invalid guid at GDS" error that is similar to others reported at:
    http://softwareforum.sun.com/servlet/ProcessRequest?RHIVEID=181&RPAGEID=135&HOID=50B500000008000000FE090000&UCATEGORY_0=_29_%24_24_6_&UCATEGORY_S=0
    and
    http://softwareforum.sun.com/servlet/ProcessRequest?RHIVEID=181&RPAGEID=135&HOID=50B500000008000000FE090000&UCATEGORY_0=_29_%24_24_6_&UCATEGORY_S=0
    In my case, I can retrieve the EJB from my rich client with no problems. However, if I execute the exact
    same code from within a startup class (i.e. com.iplanet.ias.startup.StartupClass) then I get the following error repeated until memory runs out:
    javax.naming.NameNotFoundException: MessageRepositoryBean : Invalid guid null in
    GDS
    at com.netscape.server.ejb.EjbContext.lookup(Unknown Source)
    at com.netscape.server.jndi.RootContext.lookup(Unknown Source)
    at com.netscape.server.jndi.RootContext.lookup(Unknown Source)
    at javax.naming.InitialContext.lookup(InitialContext.java:357)
    at com.netscape.ejb.CorbaHomeFactoryImpl.ConstructEJBHome(Unknown Source
    at com.netscape.CosNaming.NamingContextImpl.resolve(Unknown Source)
    at org.omg.CosNaming._NamingContextImplBase.invoke(_NamingContextImplBas
    e.java:233)
    at com.sun.corba.ee.internal.corba.ServerDelegate.dispatch(ServerDelegat
    e.java:236)
    at com.sun.corba.ee.internal.iiop.ORB.process(ORB.java:227)
    at com.sun.corba.ee.internal.iiop.CachedWorkerThread.doWork(IIOPConnecti
    on.java:262)
    at com.sun.corba.ee.internal.iiop.CachedWorkerThread.run(IIOPConnection.
    java:230)
    javax.naming.NameNotFoundException: MessageRepositoryBean : Invalid guid null in
    In previous answers people have suggested adding various things to the app server classpath. This does not make any difference for me. I am puzzled why code runs fine in a normal rich client, but not in a startup class. Here is the code that I am running:
    try
    String contextFactory = "com.sun.jndi.cosnaming.CNCtxFactory";
    String providerURL = "iiop://localhost:9010";
    Properties p = new Properties();
    p.put(Context.INITIAL_CONTEXT_FACTORY, contextFactory);
    p.put(Context.PROVIDER_URL, providerURL);
    Context context = new InitialContext(p);
    MessageRepositoryHome home = (MessageRepositoryHome)
    PortableRemoteObject.narrow(context.lookup("ejb/MessageRepository"), MessageRepositoryHome.class);
    MessageRepository repository = home.create();
    catch(Exception e)
    e.printStackTrace(Log.err);
    System.exit(1);
    Thanks for your help,
    Mark

    I was mistaken in this posting. I was able to access the EJB from the startup class so there must be something else that I am doing to cause this problem. I'd still like to know why I get those invalid guid errors though.
    By the way, please forgive me for using the gender-specific gentlemen in my posting. That was accidental.

  • Failed to use EJB's from startup class

    Hi,
    we use a startup class to set up some base services of our application.
    The startup class must call some remote methods in a EJB. Unfortunately
    a CLassCastException is thrown when we try to create the EJB by calling
    the create method on its home interface:
    Fr Nov 17 10:47:50 GMT+01:00 2000:<I> <WebLogicServer> Invoking
    T3StartupDef ibs
    startup ch.ebs.ibs.IBSStartup with {}
    java.lang.ClassCastException: weblogic.t3.srvr.StartupThread
    at
    weblogic.rmi.extensions.BasicRequestHandler.handleRequest(BasicReques
    tHandler.java:34)
    at
    weblogic.rmi.extensions.BasicRequestDispatcher.dispatch(BasicRequestD
    ispatcher.java:82)
    at
    weblogic.rmi.internal.ServerRequest.sendOneWay(ServerRequest.java:73)
    at
    weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:77
    at
    ch.ebs.ibs.ejb.SessionControllerEJBHomeImpl_WLStub.create(SessionCont
    rollerEJBHomeImpl_WLStub.java:151)
    at ch.ebs.ibs.IBSStartup.startup(IBSStartup.java:69)
    at
    weblogic.t3.srvr.StartupThread.runStartup(StartupThread.java:182)
    at weblogic.t3.srvr.StartupThread.doWork(StartupThread.java:146)
    at
    weblogic.t3.srvr.PropertyExecuteThread.run(PropertyExecuteThread.java
    :62)
    The same code works fine if we run it as client code (not in the startup
    sequence).
    Any idea?
    Thanks Pascal

    Regarding your problem and the remark you posted to my question in "Calling
    EJBs from a thread in a startup class": It is possible to call methods of an
    EJB from a startup class. I use this functionality to route messages from
    JMS to my EJBs. From what you say, I assume that you are calling the EJB
    from your startup method, which might be a problem, since WL is not
    initialized at this point and does not accept any connections (this
    obviously includes internal connections). You should wait for this phase to
    finish and then use some other mechanism (e.g. a JMS message) to trigger
    your startup class to invoke any home or remote methods on the EJB.
    Looking at your stack trace, I am reminded of a very similar exception I
    encountered when I was experimenting with WL a short while ago. I had put my
    EJB jar file on WL's JAVA_CLASSPATH, just to see how the different
    classloaders work. Of course I don't know if this has any relevance to your
    configuration.
    Andy
    PS: The only exception to what I wrote in the first paragraph seems to be if
    you start a new thread from the startup class. I still haven't managed to
    call my EJB from this thread.
    Pascal Rudin wrote:
    Hi,
    we use a startup class to set up some base services of our application.
    The startup class must call some remote methods in a EJB. Unfortunately
    a CLassCastException is thrown when we try to create the EJB by calling
    the create method on its home interface:
    Fr Nov 17 10:47:50 GMT+01:00 2000:<I> <WebLogicServer> Invoking
    T3StartupDef ibs
    startup ch.ebs.ibs.IBSStartup with {}
    java.lang.ClassCastException: weblogic.t3.srvr.StartupThread
    at
    weblogic.rmi.extensions.BasicRequestHandler.handleRequest(BasicReques
    tHandler.java:34)
    at
    weblogic.rmi.extensions.BasicRequestDispatcher.dispatch(BasicRequestD
    ispatcher.java:82)
    at
    weblogic.rmi.internal.ServerRequest.sendOneWay(ServerRequest.java:73)
    at
    weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:77
    at
    ch.ebs.ibs.ejb.SessionControllerEJBHomeImpl_WLStub.create(SessionCont
    rollerEJBHomeImpl_WLStub.java:151)
    at ch.ebs.ibs.IBSStartup.startup(IBSStartup.java:69)
    at
    weblogic.t3.srvr.StartupThread.runStartup(StartupThread.java:182)
    at weblogic.t3.srvr.StartupThread.doWork(StartupThread.java:146)
    at
    weblogic.t3.srvr.PropertyExecuteThread.run(PropertyExecuteThread.java
    :62)
    The same code works fine if we run it as client code (not in the startup
    sequence).
    Any idea?
    Thanks Pascal

  • Problems importing Session Ejb in Creator

    Hi all,
    I've tries to import a Session Ejb in a web app, usng Creator2.
    I have created the MyEjb.jar containing the ejb's classes, and the deployment descriptors. The ejb do not use any data source.
    Then, I've imported the ejb using the provided procedure:
    Enterprise Java Beans -> Add set of Session EJBs
    I've imported the MyEbj.jar file: I see the Ejb in the palette, and I can drag&drop the method I need.
    The problem is when I try to "run" the web application. I have the following excpetion:
    java.lang.NullPointerException
         at com.sun.rave.ejb.EjbDataSourceServiceImpl.getProjectDataSourceInfo(EjbDataSourceServiceImpl.java:66)
         at com.sun.rave.jsf.project.ext.RaveProjectWebModule.getRequestedResources(RaveProjectWebModule.java:78)
         at com.sun.rave.jsf.project.ext.RaveWebActionProvider.updateWebXml(RaveWebActionProvider.java:806)
         at com.sun.rave.jsf.project.ext.RaveWebActionProvider.invokeAction(RaveWebActionProvider.java:172)
         at org.netbeans.modules.project.ui.actions.MainProjectAction.actionPerformed(MainProjectAction.java:90)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:234)
         at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:231)
         at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:231)
         at java.awt.Component.processMouseEvent(Component.java:5488)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
         at java.awt.Component.processEvent(Component.java:5253)
         at java.awt.Container.processEvent(Container.java:1966)
         at java.awt.Component.dispatchEventImpl(Component.java:3955)
         at java.awt.Container.dispatchEventImpl(Container.java:2024)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
         at java.awt.Container.dispatchEventImpl(Container.java:2010)
         at java.awt.Window.dispatchEventImpl(Window.java:1774)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
    [catch] at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
    and also:
    Error occured when trying to parse the ejb data source file C:\work\Progetti\AreaIt\ProvaWorkSpace\lib\ejb-sources\ejb-refs.xml
    org.xml.sax.SAXParseException: Premature end of file.
    The file is ejb-refs.xml is empty!
    Where is the problem? Any idea ? Who actually creates the ejb-refs.xml file?
    Any suggestion?
    Thanks a lot.
    Marco

    Please, be aware that a value of RMI-IIOP port for Sun Application Server 8.1, bundled with Creator 2.0, is different from this one for Sun Application Server 8.2, bundled with Creator 2.1:
    Sun Application Server 8.1, Creator 2.0 - 23700
    Sun Application Server 8.2, Creator 2.1 - 24700

  • Problem creating a EJB from third party into NWDS

    Hi everybody:
    I´m trying to create a EJB from a third party software (jar file). I imported the jar file into my EJB Module (Properties->Java Build Path->Library), selected the EJB candidate and wrote the ejb-jar.xml according to the vendor's instructions in order to define home and remote interfaces.
    When I deploy my application (containing the EJB Module), I got this error from the server:
    java.rmi.RemoteException: Cannot deploy application sap.com/TestEjbApp.. Reason: Incorrect application sap.com/TestEjbApp:Bean AccountLocateBean: the ejb-class must implement, directly or indirectly, the javax.ejb.SessionBean interface. EJB specification 7.10.2.; nested exception is: com.sap.engine.services.deploy.container.DeploymentException: <--Localization failed: ResourceBundle='com.sap.engine.services.deploy.DeployResourceBundle', ID='com.sap.engine.services.ejb.exceptions.deployment.EJBDeploymentException: Incorrect application sap.com/OlivierTestEjbApp:Bean AccountLocateBean: the ejb-class must implement, directly or indirectly, the javax.ejb.SessionBean interface. EJB specification 7.10.2.
    at com.sap.engine.services.ejb.deploy.verifier.Verifier.check(Verifier.java:66)
    at com.sap.engine.services.ejb.deploy.DeployAdmin.generate(DeployAdmin.java:253)
    at com.sap.engine.services.ejb.EJBAdmin.deploy(EJBAdmin.java:2133)
    I used the same jar in another application server (Sun Open), mounted teh EJB and it ran perfect. Additionally I checked the class and it has the correct "implements javax.ejb.SessionBean" statement in the code.
    Do you have any idea about it?
    Thanks
    Regards
    Olivier
    Message was edited by: Olivier Franco

    Hi Amol:
    Thanks for your answer, Let me explain a little more what I'm doing:
    The third party software is a jar file that contains three classes:
    com.account.AccountLocateSessionBean (Remote Interface)
    com.account.AccountLocateSessionBeanHome (Home Interface)
    com.account.AccountLocateBean (EJB class)
    This 3 classes are EJB 2.0 complaint and were tested in other J2EE container (Sun Open). I want to deploy this EJB into SAP Was J2EE 6.40 server (SP14). In my last post I wrote what I did in order to create de ejb-jar.xml into NWDS. This file looks like:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
                             "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    <ejb-jar>
        <description>EJB JAR description</description>
        <display-name>EJB JAR</display-name>
        <enterprise-beans>
            <session>
                <ejb-name>AccountLocateBean</ejb-name>
                <home>com.account.AccountLocateSessionBeanHome</home>
                <remote>com.account.AccountLocateSessionBean</remote>
                <ejb-class>com.account.AccountLocateBean</ejb-class>
                <session-type>Stateless</session-type>
                <transaction-type>Container</transaction-type>
            </session>
        </enterprise-beans>
    </ejb-jar>
    Then, when I build the ear file (This is a Enterprise application that contains my EJB Module) and try to deploy this ear file into SAP Was J2EE 6.40 server (SP14) I got the exception wrote in my last post.
    Thanks for your help
    Regards
    Olivier

  • Problem creating in some attribute options for class through java API

    Hello everyone,
    I am successfully creating class and its attributes but i am not able to create attributes with its option like IS REQUIRED, IS INDEXED, IS SETTABLE and READ ONLY.....
    public void create_class(String cname,String cdesc,String scname)
    try
    ClassObjectDefinition cod = new ClassObjectDefinition(csession);
    cod.setSuperclassName(scname);
    cod.setName(cname);
    ClassObject co = (ClassObject)csession.createSchemaObject(cod);
    AttributeDefinition ad2 = new AttributeDefinition(csession);
    ad2.setAttributeByUpperCaseName("NAME",AttributeValue.newAttributeValue("Divya"));
    ad2.setAttributeByUpperCaseName("DATATYPE",AttributeValue.newAttributeValue(Attribute.ATTRIBUTEDATATYPE_STRING));
    ad2.setAttributeByUpperCaseName("DATALENGTH",AttributeValue.newAttributeValue(151));
    ad2.setAttributeByUpperCaseName("DESCRIPTION",AttributeValue.newAttributeValue("This the attribute number 2"));
    //here is some problem,,, Is Required is not been able to set
    //ad2.setAttributeByUpperCaseName("REQUIRED",AttributeValue.newAttributeValue(true));
    co.addAttribute(ad2);
    catch(IfsException e)
    e.printStackTrace();
    }

    Hi Kabilesh,
    Could you please let me know the exast soution u had for this?
    I even set the SHLIB_PATH in the environment, but still this problem persists.
    I am compiling the program and making into a shared library as
    cc -c -g -n +z -I$JAVA_HOME/include -I$JAVA_HOME/include/hp-ux -L/opt/java1.4/jre/lib/PA_RISC2.0/server -ljvm Test.c -o Test.o
    ld -b Test.o -L/opt/java1.4/jre/lib/PA_RISC2.0/server -ljvm -o Test.slMy java code is looks like this :
    void create_Jvm()
        JNIEnv * env;
        JavaVM * jvm;
        //JDK1_1InitArgs vm_args;
        /* Note : In JNI1.2 and Java2 SDK 1.4, the new structure JavaVMInitArgs has been introduced.*/
        JavaVMInitArgs vm_args;
        //JavaVMOption options[1];
        jint res;
        vm_args.nOptions = 0;
        vm_args.ignoreUnrecognized = JNI_TRUE;
        /* IMPORTANT: specify vm_args version # if you use JDK1.1.2 and beyond */
        vm_args.version = JNI_VERSION_1_4;
        //vm_args.version = JNI_VERSION_1_2;
        /*In JNI1.2 and Java2 SDK 1.4 the JNI_GetDefaultJavaVMInitArgs method call is not required.*/
        //JNI_GetDefaultJavaVMInitArgs( & vm_args);
        res = JNI_CreateJavaVM( &jvm, (void**)&env, &vm_args);
        if (res < 0) {
            fprintf(stderr, "Can't create Java VM\n Error is :%ld\n ", res);
            exit(1);
        iJvmInitialized = 1;
    } hi
    Check the lib path
    May be u have not included : at the end of the lib
    path that u have added
    THis was the mistake that i did
    kabilesh

  • Not seeing persistEntity or mergeEntity method when creating a session EJB

    Hi all,
    I am using JDev 11g to develop an ADF application. I have finished creating an entity EJB from database tables. Then I want to create a session EJB. In JDev, I do not see persistEntity or mergeEntity method in "<Core Facade Methods>"; rather, I am seeing another method
    public Object queryByRange(String jpqlStmt,int firstResult,int maxResults)
    listed there.
    Could you please let me know why? I am expecting to have persistEntity and mergeEntity methods included in the final created session EJB.
    Thank you.

    Hi,
    Thank you for your reply. But I am still not sure how to use the persist and merge methods from EntityManager. Either I want in the session EJB creation wizard to have persistEntity and mergeEntity to appear under "Core Facade methods", or I want to add these methods in the generated bean java file. I tried the latter by adding these two methods in the bean file, but I got an exception at runtime.
    Please privide some more information. Thank you very much.

  • Call EJB from Start Up class

    I'm using OC4J 10.1.3 Standalone.
    I have a requirement to initialize web services and configuration parameters during app server start up.
    Accordingly,I planned to call a EJB 2.0 stateless session bean from a StartUp class.
    The ejb is responsible for initializing some configurations and web services.The ejb is dependent on some other classes which are present as utility jars .
    However,I cannot somehow figure out how to refer the EJB from my startup class because the EAR which contains the EJB jar is in a child loader to that containing the startup class.
    Please guide me!! Please suggest if some alternative approach could be taken to suffice my requirement.
    TIA

    Avi, I was just waiting for the "servlet hack".
    I really prefer the application client way, much cleaner, no servlet container needed, and could be tested outside the container.
    --olaf                                                                                                                                                                                                                                                                                                                                                                                       

  • Using external util JAR from Session EJB

    I have a Stateless Session EJB that uses some classes packaged in a utility jar. How do I package the EJB jar with this util jar, and get the app server to recognize this utility jar? including a /lib dir with the utils jar in it, like you would with a WAR, doesn't work.
    I've temporarily got this to work by modifying the startup scripts for my app server to ensure my jar is included in the -classpath arg, but this cannot be the intended way. (cannot find details on this in the tutorial).
    Thanks in advance!

    Well, the answer depends a lot on which appserver you're using, because it obviously depends on how the vendor implemented the containers' ClassLoaders. What usually works is dependent upon a portion of the JVM spec regarding the MANIFEST.MF file. If you package your ejb.jar and library.jar in an .ear file, you can put the following in the ejb.jar MANIFEST.MF:
    ClassPath: library.jarNote that there must be at least one blank line at the end of the MANIFEST.MF file.
    This works on WebLogic, but, as an example, JBoss uses a single ClassLoader, so I'm not entirely sure how you'd go about the same thing there.
    And you're quite right - putting it in the JVM ClassPath is not a good idea...

  • Initiating Quartz from a startup class

    Has anyone implemented quartz in a server startup class for scheduling?
    Would this be a potential way of using quartz or is it not recommended?
    Thanks for any thoughts on the subject.
    Toby

    I was mistaken in this posting. I was able to access the EJB from the startup class so there must be something else that I am doing to cause this problem. I'd still like to know why I get those invalid guid errors though.
    By the way, please forgive me for using the gender-specific gentlemen in my posting. That was accidental.

  • Startup class is not working in oc4j

    hi
    I have a servlet .In init of that servlet I will create an instance of a startup class .
    In web.xml configuration I gave <load-on-startup></load-on-startup> .I created a war and an ear and deployed my application .The startup class is not called.
    But when I configured the servlet in the default-web-app the startup class is running.
    And furthur when I hot deploy my ear the startup class is running.
    But when I restart my application server the startup class is not invoked.
    can anybody help
    Regards
    Gajendran.G

    hi
    I had put auto-start=true in server.xml .then also it is not working.
    when I redeploy my ear,the startup class is invoked,but when i restart the
    server it does'nt
    gaj

  • Weblogic startup class: problem calling EJB's

    Has anyone ever experienced a problem in using a startup class (registered in weblogic.properties)
    and tried to lookup and use an EJB in the same application?
    Basically, I have a startup class which registers to receive messages from an
    MQ queue, and when it receives a message, it tries to do a lookup of a bean and
    use it, but I receive a 'NullPointerException'.
    I'm running Weblogic 5.1
    (I know that Weblogic 6.0 makes use of MessageDrivenBeans, but my app isn't using
    6 or EJB 2.0)
    Thanks...

    Can you post weblogic.log? Are you sure that EJB was deployed successfully.
    Also comment the PROVIDER_URL in initial context and see if that solves the problem
    Viresh Garg
    BEA Systems
    shaun wrote:
    The exception is simply a 'NullPointerException' coming from the startup class
    (I don't have the old log file or I would include the trace here.). Basically,
    when my startup class receives a call to the onMessage(...) method (from listening
    for messages), it looks up an EJB on the server, through the InitialContect class
    and gets a 'null' returned back, thereby throwing the NullPointerException.
    If anyone else is successful in having a startup class which can lookup and call
    an EJB within the same Weblogic server, please help.
    Thanks again....
    Viresh Garg <[email protected]> wrote:
    Can you post the exception stack trace? Also what exactly are you doing
    in startup class.
    Viresh Garg
    Principal Developer Relations Engineer
    BEA Systems
    Shaun wrote:
    Has anyone ever experienced a problem in using a startup class (registeredin weblogic.properties)
    and tried to lookup and use an EJB in the same application?
    Basically, I have a startup class which registers to receive messagesfrom an
    MQ queue, and when it receives a message, it tries to do a lookup ofa bean and
    use it, but I receive a 'NullPointerException'.
    I'm running Weblogic 5.1
    (I know that Weblogic 6.0 makes use of MessageDrivenBeans, but my appisn't using
    6 or EJB 2.0)
    Thanks...

  • Problem with ejbs in Netweaver 2004s-Class not found exception

    Hello,
    I have a webdynpro project(Newtweaver 2004s)  referring to a stateless session bean. I created an ejb and defined two public parts - part 1 contains EJB components and part 2 contains some Exception classes I refer to in my webdynpro project. I added these parts to my webdynpro project as dependencies for compile and runtime. I am able to compile and deploy the webdynpro project without any issue but I get runtime errors saying the following:
    com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Failed to create delegate for component com.test.techops.ccf.data.Data. (Hint: Is the corresponding DC deployed correctly? Does the DC contain the component?)
         at com.sap.tc.webdynpro.progmodel.generation.ControllerHelper.createDelegate(ControllerHelper.java:110)
         at com.sap.tc.webdynpro.progmodel.generation.DelegatingComponent.<init>(DelegatingComponent.java:51)
         at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.init(ClientComponent.java:382)
         at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.init(ClientApplication.java:362)
         at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.initApplication(ApplicationSession.java:707)
         at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:269)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:759)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:712)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:261)
         at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:53)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:174)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Caused by: java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
         at com.sap.tc.webdynpro.progmodel.generation.ControllerHelper.createDelegate(ControllerHelper.java:74)
         ... 27 more
    Caused by: java.lang.NoClassDefFoundError: com/test/techops/ccfejb/util/CCFException --> Defined in my ejb (public part)
         at com.test.techops.ccf.data.wdp.InternalData.<init>(InternalData.java:240)
         ... 32 more
    I did not have any issues when the code was running on Netweaver 2004 but now it does not seem to work when I migrated to 2004s. Can anyone please advice me on what the problem might be ?
    Thanks,
    Rama

    Hi Harsha,
    Thanks for your quick reply.
    Trying to figure it out by comparing JRE versions but still no result. I have found one problem is that
    when Gantt is loaded , Java in control panel loads all the Applets requried in to its Resources.
    These Resources are missing for the user for whom the Gantt error is produced.
    Loaded Resources can be found in the below Path :
    ControlPanel -> Java-> General Tab -> View Button -> select Resources in Show .
    So, How to load these resources ??? . Is there any setting to do that ???
    Regards,
    Ravikiran.K

  • Session EJB with external jar dependacy problem

    I have a Session EJB that I am having trouble adding to my Creator 2 project. The session bean is developed with netbeans 5.0, ejb2.1, for sjsas 8.2 PE. It has one external jar which is compiled into the ejb jar. When I try to add the session bean to my creator 2 project I get a java.lang.reflect.UndeclaredThrowableException. Creator 2 is not finding one of the Exception external jar.
    The only way I have been successful in added the session EJB is also add the external jar. But the project fails when you load the page with javax.naming.NameNotFoundException: No object bound to the name java: xxxxxx I believe the EJB is failing at instantiation.
    Has anyone had this problem and overcome it?
    Thanks,
    Francis

    Finally I found solution.
    Instead of deploying ejb jar to ear I've created a new ear deployment profile (so now I have ejb jar profile and ear profile).
    It contains ejb jar + external jar library and custom manifest.mf with class-path to ext. jar.
    Difference between this and previous version is the old one ear cointained ejb jar and the ejb jar contained ext. jar.
    Now ear contains both ejb jar and ext. jar.
    Rado

  • I have got problem to create Session Bean

    Hi
    I am new in j2ee. I have installed the eclipse 3.1, j2sdk1.4.2_07 and tomcat 5.0. I have created a ejb with a session bean and it gives me a error the program doesn't find the class javax.ejb.SessionBean. My question is Can this error happen because I don't have installed J2EE 1.4 SDK and Sun Java System Application Server Platform Edition 8.1?
    thank you

    Hi
    I have tried to put the classpath with j2ee in eclipse but it happens the same. it doesn't find the package javax.ejb.SessionBean.
    I am going to explain i have done from the beginning. Maybe I am wrong in something. I think which is that.
    I have create a proyect with Dynamic Web Proyect after i create a proyect with ejbModule. I attempt to create a file with session bean. In last proyect acceded to Run->Run here i select Apache Tomcat and Tomcat v5.0 Server _ localhost and i select the classpath in "bootstrap entries" i insert the file j2ee.jar. And I' ve got the same error.
    is it fine? I am bored trying to find the problem.
    thanks in advanced

Maybe you are looking for