Hi,
It looks like there two separate changes that could solve your issue.
1. Someone could provide an implementation of
org.springframework.instrument.classloading.LoadTimeWeaver for the Sun
Application Server. There are examples for TomCat and for the Oracle
Application server found in subpackages of
org.springframework.instrument.classloading in the spring repository
that could be used as a starting point.
2. There is likely a bug in the static weaving code that attempts to add
the transformer even though it will not be used. The reason we have not
discovered this issue until now is that in most situations the fact that
that transformer gets added despite the fact that we are statically
weaving just gets ignored and the application functions. In Spring,
apparently that is not the case.
I suggest entering a GlassFish bug for #2.
-Tom
glassfish_at_javadesktop.org wrote:
>All,
>
>for my TopLink Essentials JPA application to be deployed into the web container of a SJS AS 8.1EE instance, I have learned about the static weaving task, as I cannot use the agent or any other load time weaving.
>
>But when I try to set the toplink.weaving property in persistence.xml to "static":
>
><property name="toplink.weaving" value="static" />
>
>as stated in
>
>http://www.oracle.com/technology/products/ias/toplink/jpa/resources/toplink-jpa-extensions.html#CJAGHHFH
>
>I get the following stack trace when creating my EntityManagerFactory using Spring:
>
>org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Cannot apply class transformer without LoadTimeWeaver specified
>Caused by: java.lang.IllegalStateException: Cannot apply class transformer without LoadTimeWeaver specified
> at org.springframework.orm.jpa.persistenceunit.SpringPersistenceUnitInfo.addTransformer(SpringPersistenceUnitInfo.java:67)
> at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createContainerEntityManagerFactory(EntityManagerFactoryProvider.java:208)
> at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:218)
> at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:251)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1202)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1172)
> at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:428)
> at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
> at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
> at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
> at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
> at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:284)
> at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
> at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:244)
> at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:187)
> at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
> at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4010)
> at org.apache.catalina.core.StandardContext.start(StandardContext.java:4522)
> at com.sun.enterprise.web.WebModule.start(WebModule.java:241)
> at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:827)
> at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:811)
> at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:646)
> at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1322)
> at com.sun.enterprise.web.HttpServiceWebContainer.loadWebModule(HttpServiceWebContainer.java:880)
> at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1038)
> at com.sun.enterprise.server.WebModuleDeployEventListener.moduleDeployed(WebModuleDeployEventListener.java:160)
> at com.sun.enterprise.server.WebModuleDeployEventListener.moduleDeployed(WebModuleDeployEventListener.java:246)
> at com.sun.enterprise.admin.event.AdminEventMulticaster.invokeModuleDeployEventListener(AdminEventMulticaster.java:918)
> at com.sun.enterprise.admin.event.AdminEventMulticaster.handleModuleDeployEvent(AdminEventMulticaster.java:905)
> at com.sun.enterprise.admin.event.AdminEventMulticaster.processEvent(AdminEventMulticaster.java:427)
> at com.sun.enterprise.admin.event.AdminEventMulticaster.multicastEvent(AdminEventMulticaster.java:139)
> at com.sun.enterprise.admin.server.core.DeploymentNotificationHelper.multicastEvent(DeploymentNotificationHelper.java:288)
> at com.sun.enterprise.deployment.phasing.DeploymentServiceUtils.multicastEvent(DeploymentServiceUtils.java:155)
> at com.sun.enterprise.deployment.phasing.ServerDeploymentTarget.sendStartEvent(ServerDeploymentTarget.java:258)
> at com.sun.enterprise.deployment.phasing.StartPhase.runPhase(StartPhase.java:87)
> at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:71)
> at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:639)
> at com.sun.enterprise.deployment.phasing.PEDeploymentService.start(PEDeploymentService.java:361)
> at com.sun.enterprise.deployment.phasing.PEDeploymentService.start(PEDeploymentService.java:396)
> at com.sun.enterprise.admin.mbeans.ApplicationsConfigMBean.start(ApplicationsConfigMBean.java:702)
> 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:585)
> at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:302)
> at com.sun.enterprise.admin.config.BaseConfigMBean.invoke(BaseConfigMBean.java:357)
> at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:213)
> at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220)
> at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:815)
> at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784)
> at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at com.sun.enterprise.admin.util.proxy.ProxyClass.invoke(ProxyClass.java:54)
> at $Proxy1.invoke(Unknown Source)
> at com.sun.enterprise.admin.server.core.jmx.SunoneInterceptor.invoke(SunoneInterceptor.java:272)
> at com.sun.enterprise.admin.jmx.remote.server.callers.InvokeCaller.call(InvokeCaller.java:38)
> at com.sun.enterprise.admin.jmx.remote.server.MBeanServerRequestHandler.handle(MBeanServerRequestHandler.java:92)
> at com.sun.enterprise.admin.jmx.remote.server.servlet.RemoteJmxConnectorServlet.processRequest(RemoteJmxConnectorServlet.java:69)
> at com.sun.enterprise.admin.jmx.remote.server.servlet.RemoteJmxConnectorServlet.doPost(RemoteJmxConnectorServlet.java:94)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:767)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:264)
> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:178)
> at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:174)
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:210)
> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:178)
> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:263)
> at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
> at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:225)
> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
> at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
> at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:933)
> at com.sun.enterprise.web.connector.httpservice.HttpServiceProcessor.process(HttpServiceProcessor.java:234)
> at com.sun.enterprise.web.HttpServiceWebContainer.service(HttpServiceWebContainer.java:2143)
>
>Using
>
><property name="toplink.weaving" value="false" />
>
>the exact same Spring configuration works fine.
>
>My expectation was that when toplink.weaving is set to static,
>
>EntityManagerFactoryProvider.createContainerEntityManagerFactory(EntityManagerFactoryProvider.java:208)
>
>should *not* call back into PersistenceUnitInfo to add a transformer, as none is needed at runtime any more...
>
>Is this an issue with Spring's JPA module or TopLink Essentials?
>
>Thanks in advance & best regards,
>
>Andreas
>
>
>BTW:
>
>I had to create a SunAS81ServerPlatform and SunAS81TransactionController for AS 8.1EE different from the one for Glassfish in order to get TopLink Essentials successfully cooperating with the Transaction Manager of AS 8.1. Thanks to Wonseok Kim's blog entry at:
>
>http://jroller.com/page/guruwons?entry=use_glassfish_java_persistence_provider
>
>I got JTA support working - finally... :-)
>[Message sent by forum member 'al130959' (al130959)]
>
>http://forums.java.net/jive/thread.jspa?messageID=220797
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>
>
>