Note that there are some explanatory texts on larger screens.

plurals
  1. POFailed to retrieve "entityManagerFactory" using Geronimo
    primarykey
    data
    text
    <p>I have just started studying Spring framework. My current goal is to access database from my bean through JPA (TopLink** provider) on Geronimo server. But I can't overcome the problem of getting entityManagerFactory. </p> <p>The exception I get:</p> <blockquote> <p>java.lang.IllegalStateException: ClassLoader [org.apache.geronimo.kernel.config.MultiParentClassLoader] does NOT provide an 'addTransformer(ClassFileTransformer)' method. Specify a custom LoadTimeWeaver or start your Java virtual machine with Spring's agent: -javaagent:spring-agent.jar</p> </blockquote> <p>The way I access it:</p> <pre><code> &lt;context:load-time-weaver /&gt; &lt;bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"&gt; &lt;property name="persistenceXmlLocation" value="classpath:/META-INF/persistence.xml" /&gt; &lt;/bean&gt; &lt;bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" /&gt; &lt;bean name="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"&gt; &lt;property name="entityManagerFactory" ref="entityManagerFactory" /&gt; &lt;/bean&gt; &lt;tx:annotation-driven /&gt; </code></pre> <p>I will be very grateful if anyone can help me without using "-javaagent:spring-agent.jar" option.</p> <hr> <p>Searching a solution. First attempt.</p> <p>Following "axtavt" <a href="http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/aop.html#aop-aj-ltw-environments" rel="nofollow noreferrer">advice</a>, I found example of specifying special class loader for your web application on Tomcat. It uses <em>context.xml</em> file for that purpose. Although my Geronimo uses Tomcat, I didn't succeed implementing <em>context.xml</em>. As is said in the next <a href="http://www.ibm.com/developerworks/java/library/os-ag-tomcat/" rel="nofollow noreferrer">manual</a> the alternative for <em>context.xml</em> for Geronimo is <em>geronimo-tomcat.xml</em>, but it's syntax doesn't provide any possibilities for changing classloader. I still need help!</p> <hr>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload