[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Re: EclipseLink + JPA 2 in Weblogic 10.3.0

Jehanzeb,
    Hi, investigation was done to determine valid configurations for container managed EclipseLink 2.0 based EAR's deployed to WebLogic 10.3.2.0 - you may use the same recommended configurations on WebLogic 10.3.0 (but be aware that no formal testing on the older 10.3.0 was performed for the following specific wiki page below).

    Refer to the following 296271 analysis wiki for EclipseLink 2.0 on WebLogic 10.3.2.0
    http://wiki.eclipse.org/EclipseLink/Development/JPA_2.0/weblogic#Results_Matrix

    The issue is that the 10.3.2.0 shipped versions (late 2009) of the two jars (may have different dates in 10.3.0) need to be overridden when running the latest EclipseLink 2.0/2.1.
       %WEBLOGIC_10320_HOME%/modules/org.eclipse.persistence_1.0.0.0_1-2-0.jar
       %WEBLOGIC_10320_HOME%/modules/javax.persistence_1.0.0.0_1-0-2.jar

    Options 3a and 3b will match what you are currently doing - modify commEnv.cmd or overwrite both the EclipseLink and javax.persistence spec jars
http://wiki.eclipse.org/EclipseLink/Development/JPA_2.0/weblogic#DI_1.1:_Problem
http://wiki.eclipse.org/EclipseLink/Development/JPA_2.0/weblogic#DI_1.1:_Alternative_2:_Reference_higher_in_the_server_classpath_via_commEnv.cmd

    Option 1 involves shipping both eclipselink.jar and the javax.persistence spec jar with the the EAR (if you wish to avoid modifying the server) via the FilteredClassLoader and its' wls:prefer-application-packages element in weblogic-application.xml
    http://wiki.eclipse.org/EclipseLink/Development/JPA_2.0/weblogic#DI_1.1:_Alternative_3:_Application_Level_Shared_Library_-_In_Use
    Note: that the 2.0 schema version for persistence.xml cannot be used in this specific case - stick to the 1.0 schema and tags.  All 2.0 API outside of actually defining these persistence.xml tags works fine using EclipseLink 2.0 however.

    You may also refer to the general WebLogic JPA EE tutorial page below for working configuration and source.  Specifically, make sure you are running with the latest 9J3A patch (WebLogic 10.3.0 only - as WebLogic 10.3.2 works out of the box)
http://wiki.eclipse.org/EclipseLink/Examples/JPA/WebLogic_Web_Tutorial#Option_2:_Apply_Smart_Update_Patch_-_Recommended_for_10.3.0.0

    For extra investigation details, you may also refer to the following enhancement request bug# 296271 : JPA 2.0: Add WebLogic 10.3 configuration process to enable the JPA 2.0 library functionality
    http://bugs.eclipse.org/296271
    https://bugs.eclipse.org/bugs/attachment.cgi?id=156842

    The other options using the domain/lib, [-Dweblogic.ext.dirs] or a global shared library will not work for EE container managed applications because they will not override the /modules directory and you will get a configuration that mixes classloaders causing injection failure and other possible NoClassDefFoundError exceptions.
    From what I can see, the osgi error in your first mail may be caused by split classloaders across modules and domain/lib, the persistence provider not found error in your second mail is likely caused by the ejb container not finding the eclipselink.jar during predeployment during EAR deployment, and the error in your 3rd mail is probably the result of a similar classloader level mismatch when we get to @PersistenceContext EM injection on your Spring bean - from the stacktrace it looks like the javax.persistence (EM) injection is not being accepted because no EM $proxy is available/created?.  I may be wrong about the 3rd mail because the stack trace involves both Struts and Spring frameworks with their own injection interceptors that I am not yet familiar with in Spring 3.0 spring-context.xml descriptors. Check your remote/local ejb beans' jndi format (there are 2 depending on whether you override the mappedName attribute).    Normally the only Spring API that shows up in EE injection logs is the AOP part of the framework. [    at com.bea.core.repackaged.springframework.aop.] 
    Also if DI injection is not working for EclipseLink 1.2 or 2.0 try overriding the jndi name (name="") attribute in the @PersistenceContext annotation and doing a manual InitialContext lookup in your client where your EM is being used - like what is mentioned in the following post that is having similar general injection issues on 10.3.0 with generic JPA 1.0.  http://msikora.typepad.com/michael_sikora_on_java_ee/2008/11/converting-to-weblogic-103---part-3.html

    You should be safe for now just keeping all your library jars in one place in the root modules directory (3a/3b)

    thank you
    /michael
    http://www.eclipselink.org

jz wrote:

And when i place eclipselink.jar in $domain/lib and both javax.persistence.1.x.jar and javax.persistence.2.x.jar are in bea/modules directory. I get following error while injecting entity manager factory in ejb.


javax.ejb.EJBException: EJB Exception: : com.bea.core.repackaged.springframework.beans.factory.BeanCreationException: Dependency injection failure: can't f
ind the bean definition about class interface javax.persistence.EntityManagerFactory; nested exception is com.bea.core.repackaged.springframework.beans.fac
tory.NoSuchBeanDefinitionException: No unique bean of type [javax.persistence.EntityManagerFactory] is defined: No beans of type javax.persistence.EntityMa
nagerFactory; owner=com.bea.core.repackaged.springframework.context.support.GenericApplicationContext: display name [com.bea.core.repackaged.springframewor
k.context.support.GenericApplicationContext;hashCode=19076183]; startup date [Mon Mar 29 11:11:37 PKT 2010]; child of [com.bea.core.repackaged.springframew
ork.context.support.GenericApplicationContext: display name [com.bea.core.repackaged.springframework.context.support.GenericApplicationContext;hashCode=134
50309]; startup date [Mon Mar 29 11:11:37 PKT 2010]; child of [com.bea.core.repackaged.springframework.context.support.GenericApplicationContext: display n
ame [com.bea.core.repackaged.springframework.context.support.GenericApplicationContext;hashCode=29318178]; startup date [Mon Mar 29 11:11:37 PKT 2010]; roo
t of context hierarchy]]
Caused by: com.bea.core.repackaged.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [javax.persistence.EntityManagerFact
ory] is defined: No beans of type javax.persistence.EntityManagerFactory; owner=com.bea.core.repackaged.springframework.context.support.GenericApplicationC
ontext: display name [com.bea.core.repackaged.springframework.context.support.GenericApplicationContext;hashCode=19076183]; startup date [Mon Mar 29 11:11:
37 PKT 2010]; child of [com.bea.core.repackaged.springframework.context.support.GenericApplicationContext: display name [com.bea.core.repackaged.springfram
ework.context.support.GenericApplicationContext;hashCode=13450309]; startup date [Mon Mar 29 11:11:37 PKT 2010]; child of [com.bea.core.repackaged.springfr
amework.context.support.GenericApplicationContext: display name [com.bea.core.repackaged.springframework.context.support.GenericApplicationContext;hashCode
=29318178]; startup date [Mon Mar 29 11:11:37 PKT 2010]; root of context hierarchy]]
        at com.bea.core.repackaged.springframework.jee.inject.Jsr250Metadata.getUniqueInstanceOfType(Jsr250Metadata.java:305)
        at com.bea.core.repackaged.springframework.jee.inject.Jsr250Metadata.resolveByType(Jsr250Metadata.java:299)
        at com.bea.core.repackaged.springframework.jee.inject.Jsr250Metadata.resolve(Jsr250Metadata.java:286)
        at com.bea.core.repackaged.springframework.jee.inject.Jsr250Metadata.applyInjections(Jsr250Metadata.java:238)
        at com.bea.core.repackaged.springframework.jee.inject.Jsr250Metadata.inject(Jsr250Metadata.java:226)
        at com.bea.core.repackaged.springframework.jee.inject.Jsr250Metadata.injectAndPostConstruct(Jsr250Metadata.java:256)
        at com.bea.core.repackaged.springframework.jee.inject.Jsr250MetadataBeanPostProcessor.postProcessAfterInstantiation(Jsr250MetadataBeanPostProcessor
.java:40)
        at com.bea.core.repackaged.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.j
ava:416)
        at com.bea.core.repackaged.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:269)
        at com.bea.core.repackaged.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:161)
        at com.bea.core.repackaged.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:642)
        at com.bea.core.repackaged.springframework.jee.intercept.InterceptionMetadata.addJeeInterceptors(InterceptionMetadata.java:738)
        at com.bea.core.repackaged.springframework.jee.intercept.InterceptionMetadata.addJeeInterceptors(InterceptionMetadata.java:697)
        at com.bea.core.repackaged.springframework.jee.intercept.InterceptionMetadata.createProxyIfNecessary(InterceptionMetadata.java:472)
        at com.bea.core.repackaged.springframework.jee.intercept.InterceptionMetadata.createProxyIfNecessary(InterceptionMetadata.java:410)
        at com.bea.core.repackaged.springframework.jee.spi.EjbComponentCreatorBrokerImpl.invokeCreateProxyIfNecessary(EjbComponentCreatorBrokerImpl.java:97
)
        at com.bea.core.repackaged.springframework.jee.spi.EjbComponentCreatorBrokerImpl.getBean(EjbComponentCreatorBrokerImpl.java:53)
        at weblogic.ejb.container.injection.EjbComponentCreatorImpl.getBean(EjbComponentCreatorImpl.java:67)
        at weblogic.ejb.container.manager.BaseEJBManager.createNewBeanInstance(BaseEJBManager.java:216)
        at weblogic.ejb.container.manager.BaseEJBManager.allocateBean(BaseEJBManager.java:233)
        at weblogic.ejb.container.manager.StatelessManager.createBean(StatelessManager.java:303)
        at weblogic.ejb.container.pool.StatelessSessionPool.createBean(StatelessSessionPool.java:190)
        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.BaseLocalObject.preInvoke(BaseLocalObject.java:239)
        at weblogic.ejb.container.internal.BaseLocalObject.preInvoke(BaseLocalObject.java:186)
        at weblogic.ejb.container.internal.StatelessLocalObject.preInvoke(StatelessLocalObject.java:52)
        at com.warid.campaign.service.CampaignCrudBean_hnb9s4_CampaignCrudImpl.querySingle(CampaignCrudBean_hnb9s4_CampaignCrudImpl.java:42)
        at com.warid.campaign.web.struts.action.GroupAction.list(GroupAction.java:67)
        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.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:441)
        at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:280)
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:243)
        at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138)
        at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
        at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:165)
        at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
        at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:252)
        at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
        at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
        at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
        at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)
        at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
        at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)
        at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
        at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:179)
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
        at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
        at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
        at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235)
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
        at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89)
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
        at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:130)
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
        at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
        at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126)
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
        at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:165)
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
        at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
        at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:179)
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
        at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)
        at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)
        at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
        at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488)
        at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:395)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3499)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at weblogic.security.service.SecurityManager.runAs(Unknown Source)
        at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2183)
        at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2089)
        at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Regards,
