2 Replies Latest reply: Mar 6, 2014 6:03 AM by user8801102 RSS

    Weblogic 12c error when start/stop application without restart server

    user8801102

      I have a application deployed in a weblogic 12.1.1 clustered environment. Well, when I do a stop and start on the application it stops working and,  when I call a webservice that access the database, it throws the exception below:

       

        at weblogic.ejb.container.internal.EJBRuntimeUtils.throwEJBException(EJBRuntimeUtils.java:154)

        at weblogic.ejb.container.internal.BaseLocalObject.handleSystemException(BaseLocalObject.java:509)

        at weblogic.ejb.container.internal.BaseLocalObject.handleSystemException(BaseLocalObject.java:447)

        at weblogic.ejb.container.internal.BaseLocalObject.getBeanInstance(BaseLocalObject.java:166)

        at weblogic.ejb.container.internal.BaseLocalObject.preInvoke(BaseLocalObject.java:103)

        at weblogic.ejb.container.internal.BaseLocalObject.__WL_preInvoke(BaseLocalObject.java:67)

        at weblogic.ejb.container.internal.BaseWSLocalObject.__WL_preInvoke(BaseWSLocalObject.java:117)

        at ws.WSImplementation_tldlt0_WSOImpl.__WL_list_WS_preInvoke(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.wsee.server.ejb.WsEjb.preInvoke(WsEjb.java:49)

        at weblogic.wsee.jaxws.WLSEjbInstanceResolver$WLSEjbInvoker.invoke(WLSEjbInstanceResolver.java:193)

        at weblogic.wsee.jaxws.WLSInstanceResolver$WLSInvoker.invoke(WLSInstanceResolver.java:74)

        at com.sun.xml.ws.server.InvokerTube$2.invoke(InvokerTube.java:149)

        at com.sun.xml.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:95)

        at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:892)

        at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:841)

        at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:804)

        at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:706)

        at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:430)

        at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:640)

        at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:265)

        at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:163)

        at weblogic.wsee.jaxws.WLSServletAdapter.handle(WLSServletAdapter.java:171)

        at weblogic.wsee.jaxws.HttpServletAdapter$AuthorizedInvoke.run(HttpServletAdapter.java:708)

        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)

        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)

        at weblogic.wsee.util.ServerSecurityHelper.authenticatedInvoke(ServerSecurityHelper.java:103)

        at weblogic.wsee.jaxws.HttpServletAdapter$3.run(HttpServletAdapter.java:311)

        at weblogic.wsee.jaxws.HttpServletAdapter.post(HttpServletAdapter.java:336)

        at weblogic.wsee.jaxws.JAXWSServlet.doRequest(JAXWSServlet.java:99)

        at weblogic.servlet.http.AbstractAsyncServlet.service(AbstractAsyncServlet.java:99)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:844)

        at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:242)

        at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:216)

        at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:132)

        at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:338)

        at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:221)

        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3284)

        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3254)

        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)

        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)

        at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:57)

        at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2163)

        at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2089)

        at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2074)

        at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1513)

        at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:254)

        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)

        at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)

      Caused by: com.bea.core.repackaged.springframework.beans.factory.BeanCreationException: Error creating bean with name 'EjbImplementation': Initialization of bean failed; nested exception is com.bea.core.repackaged.springframework.beans.factory.BeanCreationException: Dependency injection failure: can't find the bean definition about class interface javax.persistence.EntityManager; nested exception is com.bea.core.repackaged.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [javax.persistence.EntityManager] is defined: No beans of type javax.persistence.EntityManager; owner=com.bea.core.repackaged.springframework.context.support.GenericApplicationContext@1173175: display name [com.bea.core.repackaged.springframework.context.support.GenericApplicationContext@1173175]; startup date [Fri Feb 21 20:11:51 GMT-03:00 2014]; parent: com.bea.core.repackaged.springframework.context.support.GenericApplicationContext@1d36fa0

        at com.bea.core.repackaged.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:478)

        at com.bea.core.repackaged.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)

        at java.security.AccessController.doPrivileged(Native Method)

        at com.bea.core.repackaged.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)

        at com.bea.core.repackaged.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:283)

        at com.bea.core.repackaged.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)

        at com.bea.core.repackaged.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)

        at com.bea.core.repackaged.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:308)

        at com.bea.core.repackaged.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:297)

        at com.bea.core.repackaged.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:942)

        at com.bea.core.repackaged.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncludingAncestors(BeanFactoryUtils.java:224)

        at com.bea.core.repackaged.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncludingAncestors(BeanFactoryUtils.java:228)

        at com.oracle.pitchfork.inject.Jsr250Metadata.getUniqueInstanceOfType(Jsr250Metadata.java:349)

        at com.oracle.pitchfork.inject.Jsr250Metadata.resolveByType(Jsr250Metadata.java:345)

        at com.oracle.pitchfork.inject.Jsr250Metadata.resolve(Jsr250Metadata.java:275)

        at com.oracle.pitchfork.inject.Jsr250Metadata.applyInjections(Jsr250Metadata.java:228)

        at com.oracle.pitchfork.inject.Jsr250Metadata.inject(Jsr250Metadata.java:219)

        at com.oracle.pitchfork.spi.BaseComponentBrokerImpl.getBean(BaseComponentBrokerImpl.java:63)

        at com.oracle.pitchfork.spi.EjbComponentCreatorBrokerImpl.getBean(EjbComponentCreatorBrokerImpl.java:33)

        at weblogic.ejb.container.injection.EjbComponentCreatorImpl.getBean(EjbComponentCreatorImpl.java:76)

        at weblogic.ejb.container.manager.BaseEJBManager.createNewBeanInstance(BaseEJBManager.java:209)

        at weblogic.ejb.container.manager.BaseEJBManager.allocateBean(BaseEJBManager.java:235)

        at weblogic.ejb.container.manager.StatelessManager.createBean(StatelessManager.java:293)

        at weblogic.ejb.container.pool.StatelessSessionPool.createBean(StatelessSessionPool.java:185)

        at weblogic.ejb.container.pool.StatelessSessionPool.getBean(StatelessSessionPool.java:114)

        at weblogic.ejb.container.manager.StatelessManager.preInvoke(StatelessManager.java:174)

        at weblogic.ejb.container.internal.BaseLocalObject.getBeanInstance(BaseLocalObject.java:146)

        ... 48 more

      Caused by: com.bea.core.repackaged.springframework.beans.factory.BeanCreationException: Dependency injection failure: can't find the bean definition about class interface javax.persistence.EntityManager; nested exception is com.bea.core.repackaged.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [javax.persistence.EntityManager] is defined: No beans of type javax.persistence.EntityManager; owner=com.bea.core.repackaged.springframework.context.support.GenericApplicationContext@1173175: display name [com.bea.core.repackaged.springframework.context.support.GenericApplicationContext@1173175]; startup date [Fri Feb 21 20:11:51 GMT-03:00 2014]; parent: com.bea.core.repackaged.springframework.context.support.GenericApplicationContext@1d36fa0

        at com.oracle.pitchfork.inject.Jsr250Metadata.applyInjections(Jsr250Metadata.java:234)

        at com.oracle.pitchfork.inject.Jsr250Metadata.inject(Jsr250Metadata.java:219)

        at com.oracle.pitchfork.inject.Jsr250Metadata.injectAndPostConstruct(Jsr250Metadata.java:246)

        at com.oracle.pitchfork.inject.Jsr250MetadataBeanPostProcessor.postProcessAfterInstantiation(Jsr250MetadataBeanPostProcessor.java:40)

        at com.bea.core.repackaged.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:957)

        at com.bea.core.repackaged.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:470)

        ... 74 more

      Caused by: com.bea.core.repackaged.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [javax.persistence.EntityManager] is defined: No beans of type javax.persistence.EntityManager; owner=com.bea.core.repackaged.springframework.context.support.GenericApplicationContext@1173175: display name [com.bea.core.repackaged.springframework.context.support.GenericApplicationContext@1173175]; startup date [Fri Feb 21 20:11:51 GMT-03:00 2014]; parent: com.bea.core.repackaged.springframework.context.support.GenericApplicationContext@1d36fa0

        at com.oracle.pitchfork.inject.Jsr250Metadata.getUniqueInstanceOfType(Jsr250Metadata.java:351)

        at com.oracle.pitchfork.inject.Jsr250Metadata.resolveByType(Jsr250Metadata.java:345)

        at com.oracle.pitchfork.inject.Jsr250Metadata.resolve(Jsr250Metadata.java:275)

        at com.oracle.pitchfork.inject.Jsr250Metadata.applyInjections(Jsr250Metadata.java:228)

        ... 79 more

       

      If I restart the server, everything starts to work well.

      I'm using Weblogic 12.1.1, clutered and in windows. I have tried this same application in a redhat environment and the error keeps the same.

       

      I put the application for download:

      source-code: http://antoniorafael.eti.br/weblogic/Sources.rar

      build: http://antoniorafael.eti.br/weblogic/WeblogicErrorEAR-0.0.1-SNAPSHOT.ear

       

      To install the application you need a datasource with the following JNDI: jdbc/postgresweblogic

      script to create the needed tables: http://antoniorafael.eti.br/weblogic/sqlWebLogicTest.txt

       

      Steps to reproduce:

       

      1) Create the datasource.

      2) Install the application with a cluster as target

      3) Start the Server [if the server is already started, restart it]

      4) Teste the application:

                               access the webservice: http://localhost:7003/WSImplementation/WSImplementationService?WSDL

                               attention: localhost:7003 is my configuration, you have to replace with the host and port of your server

                               call the method list (the only method in the webservice)

      Everything should works fine, you have to receive a xml list with the database table's content.

       

      5) Stop the application

      6) Start the application

      7) Test again as it was done in the step 4

           Now you have to get the same error that I got.

      8) Stop the application

      9) Stop the server

      10) Start the server

      11) Start the application ( if it isn't started already )

      Everything works fine again.

       

      I have been in the problem for so many time. Please, I really need some help.


      Thanks!



        • 1. Re: Weblogic 12c error when start/stop application without restart server
          René van Wijk

          Note that on 12.1.2 this behavior is not observed (on 12.1.1 it is). Used the following test on your code

           

          wsimport -keep -d C:\temp\frameworks\untitled\test\src http://hostname:port/WSImplementation/WSImplementationService?WSDL

          parsing WSDL...

          generating code...

          compiling code...

           

          with the following test

           

          public static void main(String[] args) {

                  WSImplementationService service = new WSImplementationService();

                  WSImplementation port = service.getWSImplementationPort();

                  List<EntityTest> entities = port.list();

                  for (EntityTest entity: entities) {

                      System.out.println(entity.getId() + ", " + entity.getTestField());

                  }

              }

          }

           

          When the code is initially run everything goes OK, after a stop and start the following is observed in the weblogic server logging (and the client)

           

          SEVERE: EJB Exception: : com.bea.core.repackaged.springframework.beans.factory.BeanCreationException: Error creating bean with name 'EjbImplementation': Initialization of bean failed; nested exception is com.bea.core.repackaged.springframework.beans.factory.BeanCreationException: Dependency injection failure: can't find the bean definition about class interface javax.persistence.EntityManager; nested exception is com.bea.core.repackaged.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [javax.persistence.EntityManager] is defined: No beans of type javax.persistence.EntityManager; owner=com.bea.core.repackaged.springframework.context.support.GenericApplicationContext@18b937e: display name [com.bea.core.repackaged.springframework.context.support.GenericApplicationContext@18b937e]; startup date [Tue Feb 25 13:36:48 CET 2014]; parent: com.bea.core.repackaged.springframework.context.support.GenericApplicationContext@3faf5eab

           

          On 12.1.2 everything goes OK (also after a stop and start). Maybe it is an idea to try this out on 12.1.2.

          • 2. Re: Weblogic 12c error when start/stop application without restart server
            user8801102

            Hello RenévanWijk

             

            Thanks for your response and sorry for my delay in reply you.

            Change the weblogic version to 12.1.2, unfortunately,  is not a option for me.

            Do you know if there is some patch for this issue on weblogic 12.1.1?

             

            Thank you again.