Problem in invoking LiveCycle using EJB

Hi All,
I am trying to invoke LC using EJB protocol. I referred the code example from the link http://help.adobe.com/en_US/livecycle/9.0/programLC/help/index.htm?content=001001.html#154 8359
But I am facing the problem in the same code. Here is the stack trace for the same:
Error Occurred: Exception thrown is NOT a
DSCException : UnExpected From DSC
com.adobe.idp.um.api.UMException  
| [com.adobe.livecycle.usermanager.client.AuthenticationManagerServiceClient] errorCode:16385 errorCodeHEX:0x4001 message:Exception thrown is NOT a DSCException : UnExpected From DSC chainedException:java.lang.IllegalStateExceptionchainedExceptionMessage:null chainedException trace:java.lang.IllegalStateException
at com.adobe.idp.dsc.clientsdk.ServiceClientFactory$1.handleThrowable( 
ServiceClientFactory.java:69)at com.adobe.idp.dsc.clientsdk.ServiceClient.invoke( 
ServiceClient.java:220)at com.adobe.livecycle.usermanager.client.AuthenticationManagerServiceClient.authenticate( 
AuthenticationManagerServiceClient.java:109)at in.gov.ebiz.eforms.invocation.AuthenticateUsersTest.main( 
AuthenticateUsersTest.java:47)Caused by: java.lang.NoClassDefFoundError:  
javax/ejb/EJBException
at com.adobe.idp.dsc.clientsdk.ServiceClientFactory.evaluateMessageDispatcher( 
ServiceClientFactory.java:587)at com.adobe.idp.dsc.clientsdk.ServiceClient.invoke( 
ServiceClient.java:215)... 2 more
Caused by:  
java.lang.ClassNotFoundException: javax.ejb.EJBException
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged( 
Native Method)at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 4 more
at com.adobe.livecycle.usermanager.client.ManagerServiceClient.throwNonUMExceptionAsUMExcept ion( 
ManagerServiceClient.java:53)at com.adobe.livecycle.usermanager.client.ManagerServiceClient.handleException( 
ManagerServiceClient.java:95)at com.adobe.livecycle.usermanager.client.AuthenticationManagerServiceClient.authenticate( 
AuthenticationManagerServiceClient.java:113)at in.gov.ebiz.eforms.invocation.AuthenticateUsersTest.main( 
AuthenticateUsersTest.java:47)
Please advice me. Am I missing some jar? or Do I need to configure some settings at the server end?
Regards,
Ambika

The .xml and code looks ok. Using java:comp/env is the right approach. How does getInitialContext() instantiate the InitialContext()? Make sure it's using the no-arg "new InitialContext" Also try running the $APS_HOME/bin/verifier on your .ear. Please also post the full stack trace. Thanks.
--ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • How to use EJB in JSP...urgent!!!

    hello,
    i am novice programmer in EJB.
    i am using weblogic 6.1 ...
    my problem is how to use EJB in jsp page.
    my code is as follow..but its not displaying any result.
    <%@ page import="javax.naming.InitialContext,
    javax.naming.Context,
    java.util.Properties,
    firstEJB.First,
    firstEJB.FirstHome"%>
    <%
         long t1 = System.currentTimeMillis();
         System.out.println(t1);
         Properties props = new Properties();
         p.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.TengahInitialContextFactory");
         props.put(Context.PROVIDER_URL, "localhost:7001");
         Context ctx = new InitialContext(props);
         FirstHome home = (FirstHome)ctx.lookup("FirstEJB");
         First bean = home.create();
         String time = bean.getTime();
         bean.remove();
         ctx.close();
         long t2 = System.currentTimeMillis();
    %>
    <html>
         <head>
              <style>p { font-family:Verdana;font-size:12px; }</style>
         </head>
         <body>
              <p>Message received from bean = "<%= time %>".<br>Time taken :
              <%= (t2 - t1) %> ms.</p>
         </body>
    </html>
    please tell me the solution.

    Hi, I don't know if it may be the cuase of your problems, but you should narrow the Object obtained doing the lookup, like this:
    FirstHome home = (FirstHome) PortableRemoteObject.narrow(ctx.lookup("FirstEJB"), FirstHome.class);

  • IllegalStateException while invoking livecycle formserver using java api

    I am new to livecycle formserver.when i am trying to invoke formserver using java api ,it is giving illegal state exception.My servlet application to invoke formserver is deployed in tomcat 5.o in one system and jboss with formserver is in anohter system.
    I am using the following properties to connect formserver in another system.
    Properties ConnectionProps = new Properties();
    ConnectionProps.setProperty("DSC_DEFAULT_EJB_ENDPOINT", "jnp://172.21.49.116:JBoss:1099");
    ConnectionProps.setProperty("DSC_TRANSPORT_PROTOCOL","EJB");
    ConnectionProps.setProperty("DSC_SERVER_TYPE", "JBoss");
    ConnectionProps.setProperty("DSC_CREDENTIAL_USERNAME", "administrator");
    ConnectionProps.setProperty("DSC_CREDENTIAL_PASSWORD", "password");
    And i am confusing in setting the following paths using UrlSpec object.
    URLSpec urlspec = new URLSpec();
    urlspec.setApplicationWebRoot("http://JBOSS:8080/FormServer");
    out.println("after webroot");
    urlspec.setContentRootURI("http://localhost:8080/srvapp");
    out.println("after contentroot");
    urlspec.setTargetURL("http://localhost:8080/srvapp/HandleData");
    My .xdp file is in my localsystem where my tomcat is running.and renderToHtml method is like this:
    FormsResult formOut = Fsc.renderHTMLForm(formName, TransformTo.AUTO,oInputData,htmlRenderSpec,"",urlspec,null);
    i am passing the path of the .xdp file in my local system to formName parameter.
    with this code i am facing problem.Is there anything wrong in my code?or is there any settings to change in formserver?
    please help me with this problem,i am trying to sort out this problem.
    Any help?
    Thanks in Advance

    If you are invoking LiveCycle ES2 on JBoss compile with JDK 1.6 and run against JRE 6.
    Steve

  • I have a problem when running my own EJB as a TUXEDO service using WTC.

    Hello,
    I have a problem when running my own EJB as a TUXEDO service using WTC. I am using TUXEDO 8.1 and WL 9.1.
    When I am trying to run my own EJB as a TUXEDO service error appears.
    TPENOENT(6):0:0:TPED_MINVAL(0):QMNONE(0):0:Could not find service TOUPPER
    at weblogic.wtc.gwt.WTCService.getImport(WTCService.java:4988)
    at weblogic.wtc.gwt.TuxedoConnection.getImport(TuxedoConnection.java:303)
    at weblogic.wtc.gwt.TuxedoConnection.tpcall(TuxedoConnection.java:1302)
    at examples.MyTestSessionBean.Toupper(MyTestSessionBean.java:102)
    at examples.TestSessionBean_knby6k_EOImpl.Toupper(TestSessionBean_knby6k_EOImpl.java:61)
    at net.roseindia.web.servlets.SessionTestServlet.doGet(SessionTestServlet.java:69)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:225)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:127)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:272)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:165)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3153)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1973)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1880)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1310)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:179)
    e8
    10
    java.rmi.RemoteException: EJB Exception: ; nested exception is:
    java.lang.NullPointerException
    at weblogic.ejb.container.internal.EJBRuntimeUtils.throwRemoteException(EJBRuntimeUtils.java:95)
    at weblogic.ejb.container.internal.BaseEJBObject.handleSystemException(BaseEJBObject.java:713)
    at weblogic.ejb.container.internal.BaseEJBObject.handleSystemException(BaseEJBObject.java:681)
    at weblogic.ejb.container.internal.BaseEJBObject.postInvoke1(BaseEJBObject.java:447)
    at weblogic.ejb.container.internal.StatelessEJBObject.postInvoke1(StatelessEJBObject.java:72)
    at weblogic.ejb.container.internal.BaseEJBObject.postInvokeTxRetry(BaseEJBObject.java:374)
    at examples.TestSessionBean_knby6k_EOImpl.Toupper(TestSessionBean_knby6k_EOImpl.java:75)
    at net.roseindia.web.servlets.SessionTestServlet.doGet(SessionTestServlet.java:69)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:225)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:127)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:272)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:165)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3153)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1973)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1880)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1310)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:179)
    Caused by: java.lang.NullPointerException
    at examples.MyTestSessionBean.Toupper(MyTestSessionBean.java:130)
    at examples.TestSessionBean_knby6k_EOImpl.Toupper(TestSessionBean_knby6k_EOImpl.java:61)
    ... 15 more
    Any clue on this.
    With Regards,
    MVS

    If you are trying to create a Tuxedo service in Java using WTC you need to develop an EJB that implements the TuxedoService interface and register its home in JNDI so WTC can look it up. Once that is done you can then export the service to a remote domain in the WTC configuration.
    Regards,
    Todd Little
    Oracle Tuxedo Chief Architect

  • Problem with "package-info.java" using EJB 3.0 and OC4J

    Hi all.
    I already posted this question on JDeveloper forum, but didn't get any answer,
    so I'll try posting here.
    Anyway, I'm new both to JDeveloper and J2EE,
    so I'm trying out examples for EJB 3.0, and I got stuck at "Use Security Annotations with EJB 3.0"
    (http://www.oracle.com/technology/tech/java/oc4j/ejb3/howtos-ejb3/howtoejb30security/doc/how-to-ejb30-security-ejb.html).
    Example code is working perfectly, if one builds it using Ant, but I'm importing all examples into JDeveloper (or at least I'm trying to :))
    JDeveloper can't build file "package-info.java" containing following code:
    @javax.annotation.security.SecurityRoles(roleNames={"superuser", "user"})
    package oracle.ejb30;I'm getting following output in "Compiler - Log" window:
    Error(2,1): 'class', 'interface', or 'enum' expected.
    Help much appreciated...
    platform used:
    Windows XP SP2
    JDeveloper Studio (Version 10.1.3, Build 3412)
    JDK 1.5_06
    OC4J 10.1.3 developer preview 4 (standalone version)

    Since you're using EJBs, you can use JTA and can skip the getTransaction() calls. If you want to use getTransaction().begin() and commit(), then make sure that your EntityManager is resource-local. The configuration for this is in persistence.xml. Set a transaction-type of RESOURCE_LOCAL rather than JTA.

  • Problems in configuring deployment descriptors to use EJB in JSP

              Hello,
              I've been trying to use an EJB in a JSP on Weblogic 8.1. The relevent part of
              my web.xml and weblogic.xml look like this:
              =====================================
              web.xml -
              <ejb-ref>
              <description>Purchase order bean deployed</description>
              <ejb-ref-name>ejb/Purchaseorder</ejb-ref-name>
              <ejb-ref-type>Entity</ejb-ref-type>
              <home>mypackage2.PurchaseorderHome</home>
              <remote>mypackage2.Purchaseorder</remote>
              <ejb-link>/PO.jar#Purchaseorder</ejb-link>
              </ejb-ref>
              <ejb-local-ref>
              <description>purchase order</description>
              <ejb-ref-name>ejb/Purchaseorder</ejb-ref-name>
              <ejb-ref-type>Entity</ejb-ref-type>
              <local-home>mypackage2.PurchaseorderLocalHome</local-home>
              <local>mypackage2.PurchaseorderLocal</local>
              <ejb-link>/PO.jar#Purchaseorder</ejb-link>
              </ejb-local-ref>
              =====================================
              weblogic.xml -
              <ejb-reference-description>
              <ejb-ref-name>ejb/Purchaseorder</ejb-ref-name>
              <jndi-name>Purchaseorder</jndi-name>
              </ejb-reference-description>
              </reference-descriptor>
              =================================
              My ejb-jar.xml file looks like this (this EJB jar is already deployed on Weblogic):
              <description>Entity Bean ( CMP )</description>
              <display-name>Purchaseorder</display-name>
              <ejb-name>Purchaseorder</ejb-name>
              <home>mypackage2.PurchaseorderHome</home>
              <remote>mypackage2.Purchaseorder</remote>
              <local-home>mypackage2.PurchaseorderLocalHome</local-home>
              <local>mypackage2.PurchaseorderLocal</local>
              <ejb-class>mypackage2.PurchaseorderBean</ejb-class>
              ==============================================
              Finally, my weblogic-ejb-jar.xml looks like this:
              <weblogic-ejb-jar>
              <weblogic-enterprise-bean>
              <ejb-name>Purchaseorder</ejb-name>
              <jndi-name>Purchaseorder</jndi-name>
              </weblogic-enterprise-bean>
              </weblogic-ejb-jar>
              ===============================================
              But despite many many efforts, I keep getting the following error:
              Could not setup environment - with nested exception: [weblogic.deployment.EnvironmentException:
              [J2EE:160101]Error: The ejb-link '/PO.jar#Purchaseorder' declared in the ejb-ref
              or ejb-local-ref 'ejb/Purchaseorder' in the application module 'public_html' could
              not be resolved. The target EJB for the ejb-ref could not be found. Please ensure
              the link is correct.] weblogic.deployment.EnvironmentException: [J2EE:160101]Error:
              The ejb-link '/PO.jar#Purchaseorder' declared in the ejb-ref or ejb-local-ref
              'ejb/Purchaseorder' in the application module 'public_html' could not be resolved.
              The target EJB for the ejb-ref could not be found. Please ensure the link is correct.
              at
              I have changed around a lot of things. I've a classes directory under web-inf
              where I have mypackage2\all-the-class-files. I've also made available PO.jar file
              (which contains Purchaseorder) at various levels to ensure that the class can
              be found. I've changed the "/PO.jar#Purchaseorder" value of <ejb-link> tag accordingly
              to try various things. (e.g ejb/Purchaseorder, mypackage2.Purchaseorder, and a
              lot of other things) but of no avail. I keep getting the same error over and over
              again. (Do you think banging my head on the wall would do the trick?)
              Any help would be greatly appreciated. Thanks.
              

              Sam, thanks for the explanation. It makes sense now that why it's not working.
              But is this specific to Weblogic? I'm actually using JDevloper to develop my
              EJB (CMP) and JSP. Within JSP, I can use the tag library ejbtag provided by Oracle
              to specify home, create instance, and get collection back from an EJB. I've specify
              the tag lib URI in the web.xml but I kept getting the error message in Weblogi
              when running the test to load JSP saying that it could not find the EJB (Purchaseorder)
              specified. That led me to do some research and I came accross the <ejb-ref> and
              <ejb-link> tags.
              If it is a restriction only posed by Weblogic then I guess I'll have to create
              a JavaBean to interact with EJB first and then get the collection.
              Thanks.
              Sam Pullara <[email protected]> wrote:
              >You can only use ejb-links when connecting to EJBs that are in the same
              >
              >application (ear). If you want to have them separate you will have to
              >
              >use a global JNDI name for the EJB and look up that.
              >
              >Sam
              >
              >A Roman wrote:
              >> Michael,
              >>
              >> I'm not deploying EJB as an .ear application that'd include web app
              >and .jar.
              >> Instead I have deployed .jar as stand alone EJB and want to deploy
              >.war (exploded
              >> directory structure) as a seperate web app. Both .jar and .war will
              >be deployed
              >> on the same server. That's exactly why I cannot use the syntax that's
              >used in
              >> the samples.
              >>
              >> Thanks.
              >>
              >> "Michael Kovacs" <[email protected]> wrote:
              >>
              >>>I guess to start off with I'm making the assumption that your PO.jar
              >>>is your
              >>>EJB module
              >>>and that it is contained in the same EAR as your webapp module, looking
              >>>something like
              >>>this:
              >>>
              >>>myEAR.ear
              >>> |_ PO.jar
              >>> |_ webapp
              >>> |_ jspCallingEJB.jsp
              >>>
              >>>If this is correct, the first thing I'd suggest trying is to remove
              >your
              >>>"/"
              >>
              >>>from the front of your <ejb-link> and
              >>
              >>>just make the value <ejb-link>PO.jar#Purchaseorder</ejb-link>
              >>>
              >>>The EJB example that ships with 8.1 platform makes use of an EJB from
              >>>a jsp
              >>>page so you could
              >>>look to that example for some guidance, which references the EJB in
              >this
              >>>same way in the web.xml ejb-local-ref element.
              >>>hope that helps.
              >>>--
              >>>Michael Kovacs
              >>>Senior Software Engineer
              >>>BEA Systems
              >>>"ARoman" <[email protected]> wrote in message
              >>>news:[email protected]...
              >>>
              >>>>Hello,
              >>>>
              >>>>I've been trying to use an EJB in a JSP on Weblogic 8.1. The relevent
              >>>
              >>>part
              >>>of
              >>>
              >>>>my web.xml and weblogic.xml look like this:
              >>>>=====================================
              >>>>web.xml -
              >>>>
              >>>> <ejb-ref>
              >>>> <description>Purchase order bean deployed</description>
              >>>> <ejb-ref-name>ejb/Purchaseorder</ejb-ref-name>
              >>>> <ejb-ref-type>Entity</ejb-ref-type>
              >>>> <home>mypackage2.PurchaseorderHome</home>
              >>>> <remote>mypackage2.Purchaseorder</remote>
              >>>> <ejb-link>/PO.jar#Purchaseorder</ejb-link>
              >>>>
              >>>> </ejb-ref>
              >>>>
              >>>> <ejb-local-ref>
              >>>> <description>purchase order</description>
              >>>> <ejb-ref-name>ejb/Purchaseorder</ejb-ref-name>
              >>>> <ejb-ref-type>Entity</ejb-ref-type>
              >>>> <local-home>mypackage2.PurchaseorderLocalHome</local-home>
              >>>> <local>mypackage2.PurchaseorderLocal</local>
              >>>> <ejb-link>/PO.jar#Purchaseorder</ejb-link>
              >>>> </ejb-local-ref>
              >>>>=====================================
              >>>>
              >>>>weblogic.xml -
              >>>><ejb-reference-description>
              >>>><ejb-ref-name>ejb/Purchaseorder</ejb-ref-name>
              >>>><jndi-name>Purchaseorder</jndi-name>
              >>>></ejb-reference-description>
              >>>></reference-descriptor>
              >>>>=================================
              >>>>My ejb-jar.xml file looks like this (this EJB jar is already deployed
              >>>
              >>>on
              >>>Weblogic):
              >>>
              >>>>
              >>>> <description>Entity Bean ( CMP )</description>
              >>>> <display-name>Purchaseorder</display-name>
              >>>> <ejb-name>Purchaseorder</ejb-name>
              >>>> <home>mypackage2.PurchaseorderHome</home>
              >>>> <remote>mypackage2.Purchaseorder</remote>
              >>>> <local-home>mypackage2.PurchaseorderLocalHome</local-home>
              >>>> <local>mypackage2.PurchaseorderLocal</local>
              >>>> <ejb-class>mypackage2.PurchaseorderBean</ejb-class>
              >>>> ==============================================
              >>>>Finally, my weblogic-ejb-jar.xml looks like this:
              >>>>
              >>>><weblogic-ejb-jar>
              >>>> <weblogic-enterprise-bean>
              >>>> <ejb-name>Purchaseorder</ejb-name>
              >>>> <jndi-name>Purchaseorder</jndi-name>
              >>>> </weblogic-enterprise-bean>
              >>>></weblogic-ejb-jar>
              >>>>===============================================
              >>>>
              >>>>But despite many many efforts, I keep getting the following error:
              >>>>
              >>>>Could not setup environment - with nested exception:
              >>>
              >>>[weblogic.deployment.EnvironmentException:
              >>>
              >>>>[J2EE:160101]Error: The ejb-link '/PO.jar#Purchaseorder' declared
              >in
              >>>
              >>>the
              >>>ejb-ref
              >>>
              >>>>or ejb-local-ref 'ejb/Purchaseorder' in the application module
              >>>
              >>>'public_html' could
              >>>
              >>>>not be resolved. The target EJB for the ejb-ref could not be found.
              >>>
              >>>Please
              >>>ensure
              >>>
              >>>>the link is correct.] weblogic.deployment.EnvironmentException:
              >>>
              >>>[J2EE:160101]Error:
              >>>
              >>>>The ejb-link '/PO.jar#Purchaseorder' declared in the ejb-ref or
              >>>
              >>>ejb-local-ref
              >>>
              >>>>'ejb/Purchaseorder' in the application module 'public_html' could
              >not
              >>>
              >>>be
              >>>resolved.
              >>>
              >>>>The target EJB for the ejb-ref could not be found. Please ensure the
              >>>
              >>>link
              >>>is correct.
              >>>
              >>>>at
              >>>>
              >>>>I have changed around a lot of things. I've a classes directory under
              >>>
              >>>web-inf
              >>>
              >>>>where I have mypackage2\all-the-class-files. I've also made available
              >>>
              >>>PO.jar file
              >>>
              >>>>(which contains Purchaseorder) at various levels to ensure that the
              >>>
              >>>class
              >>>can
              >>>
              >>>>be found. I've changed the "/PO.jar#Purchaseorder" value of <ejb-link>
              >>>
              >>>tag
              >>>accordingly
              >>>
              >>>>to try various things. (e.g ejb/Purchaseorder, mypackage2.Purchaseorder,
              >>>
              >>>and a
              >>>
              >>>>lot of other things) but of no avail. I keep getting the same error
              >>>
              >>>over
              >>>and over
              >>>
              >>>>again. (Do you think banging my head on the wall would do the trick?)
              >>>>
              >>>>Any help would be greatly appreciated. Thanks.
              >>>>
              >>>
              >>>
              >>
              >
              >
              

  • Using EJBs in Web Dynpro

    I have recently started to develop Web applications using the Web Dynpro framework. Coming from a pure J2EE world, I must admit that Web Dynpro has a few innovative features that I find interesting for user interface development. The use of component & view contexts, for example, is not unlike the ActionForms that one may find in a Struts application, but pushed a bit further. No complaints here.
    What I do have some problems with is the whole CommandBean paradigm that is put forth by SAP (refer to the document <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/using%20ejbs%20in%20web%20dynpro%20applications.pdf">Using EJBs in Web Dynpro</a>).
    I do understand the usefulness of defining a model that will be used to generate and eventually bind to Context data structures. That's fine. What I do object to is the use of a so-called CommandBean to play that role. Again, coming from a J2EE world, I am familiar with the BusinessDelegate pattern - which would typically be used by a client application to invoke business logic on the server side. I would propose that a better, cleaner way of integrating EJBs with the Web Dynpro framework would be to use a BusinessDelegate for invoking business logic, and importing a separate and distinct ModelBean (instead of a CommandBean) to be used for defining and binding to Context data.
    I have built one Web Dynpro application thus far. Instead of using a CommandBean, I created a ModelBean that extends my business object DTO (Data Transfer Object) (which is quite appropriate for that role, given that it implements all the get & set methods that are required for the business data that I need to model). My Web Dynpro application also makes use of an independant BusinessDelegate that is packaged with my EJB DC - this is a standard best practice on J2EE projects. I have been asked by the people working with me to modify this architecture to bring it more in line with the SAP way of doing things. I am open-minded and willing to learn and accept new ways of thinking and doing things. However, I fail to understand the usefulness of merging structure and behaviour by resorting to CommandBeans:
    - <b>It violates the MVC paradigm</b> by having one object (the CommandBean) serve as both model AND controller as far as the Web Dynpro application is concerned. The CommandBean is obviously a model - since it is literally imported as such into the Web Dynpro application. It is ALSO a controller from the Web Dynpro's application perspective, since all calls to the back-end go thru the CommandBean via one or more of its execute_xxx methods. In contrast, the use of a business delegate by the Web Dynpro application clearly separates the model (the CommandBean... or rather, a more suitably named ModelBean) from the controller (BusinessDelegate).
    - <b>Doesn't carry its own weight.</b> In other words, I haven't yet been provided with any valid justification for going thru the extra effort of coding the CommandBean's execute methods. It's been proposed to me that it somehow serves as an abstraction layer between the Web Dynpro application and the business logic. I would argue that it is the BusinessDelegate's role to abstract away the back-end logic from clients. If one does have a BusinessDelegate available, I would argue there's no need to code execute methods in a separate CommandBean. To prove my point, I would simply point out that all of the CommandBean examples that I have seen so far, either in How-To documents, or in production code, all follow the same pattern....
               CommandBean.execute_doSomething() calls BusinessDelegate.doSomething()
    Not a heck of an "abstraction" layer... I would in fact argue that it is worse than useless. If some major change occurs in the business logic that requires changing the doSomething() operation, we expect of course to modify the BusinessDelegate. The Web Dynpro client will also presumably need to be modified - that's to be expected, and unavoidable. But then, we'll also need to go about and change the CommandBean's execute_doSomething() method - again, extra work for no apparent benefit. Adding and removing business methods has the same implication. All this for an layer that simply adds the prefix execute_ in front of all business method calls... Is this "abstraction layer" worth the cost of creating and maintaining it ??
    - <b>Unnecessarily complicates error handling</b>. I have been told that for technical reasons, it is recommended that all exceptions thrown by the CommandBean be of type WDException or WDRuntimException. But what if the client application needs to react differently to different failure scenarios ? When I create a business object, I might wish to provide the user with an error messages if connection is lost to the backend, and with a different error message if an object already exists in the database with the same attributes. In order to do that, I will have to catch the WDException, extract the cause, and continue processing from there... possible, yes, but clearly less standard and more labor intensive than the classical try/catch mechanism.
    To say nothing about the fact that SAP's own API documentation clearly states that applications using Web Dynpro can reference and catch WDExceptions, but THEY MUST NOT THROW OR EXTEND IT !
    - <b>Produces unnecessary DCs</b>. Page 6 of the aforementioned document presents an architectural view of a Web Dynpro project that uses a CommandBean. Why an extra DC for the CommandBean ?? I created my ModelBean class right inside the Web Dynpro project (in the Package view). That, to me, is where this class should reside, because it is created for no other reason that to be used by this particular Web Dynpro application. What is the benefit of placing it in its own independant DC ?
    - <b>Not a typical application of the Command pattern</b>. The well-documented command pattern (Design Patterns - Gang of Four) has been devised mainly to enable encapsulation of request as objects, thereby making it possible to:
    - specify, queue and execute requests at different times
    - decouple execution of a command from its invoker
    - support undo operations
    - support logging changes so that they can be reapplied in case of system crash making it possible to assemble commands into composite commands (macros), thereby structuring a system around high-level operations built on primitive operations.
    None of this applies to the way the SAP CommandBeans are being used. Not that much of an issue to people new to J2EE and/or OO development... but quite confusing for those already familiar with the classic Command pattern.
    At this point, I fail to understand the advantage of merging structure (model) and behaviour (execute methods) through the use of a unique CommandBean object. Am I missing something ?

    Thanks for your reply and your suggestion. I have posted in the Web Dynpro Java forum... and suggest those wishing to participate in this thread to refer to the Web Dynpro Java forum.
    As for your answer, I'm afraid it doesn't satisfy me.
    Reuse is hardly an issue, since the CommandBean is specifically tailor-made for the Web Dynpro application that needs to use it. I could hardly imagine building another application that would just happen to have the exact same needs as far as data structure and processing is concerned...
    As for the right Eclipse environment... the CommandBean is not an EJB artifact - it is an EJB client. The aforementioned tutorial in fact suggests creating it in the Java perspective.
    But thanks anyway for your time and suggestion

  • Using EJBs in Web Dynpro Applications

    I have recently started to develop Web applications using the Web Dynpro framework. Coming from a pure J2EE world, I must admit that Web Dynpro has a few innovative features that I find interesting for user interface development. The use of component & view contexts, for example, is not unlike the ActionForms that one may find in a Struts application, but pushed a bit further. No complaints here.
    What I do have some problems with is the whole CommandBean paradigm that is put forth by SAP (refer to the document <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/using%20ejbs%20in%20web%20dynpro%20applications.pdf">Using EJBs in Web Dynpro Applications</a>).
    I do understand the usefulness of defining a model that will be used to generate and eventually bind to Context data structures. That's fine. What I do object to is the use of a so-called CommandBean to play that role. Again, coming from a J2EE world, I am familiar with the BusinessDelegate pattern - which would typically be used by a client application to invoke business logic on the server side. I would propose that a better, cleaner way of integrating EJBs with the Web Dynpro framework would be to use a BusinessDelegate for invoking business logic, and importing a separate and distinct ModelBean (instead of a CommandBean) to be used for defining and binding to Context data.
    I have built one Web Dynpro application thus far. Instead of using a CommandBean, I created a ModelBean that extends my business object DTO (Data Transfer Object) (which is quite appropriate for that role, given that it implements all the get & set methods that are required for the business data that I need to model). My Web Dynpro application also makes use of an independant BusinessDelegate that is packaged with my EJB DC - this is a standard best practice on J2EE projects. I have been asked by the people working with me to modify this architecture to bring it more in line with the SAP way of doing things. I am open-minded and willing to learn and accept new ways of thinking and doing things. However, I fail to understand the usefulness of merging structure and behaviour by resorting to CommandBeans:
    - <b>It violates the MVC paradigm</b> by having one object (the CommandBean) serve as both model AND controller as far as the Web Dynpro application is concerned. The CommandBean is obviously a model - since it is literally imported as such into the Web Dynpro application. It is ALSO a controller from the Web Dynpro's application perspective, since all calls to the back-end go thru the CommandBean via one or more of its execute_xxx methods. In contrast, the use of a business delegate by the Web Dynpro application clearly separates the model (the CommandBean... or rather, a more suitably named ModelBean) from the controller (BusinessDelegate).
    - <b>Doesn't carry its own weight</b>. In other words, I haven't yet been provided with any valid justification for going thru the extra effort of coding the CommandBean's execute methods. It's been proposed to me that it somehow serves as an abstraction layer between the Web Dynpro application and the business logic. I would argue that it is the BusinessDelegate's role to abstract away the back-end logic from clients. If one does have a BusinessDelegate available, I would argue there's no need to code execute methods in a separate CommandBean. To prove my point, I would simply point out that all of the CommandBean examples that I have seen so far, either in How-To documents, or in production code, all follow the same pattern....
    CommandBean.execute_doSomething() calls BusinessDelegate.doSomething()
    Not a heck of an "abstraction" layer... I would in fact argue that it is worse than useless. If some major change occurs in the business logic that requires changing the doSomething() operation, we expect of course to modify the BusinessDelegate. The Web Dynpro client will also presumably need to be modified - that's to be expected, and unavoidable. But then, we'll also need to go about and change the CommandBean's execute_doSomething() method - again, extra work for no apparent benefit. Adding and removing business methods has the same implication. All this for an layer that simply adds the prefix execute_ in front of all business method calls... Is this "abstraction layer" worth the cost of creating and maintaining it ??
    - <b>Unnecessarily complicates error handling</b>. I have been told that for technical reasons, it is recommended that all exceptions thrown by the CommandBean be of type WDException or WDRuntimException. But what if the client application needs to react differently to different failure scenarios ? When I create a business object, I might wish to provide the user with an error messages if connection is lost to the backend, and with a different error message if an object already exists in the database with the same attributes. In order to do that, I will have to catch the WDException, extract the cause, and continue processing from there... possible, yes, but clearly less standard and more labor intensive than the classical try/catch mechanism.
    To say nothing about the fact that SAP's own API documentation clearly states that applications using Web Dynpro can reference and catch WDExceptions, but THEY MUST NOT THROW OR EXTEND IT !
    - <b>Produces unnecessary DCs</b>. Page 6 of the aforementioned document presents an architectural view of a Web Dynpro project that uses a CommandBean. Why an extra DC for the CommandBean ?? I created my ModelBean class right inside the Web Dynpro project (in the Package view). That, to me, is where this class should reside, because it is created for no other reason that to be used by this particular Web Dynpro application. What is the benefit of placing it in its own independant DC ?
    - <b>Not a typical application of the Command pattern</b>. The well-documented command pattern (Design Patterns - Gang of Four) has been devised mainly to enable encapsulation of request as objects, thereby making it possible to:
    - specify, queue and execute requests at different times
    - decouple execution of a command from its invoker
    - support undo operations
    - support logging changes so that they can be reapplied in case of system crash making it possible to assemble commands into composite commands (macros), thereby structuring a system around high-level operations built on primitive operations.
    None of this applies to the way the SAP CommandBeans are being used. Not that much of an issue to people new to J2EE and/or OO development... but quite confusing for those already familiar with the classic Command pattern.
    At this point, I fail to understand the advantage of merging structure (model) and behaviour (execute methods) through the use of a unique CommandBean object. Am I missing something ?

    Hi Romeo,
    You would be disappointed, this reply ain't anywhere nearby to what you are talking about...
    I wanted to mail you, but you have not mentioned your email in your profile.
    I am really impressed by your flair for writing. It would be far better had you written a blog on this topic. Believe me, it would really be better. There is a much wider audience waiting out there to read your views rather than on the forums. This is what I believe. To top it, you would be rewarded for writing something like this from SDN. On the blogs too, people can comment and all, difference being there you would be rewarded by SDN, here people who reply to you would be rewarded by you. Doesn't make  much a difference.
    Anyways the ball is still in your court
    As far as I am concerned, it has still not been much time since I have started working on Web Dynpro. So can't really comment on the issue...
    Bye
    Ankur

  • How can one invoke a WebLogic EJB from a BPEL Server hosted on OC4J?

    How can one invoke a WebLogic EJB from a BPEL Server hosted on OC4J?
    Reason I ask is I keep getting this error:
    javax.naming.NoInitialContextException: Cannot instantiate cla
    ss: weblogic.jndi.WLInitialContextFactory [Root exception is java.lang.ClassNotF
    oundException: weblogic.jndi.WLInitialContextFactory]
    Note: I am using <bpelx:exec> as a way to execute some java program.
    Essentially my java client (essentially an EJB client hosted on Oc4J) needs access to wlclient.jar since it needs access to weblogic.jndi.WLInitialContextFactory. I have a EJB client running on BPEL server hosted on Oc4J that needs to access some EJBs hosted on weblogic.
    Where do I place this wlclient.jar so that BPEL PM can start peacefully and at runtime discover the InitialContextFactory classes?
    Placing it in the j2ee/home/applib doesn't solve the problem. The server fails to start up if I do this
    I tried placing it in BPEL-INF\lib directory ...
    I still get the same exception...see below for exception dump
    I verified the BPEL suitcase, and it in fact does contain the jar file wlclient.jar
    integration\orabpel\domains\default\deploy contains the bpel_BPELProcess2_1.0.jar file and snapshot of that is as follows:
    <PRE>
    &#9474; bpel.xml
    &#9474; BPELProcess2.bpel
    &#9474; BPELProcess2.jpr
    &#9474; BPELProcess2.wsdl
    &#9474; bpel_BPELProcess2_1.0.jar
    &#9474; build.xml
    &#9474; buildxml.copy
    &#9474; graphics.xml
    &#9474;
    &#9500;&#9472;&#9472;&#9472;BPEL-INF
    &#9474; &#9492;&#9472;&#9472;&#9472;lib
    &#9474; myEJB.jar
    &#9474; wlclient.jar
    &#9474;
    &#9500;&#9472;&#9472;&#9472;META-INF
    &#9474; MANIFEST.MF
    &#9474;
    &#9492;&#9472;&#9472;&#9472;output
    bpel_BPELProcess2_1.0.jar
    </PRE>
    I tried using the BPEL-INF\jar directory...Is this something the obant automatically detects? or do I have to modify the build.xml? I created this directory and let Jdev deploy to local BPEL server->default domain handle it
    #####################3
    I even tried copying the wlclient.jar to
    integration\orabpel\system\classes but this doesn't help since the BPEL PM fails to start if I explode this jar into this directory.
    In short,where do I place the wlclient.jar so that this exception can be contained.
    I edited the build.xml to point to the jar, that too didn't work, unless I made some mistake in the file
    <bpelc classpath="${basedir}/BPEL-INF/classes;${home}/system/classes;${home}/lib/j2ee_1.3.01.jar;${basedir}/BPEL-INF/jar/wlclient.jar" input="${basedir}/bpel.xml" rev="${rev}" deploy="${deploy}" />
    </target>
    </project>
    DETAILS on ERROR
    I get the following error
    Process "BPELProcess2" (revision "1.0") successfully compiled.
    <2005-12-14 09:17:55,770> <INFO> <default.collaxa.cube.engine.deployment> Proces
    s "BPELProcess2" (revision "1.0") successfully loaded.
    05/12/14 09:18:36 weblogic.jndi.WLInitialContextFactory
    javax.naming.NoInitialContextException: Cannot instantiate cla
    ss: weblogic.jndi.WLInitialContextFactory [Root exception is java.lang.ClassNotF
    oundException: weblogic.jndi.WLInitialContextFactory]
    05/12/14 09:18:36 at javax.naming.spi.NamingManager.getInitialContext(Nami
    ngManager.java:652)
    05/12/14 09:18:36 at javax.naming.InitialContext.getDefaultInitCtx(Initial
    Context.java:243)
    05/12/14 09:18:36 at javax.naming.InitialContext.init(InitialContext.java:
    219)
    05/12/14 09:18:36 at javax.naming.InitialContext.<init>(InitialContext.jav
    a:195)
    05/12/14 09:18:36 at com.ejb.test.MapFinder.getDefaultMapName(Map
    Finder.java:37)
    ##################3
    with the bpelx all I have is two lines of code that creates a java object and calls a method on it.
    The method does this:
        private String initialContextFactory = "weblogic.jndi.WLInitialContextFactory";
        private String providerUrl = "t3://localhost:7001";
        private String urlPkgPrefixes = "";
        private String mapEjbJndiName = "ejb/mycompany/Redlands";
        public String getDefaultMapName() {
          try {
              Hashtable env = new Hashtable();
              env.put(Context.INITIAL_CONTEXT_FACTORY, getInitialContextFactory());
              env.put(Context.PROVIDER_URL, getProviderUrl());
              if (getUrlPkgPrefixes() != null && !getUrlPkgPrefixes().equals(""))
                  env.put(Context.URL_PKG_PREFIXES, getUrlPkgPrefixes());
              System.out.println("    " + getInitialContextFactory());
              System.out.println("    " + getProviderUrl());
              System.out.println("    " + getUrlPkgPrefixes());
              System.out.println("    " + getEjbName());
              // Get a naming context
              context = new InitialContext(env);
               Object ms  = context.lookup(getEjbName());
              MyEJBHome home = (MyEJBHome ) PortableRemoteObject.narrow(ms, MyEJBHome.class);
              myEjb = home.create();
              return myEjb.getDefaultName();
          } catch (RemoteException re){
              System.out.println(re.getCause().getMessage());
          catch (Exception ex) {
              ex.printStackTrace();
          return null; //if unable to resolve the context factory etc...
        }

    I did exactly as you suggested. I edited the application.xml and added this
    <library path="C:\ArcGIS\test\bea\wlclient.jar"/>
    I didn't add weblogic because the needed classes were all in wlclient.jar
    I also edited the BASE_OB_CLASSPATH to include this jar.
    Here is the result when I just start BPEL PM Server. Somehow BPEL PM doesn't like to have wlclient.jar in its classpath during startup.
    Failed to create "worker" bean; exception reported is: "javax.naming.NameNotFoun
    dException: remaining name: env
    at weblogic.j2eeclient.SimpleContext.lookup(SimpleContext.java:49)
    at weblogic.j2eeclient.SimpleContext.lookup(SimpleContext.java:57)
    at weblogic.j2eeclient.SimpleContext.lookup(SimpleContext.java:62)
    at javax.naming.InitialContext.lookup(InitialContext.java:347)
    at com.collaxa.cube.engine.ejb.impl.WorkerBean.ejbCreate(WorkerBean.java
    :49)
    at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
    sorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at com.evermind.server.ejb.MessageDrivenHome.getInstance(MessageDrivenHo
    me.java:1235)
    at com.evermind.server.ejb.MessageDrivenHome$2.run(MessageDrivenHome.jav
    a:1150)
    at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(Relea
    sableResourcePooledExecutor.java:186)
    at java.lang.Thread.run(Thread.java:534)
    <2005-12-29 13:39:05,281> <ERROR> <collaxa> <ServerManager::loadAllDomains>
    ORABPEL START-UP ERROR!!!!!!!!
    OraBPEL run-time system failed to start due to exception:
    Could not initialize jms connection pool.
    Could not initialize connection pool for connection factory "java:comp/env/jms/
    ollaxa/BPELInvokerQueueFactory"; the reason is remaining name: env/jms/collaxa/
    PELInvokerQueueFactory.
    Note: So what I did was to removed the entry from application.xml and tried with just obsetenv.bat having the wlclient.jar added to it. This too failed!!
    Here is a snapshot of the error I got.
    Process "BPELProcess2" (revision "1.0") successfully compiled.
    <2005-12-29 13:53:11,207> <INFO> <default.collaxa.cube.engine.deployment> Proces
    s "BPELProcess2" (revision "1.0") successfully loaded.
    05/12/29 13:53:32 Cannot instantiate class: weblogic.jndi.WLInitialContextFactor
    y
    05/12/29 13:53:32 javax.naming.NoInitialContextException: Cannot instantiate cla
    ss: weblogic.jndi.WLInitialContextFactory [Root exception is java.lang.ClassNotF
    oundException: weblogic.jndi.WLInitialContextFactory]
    05/12/29 13:53:32 at javax.naming.spi.NamingManager.getInitialContext(Nami
    ngManager.java:652)
    05/12/29 13:53:32 at javax.naming.InitialContext.getDefaultInitCtx(Initial
    Context.java:243)
    05/12/29 13:53:32 at javax.naming.InitialContext.init(InitialContext.java:
    219)
    05/12/29 13:53:32 at javax.naming.InitialContext.<init>(InitialContext.jav
    a:195)
    05/12/29 13:53:32 at com.esri.adf.ejb.test.MapFinder.getDefaultMapName(Map
    Finder.java:57)
    05/12/29 13:53:32 at bpel.p0.ExecLetBxExe1.execute(ExecLetBxExe1.java:62)
    05/12/29 13:53:32 at com.collaxa.cube.engine.ext.wmp.BPELXExecWMP.__execut
    eStatements(BPELXExecWMP.java:49)
    05/12/29 13:53:32 at com.collaxa.cube.engine.ext.wmp.BPELActivityWMP.perfo
    rm(BPELActivityWMP.java:185)
    05/12/29 13:53:32 at com.collaxa.cube.engine.CubeEngine.performActivity(Cu
    beEngine.java:3398)
    05/12/29 13:53:32 at com.collaxa.cube.engine.CubeEngine.handleWorkItem(Cub
    eEngine.java:1905)
    05/12/29 13:53:32 at com.collaxa.cube.engine.dispatch.message.instance.Per
    formMessageHandler.handleLocal(PerformMessageHandler.java:75)
    05/12/29 13:53:32 at com.collaxa.cube.engine.dispatch.DispatchHelper.handl
    eLocalMessage(DispatchHelper.java:100)
    05/12/29 13:53:32 at com.collaxa.cube.engine.dispatch.DispatchHelper.sendM

  • Distributed Elevator system using EJB 3

    I'm developing a distributed elevator system using EJB 3 and JSP. Can anybody help me in deciding the overall architecture of the system?
    The system consists of an individual controller for each elevator and there is a central remote controller which controls the whole system as well.
    I'm in a dilemma how to start making a 4 tier architecture.......
    Can anybody guide me?

    Digging more into the problem it seem when there are “JMX invoke” calls in the call stack the NameNotFoundException occurs for EnitityManager lookups.
    Caused by: javax.naming.NameNotFoundException: java:comp/env/ribPersistenceUnit/EntityManager not found in Rib Admin GUI
         at com.oracle.naming.J2EEContext.getSubContext(J2EEContext.java:225)
         at com.oracle.naming.J2EEContext.lookup(J2EEContext.java:172)
         at com.evermind.server.ApplicationContext.lookupInJavaContext(ApplicationContext.java:308)
         at com.evermind.server.ApplicationContext.unprivileged_lookup(ApplicationContext.java:232)
         at com.evermind.server.ApplicationContext.lookup(ApplicationContext.java:197)
         at javax.naming.InitialContext.lookup(InitialContext.java:351)
         at com.retek.rib.domain.hospital.dao.toplink.ToplinkSessionDispenser$CMTToplinkSessionEntityManager.lookupEntityManager(ToplinkSessionDispenser.java:148)
    In our case
    Servler/JSP -> JMX MBeans -> TimerThread -> SLSB Ejb -> Calls Context.lookup("java:comp/env/ribPersistenceUnit/EntityManager").
    I get the exception as shown above.
    If I make the Servlet/JSP call the TimerThread directly bypassing the JMX call it works fine.
    Our application is fully manageble by JMX so I cannot remove the JMX layer. What can I do to fix the issue?
    Prantor

  • A Tip for using EJB 3.0 with WebLogic Ant Tasks

    I started out writing this up as a problem, but then I found the answer so I'm, posting a tip instead.
    When I tried to write an EJB [stateless] using EJB 3.0 in my legacy Weblogic ear project I started getting this error:
    <pre>
    No EJBs found in the ejb-jar file 'test'. Please ensure the ejb-jar contains EJB declarations via an ejb-jar.xml deployment descriptor or at least one class annotated with the @Stateless, @Stateful or @MessageDriven EJB annotation.
    </pre>
    This is why: wlcompile will put the class files in the App-Inf/classes directory unless it finds an ejb-jar.xml file in the META-INF directory for the module it is working on. With EJB 3.0, I wasn't using an ejb-jar.xml file because it was unnecessary. Later, Appc runs and it complains <b>because there are no classes module directory, they went into the shared ear folder instead.</b>
    Here's I how it working again: Use javac [not wlcompile] to compile the EJB 3.0 module and make sure that the class files go into the correct module directory. Then you can use wlappc to generate all the associated files for the EJB. I have sucessfully deployed an ear file that uses both EJB 2.x and EJB 3.0 with this approach.
    I wish Weblogic's own ejb3.0 sample application used their split directory deployment.
    Good Luck.
    John Aronson

    Hi John,
    I am working on development an enterprise application using EJB 3.0 on Weblogic 10.
    While developing, I am keeping all my classes (from ejb's as well as web) into APP-INF/classes directory. It is working fine for Web and ejb 2.0 packages, but ejb 3.0 packages, I get the following error when I keep my ejb 3.0 beans classes in APP-INF/classes directory.
    No EJBs found in the ejb-jar file 'customer'. Please ensure the ejb-jar contains EJB declarations via an ejb-jar.xml deployment descriptor or at least one class annotated with the @Stateless, @Stateful or @MessageDriven EJB annotation.
    One solution is to keep the classes under customer ejb directory, but I wan tto keep all the classes in APP-INF/classes directory so that when using Eclipse IDE I can output all compiled sources into APP-INF/classes directory.
    Has anyone faced this situation? Any suggestions to fix this issue?

  • Problem calling a session bean (EJB 3.0)

    Hello,
    I'm new to netbeans and J2EE. I'm using NetBeans 5.5 Beta 2 and sun application server 9 pe.
    I created a new enterprise application and i'm trying to access a Session Bean (Remote and Stateless)
    from the app-client (outside the main class).
    This is the loockup method that was generated by the IDE (Enterprise Resources > Call enterprise bean):
    private ejb.SessionBeanDoenteRemote lookupSessionBeanDoenteBean() {
    try {
    javax.naming.Context c = new javax.naming.InitialContext();
    return (ejb.SessionBeanDoenteRemote) c.lookup("java:comp/env/ejb/SessionBeanDoenteBean");
    catch(javax.naming.NamingException ne) {
    java.util.logging.Logger.getLogger(getClass().getName()).log(java.util.logging.Level.SEVERE,"exception caught" ,ne);
    throw new RuntimeException(ne);
    When I run the application and try to invoke the lookup method my application gets the following exception:
    SEVERE: exception caught
    javax.naming.NameNotFoundException: No object bound to name java:comp/env/ejb/Se
    ssionBeanDoenteBean
    at com.sun.enterprise.naming.NamingManagerImpl.lookup(NamingManagerImpl.
    java:751)
    at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.j
    ava:156)
    at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:307
    at javax.naming.InitialContext.lookup(InitialContext.java:351)
    at intensivecare.entrada.JDialogEntrada.lookupSessionBeanDoenteBean(JDia
    logEntrada.java:219)
    at intensivecare.entrada.JDialogEntrada.buttonMenuGravarActionPerformed(
    JDialogEntrada.java:79)
    at intensivecare.JDialogWizzard$2.jButtonGravarActionPerformed(JDialogWi
    zzard.java:178)
    at componentes.JTaskPanelMenu$3.actionPerformed(JTaskPanelMenu.java:54)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:18
    49)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.jav
    a:2169)
    Please... can someone help me?

    The portable way to acquire the dependency is through java:comp/env or @EJB. Accessing the
    global namespace directly is not recommended. If you use an ejb-ref, you need to define it
    in the component environment within which you'll be looking up the dependency. So if you're
    looking it up from an Application Client, you'll need to define the ejb-ref in application-client.xml.
    Also, the ejb-ref-name is the portion of the string after java:comp/env. There is no automatic
    "ejb" appended to it. If you do ic.lookup("java:comp/env/foo"), your ejb-ref-name would be "foo".
    You can use @EJB but it can only be defined in certain managed classes such as the
    Application Client main class.
    You can find additional info in our EJB FAQ :
    https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Error while invoking Livecycle process with Java

    Hi,
    I am trying to invoke a short lived process using java code. But when i try doing that i get the following error
    cannot access class com.adobe.idp.dsc.clientsdk.ServiceClient; class file has wrong version 49.0, should be 45.3 or 46.0 or 47.0 or 48.0.
    I am using the following versions:
    Adobe Livecycle: 9.0
    java version "1.5.0_03"
    JDeveloper: 9.0.5.2
    Can some one please suggest the appropriate action i need to take so that i can compile the code.
    Thanks in advance

    If you are invoking LiveCycle ES2 on JBoss compile with JDK 1.6 and run against JRE 6.
    Steve

  • How can I use EJB component on Weblogic 8.1 server ?

    hi,dear sir:
    How can I use EJB component on Weblogic 8.1 server ?
    It need client jar to invoke ejb,but what will I to do for this jar file? what does it contain? format ?
    If my EJB module contain 100 session bean and 50 Entity bean,but I want invoke 20 session beans in my module, how can I to do?
    thank you...

    Hi,
    This forum is exclusively for Creator. please post this on appropriate forum
    regards
    CreatorTeam

  • I need a clarification : Can I use EJBs instead of helper classes for better performance and less network traffic?

    My application was designed based on MVC Architecture. But I made some changes to HMV base on my requirements. Servlet invoke helper classes, helper class uses EJBs to communicate with the database. Jsps also uses EJBs to backtrack the results.
    I have two EJBs(Stateless), one Servlet, nearly 70 helperclasses, and nearly 800 jsps. Servlet acts as Controler and all database transactions done through EJBs only. Helper classes are having business logic. Based on the request relevant helper classed is invoked by the Servlet, and all database transactions are done through EJBs. Session scope is 'Page' only.
    Now I am planning to use EJBs(for business logic) instead on Helper Classes. But before going to do that I need some clarification regarding Network traffic and for better usage of Container resources.
    Please suggest me which method (is Helper classes or Using EJBs) is perferable
    1) to get better performance and.
    2) for less network traffic
    3) for better container resource utilization
    I thought if I use EJBs, then the network traffic will increase. Because every time it make a remote call to EJBs.
    Please give detailed explanation.
    thank you,
    sudheer

    <i>Please suggest me which method (is Helper classes or Using EJBs) is perferable :
    1) to get better performance</i>
    EJB's have quite a lot of overhead associated with them to support transactions and remoteability. A non-EJB helper class will almost always outperform an EJB. Often considerably. If you plan on making your 70 helper classes EJB's you should expect to see a dramatic decrease in maximum throughput.
    <i>2) for less network traffic</i>
    There should be no difference. Both architectures will probably make the exact same JDBC calls from the RDBMS's perspective. And since the EJB's and JSP's are co-located there won't be any other additional overhead there either. (You are co-locating your JSP's and EJB's, aren't you?)
    <i>3) for better container resource utilization</i>
    Again, the EJB version will consume a lot more container resources.

Maybe you are looking for