Inject EJB using @EJB in Servlet Filter on Weblogic 11g

Hi All,
I want to inject the EJB (Local interface) into the Servlet Filter and the EAR is deployed on Weblogic 11g.
My question is:
Shall the @EJB Annotation work on Weblogic 11g or it will be ignored in case of Servlet or Servlet Filter?
OR
I have to do look up as below and mention the references in web.xml and weblogic xml file:
I know below code should be used when you have remote interface.
Hashtable env = new Hashtable();
env.put( Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory" );
Context ctx = new InitialContext( env );
ctx.lookup( "myejb" );
Thanks

Hi,
It should work in 11g.
Regards,
Kal

Similar Messages

  • Error during deployment of stateless session EJB using EJB 3.0

    having trouble deploying a stateless session bean to app server 10.1.3.1 oc4j container.
    deceided to go through oracles demo: How-To Develop a Stateless Session EJB using EJB 3.0 (http://www.oracle.com/technology/tech/java/oc4j/1013/how_to/how-to-ejb30-stateless-ejb/doc/how-to-ejb30-stateless-ejb.html).
    the demo encounters the same issue. so i assume there is something wrong with the app server set up, and not my source code.
    here is the deployment log:
    [Jul 1, 2009 11:59:25 AM] Application Deployer for test_ws STARTS.
    [Jul 1, 2009 11:59:25 AM] Copy the archive to C:\product\10.1.3.1\OracleAS_1\j2ee\home\applications\test_ws.ear
    [Jul 1, 2009 11:59:25 AM] Initialize C:\product\10.1.3.1\OracleAS_1\j2ee\home\applications\test_ws.ear begins...
    [Jul 1, 2009 11:59:25 AM] Unpacking test_ws.ear
    [Jul 1, 2009 11:59:25 AM] Done unpacking test_ws.ear
    [Jul 1, 2009 11:59:25 AM] Initialize C:\product\10.1.3.1\OracleAS_1\j2ee\home\applications\test_ws.ear ends...
    [Jul 1, 2009 11:59:25 AM] Starting application : test_ws
    [Jul 1, 2009 11:59:25 AM] Initializing ClassLoader(s)
    [Jul 1, 2009 11:59:25 AM] Initializing EJB container
    [Jul 1, 2009 11:59:25 AM] Loading connector(s)
    [Jul 1, 2009 11:59:26 AM] Starting up resource adapters
    [Jul 1, 2009 11:59:26 AM] Processing EJB module: ejb30ws-ejb.jar
    [Jul 1, 2009 11:59:26 AM] application : test_ws is in failed state
    [Jul 1, 2009 11:59:26 AM] Operation failed with error: java.lang.NoClassDefFoundError
    the opmn log reveals the same error, but no more detail.
    any ideas???
    /stuck

    I am having exactly the same issue. Was this issue resolved? If so, please share the resolution and if not can someone please suggest what could be wrong.
    Thanks

  • GZip Compression filter for Weblogic 11g.

    Hi,
    I are using WLS 11g for our application development. I have identified and used PlanetJ gzip compression filter and its working fine in our dev environment. I am looking for alternate commercial supported gzip filter for wls.
    Can anybody suggest a commercial gzip filter? Or PlanetJ gzip filter is a good one?. We excepect the application to scale up to 150 users and the filter selected should not be an issue for this. Also is there any official oracle/wls supported gzip filters available?
    Any help on this is highly appreciated.
    regards
    jossy.

    Thank you for the answer. But currently we are looking to including filter at WLS as the suggestion by you will involve lot of architectural changes. Could you please answer if any weblogic/oracle supported filter is avaialble for enabling compression at WLS.
    thanks and regards
    jossy.

  • How tom invoke an EJB from another EJB using the sun rmi protocl in Weblogi

    Hi,
    I am particularly new to EJB.
    My scenario is
    client invoking-->EJB-----invoking ----(Either a webService or an EJB)
    in WEBLOGIC
    Is it possible that a call from EJB to another EJB or WebService use Sun's RMI as underlying protocol instead of t3 or IIOP which are used in Weblogic ?
    Would be really a great help if you could provide me some sample on it on weblogic.

    Hi Stefan,
    You don't need to provide the InitialContextFactory for running a standalone client. The following should work just fine:
    Context initial = new InitialContext();
    System.out.println("Looking up ...");
    Object objref = initial.lookup(EJB);  //the lookup name should be a global JNDI name      //and not from the java:comp namespace
    System.out.println("Looked up EJB");The JNDI implementation looks for the jndi.properties file in your classpath. So make sure that you have the appserv-rt.jar from your <server_installation>/lib directory in your classpath.
    HTH,
    Sheetal

  • Thred Safety when Injecting an EJB into servlet using @EJB

    Hi , i have read that
    when EJBs were injected into servlets using @EJB it is said that there will be no Thread Safety here ??
    Is this true.

    Hi,
    You can directly call the methods in the bean without using bean model
    see this thread
    Webdynpro and Oracle
    Regards
    Rohit

  • When to use @Resource and when to use @EJB for dependency injection

    Hi,
    When do you use
    @Resource and when do you use @EJB for dependency injection?
    Thanks

    Captain obvious: Use @EJB for injection of EJBs, and @Resource for everything else.
    There was a discussion about this very topic quite recently, perhaps you can find it through the search.

  • When to Use Servlet only, EJB only and, both Servlet And EJB???

    I have a question, If I want to build a Web application. Sometime i found that there is no need to use EJB as Servlet already provide that functionality.
    Can anyone tell me when do I use Pure Servlet? When do I use Pure EJB and, When do I use Both EJB and Servlet???
    I am very interesting in it.
    Thanks.
    Jack

    EJB and servlets are two different things. Trying to compare them doesn't really make sense. A web application is always going to need some way to process Http requests and this in Java is done accomplished through Servlets (or jsp pages which in turn also use servlets).
    EJBs are the basis of distributed cross-platform objects. They are handled through name services and stored in databases. An Entity Bean can be "brought back to life" as long as it's info is stored in a database. Regardless of a server being restarted. All this database support behind an Entity Bean (transactions, queries etc.) are very transparent to the programmer. They are provided by the EJB vendor.
    The class properties of a Servlet (or class-level member variables) are shared among all requests (running thread instances of the service method). That's why they should be used with a lot of caution. This feature can be very useful but if used improperly can also be very vulnerable to security and synchronization issues.
    I'm not an EJB expert but this explanation should give you some idea of what EJBs are all about.

  • Using ejb service from a servlet in Weblogic 6.0sp1

              anybody had sucess using ejb service from a servlet in Weblogic
              6.0sp1 ?
              It worked in Weblogic 6.0. But in 6.0sp1, the servlet startup always
              return me "ClassCastException"
              when narrowing a lookup of an ejbHome to the specific class.
              Using this same ejb service from a standalone Java client wotked
              fine in both versions.
              Any body has aby clue ?
              Help greatly appreciated
              hyliu
              

    The ejbc'ed jar needs to be in the CLASSPATH of the servlet server.
              Gene
              "Haiyang Liu" <[email protected]> wrote in message news:3ab2670c$[email protected]..
              >
              > anybody had sucess using ejb service from a servlet in Weblogic
              > 6.0sp1 ?
              >
              > It worked in Weblogic 6.0. But in 6.0sp1, the servlet startup always
              > return me "ClassCastException"
              > when narrowing a lookup of an ejbHome to the specific class.
              > Using this same ejb service from a standalone Java client wotked
              > fine in both versions.
              >
              > Any body has aby clue ?
              >
              > Help greatly appreciated
              >
              > hyliu
              >
              

  • How to use EJB's from Servlets in 6.0

    Hi,
              I'm trying to get a reference to an ejb home in my servlet code.
              The jar file is located in the /applications directory and is deployed
              properly when weblogic startsup.
              But I can't seem to get the servlet to work.
              I get a 'java.lang.NoClassDefFoundError' that complains that the home
              objects class can not be found.
              Thanks in advance
              Cagan
              

    This is a "feature" of WL that I think is a shortcoming: the inability to marshal/unmarshal ejbc
              generated stub-implementations across 2 WL servers.
              Why don't you jar up ALL you ejbs in one jar; this way you only have to worry about 1 ejb stub jar
              in your CLASSPATH.
              Gene
              "Cagan Senturk" <[email protected]> wrote in message news:[email protected]...
              > Thanks Dana. I got it to work without having to place the home and remote
              > classes in the WEB-INF/classes or anywhere else.
              > I simply placed the ejb jar in the applications directory and added the jar
              > to the classpath in the script that starts the server.
              > Of course having to update the classpath everytime there is a new ejb jar is
              > a pain.
              >
              > "Dana Jeffries" <[email protected]> wrote in message
              > news:[email protected]...
              > > Check out the ejb/basic/beanManaged example which has a servlet
              > (originally named Servlet.java ;-)
              > > that's an example of an servlet calling and EJB.
              > >
              > > (There's also a JSP example under the JSP examples).
              > >
              > > The ejb's home and remote classes need to either be in the WAR, in the
              > WEB-INF/classes directory of
              > > the default web app, or the servlet packaged in a WAR, and the WAR and
              > ejb-jar packaged in the same
              > > EAR.
              > >
              > > Just having the remote and home classes in the ejb-jar file isn't enough.
              > They also need to be
              > > available to the client which in this case is a servlet.
              > >
              > > Cagan Senturk wrote:
              > >
              > > > Hi,
              > > > I'm trying to get a reference to an ejb home in my servlet code.
              > > > The jar file is located in the /applications directory and is deployed
              > > > properly when weblogic startsup.
              > > > But I can't seem to get the servlet to work.
              > > > I get a 'java.lang.NoClassDefFoundError' that complains that the home
              > > > objects class can not be found.
              > > > Thanks in advance
              > > > Cagan
              > >
              >
              >
              

  • WebLogic 11g and Spring beens injected into EJB

    All,
    I am getting an error injecting spring managed beans into EJB's within WebLogic 11g. I am using an interceptor extending the SpringBeanAutowiringInterceptor to set the context name by overriding the getBeanFactoryLocatorKey method. This is configured within the ejb-jar.xml file as an interceptor-binding for all ejb's. The beanRefContext.xml is in the root of the ejb jar and on the class path.
    The application deploys however when I can the remote ejb interface the following error occurs. The remote interface and model passed on the method call are deployed within a ejb-client jar file that within both the ejb and web applications class path. The ejb and web app are deployed separately i.e. the web app is deployed as a war out with the ejb ear.
    Does anyone have an idea on what is causing this? I suspect it is something to do with the class loaders / classpath and where the sping managed context is being loaded from. The Spring jars are deployed within the root of the ear and referenced within the Class-Path manifest.
    Regards
    Neil
    javax.ejb.EJBException: A error occurred the server; nested exception is:
         weblogic.utils.AssertionError: ***** ASSERTION FAILED *****[ cannot unmarshaling throwable ]; nested exception is: java.rmi.ServerError: A error occurred the server; nested exception is:
         weblogic.utils.AssertionError: ***** ASSERTION FAILED *****[ cannot unmarshaling throwable ]
         at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.unwrapRemoteException(RemoteBusinessIntfProxy.java:112)
         at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:91)
         at $Proxy212.validatePostcode(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
         at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:198)
         at $Proxy213.validatePostcode(Unknown Source)
         at sandpit.web.PostcodeValidationController.onSubmit(PostcodeValidationController.java:59)
         at org.springframework.web.servlet.mvc.SimpleFormController.processFormSubmission(SimpleFormController.java:267)
         at org.springframework.web.servlet.mvc.CancellableFormController.processFormSubmission(CancellableFormController.java:140)
         at org.springframework.web.servlet.mvc.AbstractFormController.handleInvalidSubmit(AbstractFormController.java:671)
         at org.springframework.web.servlet.mvc.AbstractFormController.handleRequestInternal(AbstractFormController.java:272)
         at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
         at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
         at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
         at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807)
         at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
         at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:202)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3588)
         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:2200)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2106)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1428)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Caused by: java.rmi.ServerError: A error occurred the server; nested exception is:
         weblogic.utils.AssertionError: ***** ASSERTION FAILED *****[ cannot unmarshaling throwable ]
         at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:220)
         at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:345)
         at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:259)
         at sandpit.ejb.address.AddressEJB_vk8fj2_AddressEJBImpl_1031_WLStub.validatePostcode(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:73)
         ... 36 more
    Caused by: weblogic.utils.AssertionError: ***** ASSERTION FAILED *****[ cannot unmarshaling throwable ]
         at weblogic.rmi.internal.ServerRequest.unmarshalThrowable(ServerRequest.java:357)
         at weblogic.rmi.internal.ServerRequest.getThrowable(ServerRequest.java:62)
         at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:203)
         ... 44 more
    Caused by: java.io.InvalidClassException: org.springframework.beans.BeansException; local class incompatible: stream classdesc serialVersionUID = 5951866628951717299, local class serialVersionUID = -2725566157126749441
         at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:562)
         at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1583)
         at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
         at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1583)
         at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
         at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1583)
         at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
         at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
         at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
         at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
         at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
         at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
         at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
         at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
         at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
         at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
         at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
         at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
         at weblogic.rmi.extensions.server.CBVInputStream.readObject(CBVInputStream.java:64)
         at weblogic.rmi.internal.ServerRequest.unmarshalThrowable(ServerRequest.java:352)
         ... 46 more

    After some tinkering with this I am now getting a different error. I believe the error has changed as I am now deploying Spring 2.5.3 with my EJB. Does anyone have an idea on what is causing this?
    Note I have also deployed the code onto OC4J and it works fine.
    Regards
    Neil
    Error 500--Internal Server Error
    javax.ejb.EJBException: EJB Exception: ; nested exception is:
         org.springframework.jee.interfaces.LifecycleCallbackException: Failure to invoke public void org.springframework.ejb.interceptor.SpringBeanAutowiringInterceptor.autowireBean(javax.interceptor.InvocationContext) on bean class class sandpit.ejb.interceptor.SandpitSpringBeanAutowiringInterceptor_ei72e8_Impl with args: [com.bea.core.repackaged.springframework.jee.intercept.InterceptionMetadata$LifecycleEventCallbackInvocationContext@bc6ac]; nested exception is: org.springframework.jee.interfaces.LifecycleCallbackException: Failure to invoke public void org.springframework.ejb.interceptor.SpringBeanAutowiringInterceptor.autowireBean(javax.interceptor.InvocationContext) on bean class class sandpit.ejb.interceptor.SandpitSpringBeanAutowiringInterceptor_ei72e8_Impl with args: [com.bea.core.repackaged.springframework.jee.intercept.InterceptionMetadata$LifecycleEventCallbackInvocationContext@bc6ac]
         at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.unwrapRemoteException(RemoteBusinessIntfProxy.java:109)
         at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:91)
         at $Proxy156.validatePostcode(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
         at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:198)
         at $Proxy97.validatePostcode(Unknown Source)
         at sandpit.web.PostcodeValidationController.onSubmit(PostcodeValidationController.java:56)
         at org.springframework.web.servlet.mvc.SimpleFormController.processFormSubmission(SimpleFormController.java:267)
         at org.springframework.web.servlet.mvc.CancellableFormController.processFormSubmission(CancellableFormController.java:140)
         at org.springframework.web.servlet.mvc.AbstractFormController.handleInvalidSubmit(AbstractFormController.java:671)
         at org.springframework.web.servlet.mvc.AbstractFormController.handleRequestInternal(AbstractFormController.java:272)
         at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
         at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
         at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
         at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)
         at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:523)
         at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:463)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:202)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3588)
         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:2200)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2106)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1428)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Caused by: org.springframework.jee.interfaces.LifecycleCallbackException: Failure to invoke public void org.springframework.ejb.interceptor.SpringBeanAutowiringInterceptor.autowireBean(javax.interceptor.InvocationContext) on bean class class sandpit.ejb.interceptor.SandpitSpringBeanAutowiringInterceptor_ei72e8_Impl with args: [com.bea.core.repackaged.springframework.jee.intercept.InterceptionMetadata$LifecycleEventCallbackInvocationContext@bc6ac]
         at com.bea.core.repackaged.springframework.jee.inject.Jsr250Metadata.invokeLifecycleMethod(Jsr250Metadata.java:335)
         at com.bea.core.repackaged.springframework.jee.intercept.InterceptionMetadata.invokeLifecycleMethods(InterceptionMetadata.java:580)
         at com.bea.core.repackaged.springframework.jee.intercept.InterceptionMetadata$AdvisorChainProxyControl.invokeLifecycleMethod(InterceptionMetadata.java:547)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:106)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
         at $Proxy157.invokeLifecycleMethod(Unknown Source)
         at weblogic.ejb.container.pool.StatelessSessionPool.createBean(StatelessSessionPool.java:196)
         at weblogic.ejb.container.pool.StatelessSessionPool.getBean(StatelessSessionPool.java:121)
         at weblogic.ejb.container.manager.StatelessManager.preInvoke(StatelessManager.java:148)
         at weblogic.ejb.container.internal.BaseRemoteObject.preInvoke(BaseRemoteObject.java:227)
         at weblogic.ejb.container.internal.StatelessRemoteObject.preInvoke(StatelessRemoteObject.java:52)
         at sandpit.ejb.address.AddressEJB_vk8fj2_AddressEJBImpl.validatePostcode(AddressEJB_vk8fj2_AddressEJBImpl.java:39)
         at sandpit.ejb.address.AddressEJB_vk8fj2_AddressEJBImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.ServerRequest.sendReceive(ServerRequest.java:174)
         at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:345)
         at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:259)
         at sandpit.ejb.address.AddressEJB_vk8fj2_AddressEJBImpl_1031_WLStub.validatePostcode(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:73)
         ... 36 more
    Caused by: java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.bea.core.repackaged.springframework.jee.inject.Jsr250Metadata.invokeLifecycleMethod(Jsr250Metadata.java:332)
         ... 63 more
    Caused by: java.lang.NoSuchMethodError: org.springframework.util.ReflectionUtils.findMethod(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/reflect/Method;
         at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineRequiredStatus(AutowiredAnnotationBeanPostProcessor.java:347)
         at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$1.doWith(AutowiredAnnotationBeanPostProcessor.java:294)
         at org.springframework.util.ReflectionUtils.doWithFields(ReflectionUtils.java:283)
         at org.springframework.util.ReflectionUtils.doWithFields(ReflectionUtils.java:260)
         at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.findAutowiringMetadata(AutowiredAnnotationBeanPostProcessor.java:287)
         at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.processInjection(AutowiredAnnotationBeanPostProcessor.java:268)
         at org.springframework.ejb.interceptor.SpringBeanAutowiringInterceptor.autowireBean(SpringBeanAutowiringInterceptor.java:101)
         ... 68 more

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

  • How to Retrive data from db using EJB in WebDynpro

    hi...
    i m using EJB's for backend connection in WebDynpro .in which i m able to store data in sapdb .for this i followed one tutorial which i have mentioned bellow which works perfectly.Now in the same Tutorial i want to retrive the data from database and disply it in WebDynpro
    i .e i want to disply bonus when i give ssn no and also i want to disply all data in db.
    Please help me as i m totaly new to this environment and also first time i m working on EJB.its very urgent
    Thanks and Regards
    Sonal<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/1f5f3366-0401-0010-d6b0-e85a49e93a5c">https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/1f5f3366-0401-0010-d6b0-e85a49e93a5c</a>

    hi...
    i m using EJB's for backend connection in WebDynpro .in which i m able to store data in sapdb .for this i followed one tutorial which i have mentioned bellow which works perfectly.Now in the same Tutorial i want to retrive the data from database and disply it in WebDynpro
    i .e i want to disply bonus when i give ssn no and also i want to disply all data in db.
    Please help me as i m totaly new to this environment and also first time i m working on EJB.its very urgent
    Thanks and Regards
    Sonal<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/1f5f3366-0401-0010-d6b0-e85a49e93a5c">https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/1f5f3366-0401-0010-d6b0-e85a49e93a5c</a>

  • Could not lookup PortalManagerHome in the JNDI tree using EJB reference java:comp/env/ejb/PortalManager

    Hi
    I am just a starter on WLPortal.
    I have created a barebone Application from scratch. I have synchronized it properly
    from EBCC to WLP. But When I am trying to access the home page of my application,
    I am getting from stack trace -
    <Nov 6, 2002 5:37:59 PM IST> <Error> <PortalAppflow> <Could not lookup PortalManagerHome
    in the JNDI tree using EJB reference java:comp/env/ejb/PortalManager.
    javax.naming.NameNotFoundException: Unable to resolve comp/env/ejb/PortalManager
    Resolved: 'comp/env' Unresolved:'ejb' ; remaining name 'PortalManager'
    at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:802)
    at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.java:209)
    at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:173)
    at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:181)
    at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:181)
    at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:323)
    at weblogic.jndi.factories.java.ReadOnlyContextWrapper.lookup(ReadOnlyContextWrapper.java:36)
    at weblogic.jndi.internal.AbstractURLContext.lookup(AbstractURLContext.java:124)
    at javax.naming.InitialContext.lookup(InitialContext.java:350)
    at com.bea.p13n.util.JndiHelper.lookupNarrow(JndiHelper.java:96)
    at com.bea.portal.appflow.PortalAppflowHelper.<clinit>(PortalAppflowHelper.java:64)
    at com.bea.portal.appflow.servlets.internal.PortalWebflowServlet.init(PortalWebflowServlet.java:78)
    at javax.servlet.GenericServlet.init(GenericServlet.java:258)
    at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java:700)
    at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.java:643)
    at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:588)
    at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:368)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:242)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
    at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:215)
    at weblogic.servlet.jsp.PageContextImpl.forward(PageContextImpl.java:112)
    at jsp_servlet.__index._jspService(__index.java:92)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:304)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2459)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2039)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    >
    <Nov 6, 2002 5:37:59 PM IST> <Error> <HTTP> <[WebAppServletContext(19695286,FirstWebApp,/FirstWebApp)]
    Servlet failed with Exception
    java.lang.NullPointerException:
    at com.bea.portal.appflow.PortalAppflowHelper.createPortalManager(PortalAppflowHelper.java:82)
    at com.bea.portal.appflow.servlets.internal.PortalWebflowServlet.setupPortalRequest(PortalWebflowServlet.java:187)
    at com.bea.portal.appflow.servlets.internal.PortalWebflowServlet.doGet(PortalWebflowServlet.java:99)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
    at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:215)
    at weblogic.servlet.jsp.PageContextImpl.forward(PageContextImpl.java:112)
    at jsp_servlet.__index._jspService(__index.java:92)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:304)
    at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2459)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2039)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
    When I decompiled the class PortalAppflowHelper, I found a static block in it,
    which was as under-
    static
    debug = Debug.getInstance(com.bea.portal.appflow.PortalAppflowHelper.class);
    try
    if(debug.ON)
    debug.out("Looking up PortalManagerHome using EJB reference java:comp/env/ejb/PortalManager");
    portalManagerHome = (PortalManagerHome)JndiHelper.lookupNarrow("java:comp/env/ejb/PortalManager",
    com.bea.portal.manager.ejb.PortalManagerHome.class);
    if(debug.ON)
    debug.out("Successfully retrieved PortalManagerHome " + portalManagerHome);
    catch(Exception e)
    PortalAppflowLogger.errorFindingPortalManagerHome("java:comp/env/ejb/PortalManager",
    e);
    I have checked the PortalManager's JNDI name on WLConsole. Its ${APPNAME}.BEA_portal.PortalManager.
    Should I change it?
    When I tried to change it, I started getting other weird errors.
    Thanks
    Neeraj Hans

    Neeraj -
    The Portal framework code (including PortalAppflowHelper) uses ejb
    references to find the PortalManager (and other EJBs) from servlets and
    taglibs; that is what is signified by the java:comp/env/... name.
    Since you built your webapp from scratch (instead of using the portal
    wizard), you will need to make sure the you have the appropriate
    <ejb-ref> entries in your web.xml, and the corresponding
    <ejb-reference-description> entries in your weblogic.xml. By default,
    you will need at least mappings for:
    - ejb/PortalManager
    - ejb/UserManager
    - ejb/GroupManager
    - ejb/PipelineExecutor
    - ejb/EventService
    See either the resulting webapp from using the portal wizard or
    BEA_HOME/weblogic700/samples/portal/sampleportalDomain/beaApps/sampleportal/sampleportal/WEB-INF
    for example syntax.
    Greg
    Neeraj Hans wrote:
    Hi
    I am just a starter on WLPortal.
    I have created a barebone Application from scratch. I have
    synchronized it properly
    from EBCC to WLP. But When I am trying to access the home page of my
    application,
    I am getting from stack trace -
    <Nov 6, 2002 5:37:59 PM IST> <Error> <PortalAppflow> <Could not lookup
    PortalManagerHome
    in the JNDI tree using EJB reference java:comp/env/ejb/PortalManager.
    javax.naming.NameNotFoundException: Unable to resolve
    comp/env/ejb/PortalManager
    Resolved: 'comp/env' Unresolved:'ejb' ; remaining name 'PortalManager'
    at <stack trace lines snipped>
    When I decompiled the class PortalAppflowHelper, I found a static
    block in it,
    which was as under-
    static
    debug =
    Debug.getInstance(com.bea.portal.appflow.PortalAppflowHelper.class);
    try
    if(debug.ON)
    debug.out("Looking up PortalManagerHome using EJB
    reference java:comp/env/ejb/PortalManager");
    portalManagerHome =
    (PortalManagerHome)JndiHelper.lookupNarrow("java:comp/env/ejb/PortalManager",
    com.bea.portal.manager.ejb.PortalManagerHome.class);
    if(debug.ON)
    debug.out("Successfully retrieved PortalManagerHome "
    + portalManagerHome);
    catch(Exception e)
    PortalAppflowLogger.errorFindingPortalManagerHome("java:comp/env/ejb/PortalManager",
    e);
    I have checked the PortalManager's JNDI name on WLConsole. Its
    ${APPNAME}.BEA_portal.PortalManager.
    Should I change it?
    When I tried to change it, I started getting other weird errors.
    Thanks
    Neeraj Hans

  • Calling EJB with HTML via SERVLET

    Hi,
    I used a writen example that calls EJB from HTML via SERVLET. Example name is Bonus. The problem I have is that the HTML throw error while calling SERVLET. I dont figure out what seams to be a problem. Someone know?
    I wonder if the problem is in servlet? The EJB is fine!
    christian
    HTML CODE:(bonus.html)
    <HTML>
    <HEAD>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1250"/>
    <TITLE>untitled1</TITLE>
    </HEAD>
    <BODY BGCOLOR = "WHITE">
    <BLOCKQUOTE>
    <H3>Bonus Calculation</H3>
    <FORM METHOD="GET" ACTION="BonusAlias">
    <P>Enter social security Number:<P>
    <INPUT TYPE="TEXT" NAME="SOCSEC"></INPUT>
    </P>
    Enter Multiplier:
    <P>
    <INPUT TYPE="TEXT" NAME="MULTIPLIER"></INPUT>
    </P>
    <INPUT TYPE="SUBMIT" VALUE="Submit">
    <INPUT TYPE="RESET">
    </FORM>
    </BLOCKQUOTE>
    </BODY>
    </HTML>
    SERVLET CODE:(BonusServlet.java)
    package mypackage5;
    import mypackage5.Calc;
    import mypackage5.CalcHome;
    import mypackage5.impl.CalcBean;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import javax.naming.*;
    import javax.rmi.PortableRemoteObject;
    import java.beans.*;
    public class BonusServlet extends HttpServlet {
    CalcHome homecalc;
    public void init(ServletConfig config) throws ServletException{
    //Look up home interface
    try{
    //InitialContext ctx = new InitialContext();
    //Object objref = ctx.lookup("Calc");
    //homecalc = (CalcHome)PortableRemoteObject.narrow(objref, CalcHome.class);
    Context context = new InitialContext();
    CalcHome calcHome = (CalcHome)PortableRemoteObject.narrow(context.lookup("Calc"), CalcHome.class);
    Calc calc;
    catch (Exception NamingException) {
    NamingException.printStackTrace();
    public void doGet (HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    String socsec = null;
    int multiplier = 0;
    double calc = 0.0;
    PrintWriter out;
    response.setContentType("text/html");
    String title = "EJB Example";
    out = response.getWriter();
    out.println("<HTML><HEAD><TITLE>");
    out.println(title);
    out.println("</TITLE></HEAD><BODY>");
    try{
    Calc theCalculation;
    //Get Multiplier and Social Security Information
    String strMult = request.getParameter("MULTIPLIER");
    Integer integerMult = new Integer(strMult);
    multiplier = integerMult.intValue();
    socsec = request.getParameter("SOCSEC");
    //Calculate bonus
    double bonus = 100.00;
    theCalculation = homecalc.create();
    calc = theCalculation.calcBonus(multiplier, bonus);
    catch (Exception CreateException){
    CreateException.printStackTrace();
    //Display Data
    out.println("<H1>Bonus Calculation</H1>");
    out.println("<P>Soc Sec: " + socsec + "<P>");
    out.println("<P>Multiplier: " +
    multiplier + "<P>");
    out.println("<P>Bonus Amount: " + calc + "<P>");
    out.println("</BODY></HTML>");
    out.close();
    public void destroy() {
    System.out.println("Destroy");

    The error is that page cannot be found! When I run only the servlet it works, when I run the HTML page and enter the field throws eror that the page cannot be found!
    thanks
    Christian

  • Using local session bean interface from web container using EJB 3.0

    Hi,
    How can you use a local session bean interface from Java (rather than data controls) in a web container using EJB 3.0?
    I can use a remote interface by looking up InitialContext, but I can't find a local interface this way (even from another session EJB). I can use a local interface from an EJB using annotation "EJB", but as I understand, this is not available in the web container.
    If I try to add an ejb-jar.xml file, these seems to mess up by project...
    Hope you can help.
    Roger

    The portable way to retrieve an EJB reference in Java EE is to either inject it or look it up via the
    component's private naming environment. The simplest way is :
    @EJB
    private DocumentManager dm;
    The global JNDI name is only used as an implementation specific way to uniquely assign an
    identifier to a specific Remote EJB. It's best for this not to appear directly in the source code.
    There's more on global JNDI names in our EJB FAQ :
    https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html
    The alternative to annotations is to use an ejb-ref to declare the ejb dependency. The ejb-ref
    is declared in the standard deployment descriptor corresponding to the component doing the
    lookup. Each ejb-ref has an ejb-ref-name, e.g. <ejb-ref-name>DM_ref</ejb-ref-name>
    The code looks up the ejb-ref-name relative to the java:comp/env namespace to retrieve the
    EJB reference.
    DocumentManager dm = (DocumentManager)
    new InitialContext().lookup("java:comp/env/DM_ref");

Maybe you are looking for

  • Windows 8.1 Update Install Deadline Extended

    Consumer users of Windows 8.1 now have until June 10 to install Microsoft's operating system update. In early April, Microsoft released its Windows 8.1 Update and announced that users would have 30 days (until May 13) to install the new update or fac

  • Video on the Nano

    So how about that new Video iPod? Does anyone know if they're developing software for the new iPod, just like they did with the nano? For example, people with 1st generation iPod Photos could download the new Nano software to create phonebooks, calen

  • Is the FIREWIRE DEAD!

    I wish that I would have know that firewire would not work with the 5th gen. My iPod hard drive when bad 15 days after warranty expired. Now I cannot use the firewire cables for anything but charging. Has anyone heard about why it will not work? Are

  • Stuck on extracting row with smallest sequence_num

    I have this SQL from the po.po_action_history table in Oracle EBS: SELECT pah.object_id      , pah.object_sub_type_code      , pah.sequence_num      , pah.action_code   FROM po.po_action_history pah      , hr.per_all_people_f papf      , po.po_requis

  • How to download indesign free trial

    I have having problems with the above, i keeep on getting a proxy password pop up screen from creative cloud and it won't accept the username and password that i believe are mine....does anyone have any suggestions? my email is (removing personal inf