Jehanzeb Qayyum




On Mon, Mar 29, 2010 at 10:55 AM, jz <jehanzeb.qayyum@xxxxxxxxx> wrote:
And when i place eclipselink.jar and javax.persistence.2.x.jar in bea/modules directory where javax.persistence.1.x.jar and openjpa jars are placed. I get following error at the time of application deployment:

weblogic.management.DeploymentException:
        at weblogic.application.internal.flow.JpaFlow.prepare(JpaFlow.java:59)
        at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:615)
        at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:37)
        at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:191)
        at weblogic.application.internal.EarDeployment.prepare(EarDeployment.java:16)
        at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:155)
        at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
        at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:197)
        at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:89)
        at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217)
        at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:723)
        at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1190)
        at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:248)
        at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159)
        at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:157
)
        at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:12)
        at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:45)
        at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Caused by: weblogic.deployment.EnvironmentException: Error processing persitence unit campaignpu of module CampaignManager: Error instantiating the Persist
ence Provider class org.eclipse.persistence.jpa.PersistenceProvider of the PersistenceUnit campaignpu: java.lang.ClassNotFoundException: org.eclipse.persis
tence.jpa.PersistenceProvider
        at weblogic.deployment.PersistenceUnitInfoImpl.createEntityManagerFactory(PersistenceUnitInfoImpl.java:322)
        at weblogic.deployment.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:123)
        at weblogic.deployment.AbstractPersistenceUnitRegistry.storeDescriptors(AbstractPersistenceUnitRegistry.java:331)
        at weblogic.deployment.AbstractPersistenceUnitRegistry.loadPersistenceDescriptors(AbstractPersistenceUnitRegistry.java:111)
        at weblogic.deployment.EarPersistenceUnitRegistry.<init>(EarPersistenceUnitRegistry.java:52)
        at weblogic.application.internal.flow.JpaFlow.prepare(JpaFlow.java:54)
        ... 19 more

Regards,
Jehanzeb Qayyum





On Mon, Mar 29, 2010 at 10:11 AM, jz <jehanzeb.qayyum@xxxxxxxxx> wrote:
Hi All,

What jars to include in $domain/lib folder for EclipseLink + JPA 2 in Weblogic 10.3.0?  When i add eclipselink.jar and jpa.persistence.2.x.jar , i get below error on server startup:

java.lang.NoClassDefFoundError: org/osgi/framework/BundleActivator
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
        at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:247)
        at weblogic.t3.srvr.servicegroups.ServicePluginGroup.processPossibleServicePlugin(ServicePluginGroup.java:157)
        at weblogic.t3.srvr.servicegroups.ServicePluginGroup.<init>(ServicePluginGroup.java:90)
        at weblogic.t3.srvr.servicegroups.ServerServiceDependencies.<init>(ServerServiceDependencies.java:58)
        at weblogic.t3.srvr.servicegroups.ServerServiceDependencies.<clinit>(ServerServiceDependencies.java:48)
        at weblogic.t3.srvr.ServerServices.<clinit>(ServerServices.java:94)
        at weblogic.t3.srvr.ServerServicesManager.getServicesBeforeStandbyState(ServerServicesManager.java:368)
        at weblogic.t3.srvr.ServerServicesManager.startInStandbyState(ServerServicesManager.java:147)
        at weblogic.t3.srvr.T3Srvr.initializeStandby(T3Srvr.java:711)
        at weblogic.t3.srvr.T3Srvr.startup(T3Srvr.java:482)
        at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:440)
        at weblogic.Server.main(Server.java:67)

 
Regards,
Jehanzeb Qayyum





_______________________________________________ eclipselink-users mailing list eclipselink-users@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/eclipselink-users