You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by Andreas Prudzilko <ap...@welho.com> on 2007/10/30 16:52:42 UTC
Classloader issues
Hi,
I'm using openJPA with Spring 2.0 and Tomcat 6. The installation went
rather smoothly but one thing troubles me tho:
When I try to fetch an object from the DB I get this
(seems like a classloader issue in log4j, but it appeared first since I
started to use openJPA)
So maybe someone had the same thing and can point me in the right
direction....
Thanks,
Andreas
64829 databotPersistence INFO [http-8080-2] openjpa.Runtime -
Starting OpenJPA 1.0.0
log4j:ERROR A "org.apache.log4j.ConsoleAppender" object is not
assignable to a "org.apache.log4j.Appender" variable.
log4j:ERROR The class "org.apache.log4j.Appender" was loaded by
log4j:ERROR
[org.springframework.instrument.classloading.SimpleInstrumentableClassLoader@1dee400]
whereas object of type
log4j:ERROR "org.apache.log4j.ConsoleAppender" was loaded by
[WebappClassLoader
delegate: false
repositories:
/WEB-INF/classes/
----------> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader@665753
].
log4j:ERROR Could not instantiate appender named "stdout".
log4j:ERROR A "org.apache.log4j.RollingFileAppender" object is not
assignable to a "org.apache.log4j.Appender" variable.
log4j:ERROR The class "org.apache.log4j.Appender" was loaded by
log4j:ERROR
[org.springframework.instrument.classloading.SimpleInstrumentableClassLoader@1dee400]
whereas object of type
log4j:ERROR "org.apache.log4j.RollingFileAppender" was loaded by
[WebappClassLoader
delegate: false
repositories:
/WEB-INF/classes/
----------> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader@665753
].
log4j:ERROR Could not instantiate appender named "logfile".
68032 databotPersistence TRACE [http-8080-2] openjpa.jdbc.SQL - <t
12804261, conn 16655704> executing prepstmnt 14505601 SELECT t0.id,
t0.email, t0.name, t0.password, t0.screenname FROM user t0 WHERE
(t0.screenname = ?) [params=(String) Frieder]
68110 databotPersistence TRACE [http-8080-2] openjpa.jdbc.SQL - <t
12804261, conn 16655704> [78 ms] spent
Re: Classloader issues
Posted by Patrick Linskey <pl...@gmail.com>.
Hi,
I don't really understand exactly the places where
SimpleLoadTimeWeaver breaks down, but it seems to often result in
split class hierarchies. What happens if you take it out, or replace
it with the Tomcat-specific one? Generally-speaking, you should pick
the LoadTimeWeaver that is the most targeted at your runtime
environment.
-Patrick
On Oct 30, 2007 9:24 AM, Andreas Prudzilko <ap...@welho.com> wrote:
>
> Hi Patrick,
>
> yes I do:
>
> <bean id="entityManagerFactory"
> class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
> <property name="dataSource" ref="defaultDataSource"/>
> <property name="persistenceUnitName" value="databotPersistence"/>
> <property name="jpaVendorAdapter">
> <bean
> class="org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter">
> <property name="database" value="MYSQL"/>
> <property name="showSql" value="true"/>
> </bean>
> </property>
> <property name="loadTimeWeaver">
> <bean
> class="org.springframework.instrument.classloading.SimpleLoadTimeWeaver"/>
> </property>
> </bean>
>
> <bean id="transactionManager"
> class="org.springframework.orm.jpa.JpaTransactionManager">
> <property name="entityManagerFactory" ref="entityManagerFactory" />
> <property name="dataSource" ref="defaultDataSource" />
> </bean>
>
> <tx:annotation-driven/>
>
> <bean
> class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor"/>
>
> my persistence.xml looks like this:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <persistence xmlns="http://java.sun.com/xml/ns/persistence"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="
> http://java.sun.com/xml/ns/persistence
> http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
> version="1.0">
>
> <persistence-unit name="databotPersistence"
> transaction-type="RESOURCE_LOCAL">
>
> <provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
> </persistence-unit>
>
> </persistence>
>
>
>
> Hi,
>
> Are you using the SimpleLoadTimeWeaver?
>
> -Patrick
>
> On Oct 30, 2007 8:52 AM, Andreas Prudzilko <ap...@welho.com> wrote:
>
>
> Hi,
>
> I'm using openJPA with Spring 2.0 and Tomcat 6. The installation went
> rather smoothly but one thing troubles me tho:
> When I try to fetch an object from the DB I get this
> (seems like a classloader issue in log4j, but it appeared first since I
> started to use openJPA)
>
> So maybe someone had the same thing and can point me in the right
> direction....
>
> Thanks,
>
> Andreas
>
> 64829 databotPersistence INFO [http-8080-2] openjpa.Runtime -
> Starting OpenJPA 1.0.0
> log4j:ERROR A "org.apache.log4j.ConsoleAppender" object is not
> assignable to a "org.apache.log4j.Appender" variable.
> log4j:ERROR The class "org.apache.log4j.Appender" was loaded by
> log4j:ERROR
> [org.springframework.instrument.classloading.SimpleInstrumentableClassLoader@1dee400]
> whereas object of type
> log4j:ERROR "org.apache.log4j.ConsoleAppender" was loaded by
> [WebappClassLoader
> delegate: false
> repositories:
> /WEB-INF/classes/
> ----------> Parent Classloader:
> org.apache.catalina.loader.StandardClassLoader@665753
> ].
> log4j:ERROR Could not instantiate appender named "stdout".
> log4j:ERROR A "org.apache.log4j.RollingFileAppender" object is not
> assignable to a "org.apache.log4j.Appender" variable.
> log4j:ERROR The class "org.apache.log4j.Appender" was loaded by
> log4j:ERROR
> [org.springframework.instrument.classloading.SimpleInstrumentableClassLoader@1dee400]
> whereas object of type
> log4j:ERROR "org.apache.log4j.RollingFileAppender" was loaded by
> [WebappClassLoader
> delegate: false
> repositories:
> /WEB-INF/classes/
> ----------> Parent Classloader:
> org.apache.catalina.loader.StandardClassLoader@665753
> ].
> log4j:ERROR Could not instantiate appender named "logfile".
> 68032 databotPersistence TRACE [http-8080-2] openjpa.jdbc.SQL - <t
> 12804261, conn 16655704> executing prepstmnt 14505601 SELECT t0.id,
> t0.email, t0.name, t0.password, t0.screenname FROM user t0 WHERE
> (t0.screenname = ?) [params=(String) Frieder]
> 68110 databotPersistence TRACE [http-8080-2] openjpa.jdbc.SQL - <t
> 12804261, conn 16655704> [78 ms] spent
>
>
>
>
>
>
>
>
>
>
>
>
--
Patrick Linskey
202 669 5907
Re: Classloader issues
Posted by Patrick Linskey <pl...@gmail.com>.
Hi,
Are you using the SimpleLoadTimeWeaver?
-Patrick
On Oct 30, 2007 8:52 AM, Andreas Prudzilko <ap...@welho.com> wrote:
> Hi,
>
> I'm using openJPA with Spring 2.0 and Tomcat 6. The installation went
> rather smoothly but one thing troubles me tho:
> When I try to fetch an object from the DB I get this
> (seems like a classloader issue in log4j, but it appeared first since I
> started to use openJPA)
>
> So maybe someone had the same thing and can point me in the right
> direction....
>
> Thanks,
>
> Andreas
>
> 64829 databotPersistence INFO [http-8080-2] openjpa.Runtime -
> Starting OpenJPA 1.0.0
> log4j:ERROR A "org.apache.log4j.ConsoleAppender" object is not
> assignable to a "org.apache.log4j.Appender" variable.
> log4j:ERROR The class "org.apache.log4j.Appender" was loaded by
> log4j:ERROR
> [org.springframework.instrument.classloading.SimpleInstrumentableClassLoader@1dee400]
> whereas object of type
> log4j:ERROR "org.apache.log4j.ConsoleAppender" was loaded by
> [WebappClassLoader
> delegate: false
> repositories:
> /WEB-INF/classes/
> ----------> Parent Classloader:
> org.apache.catalina.loader.StandardClassLoader@665753
> ].
> log4j:ERROR Could not instantiate appender named "stdout".
> log4j:ERROR A "org.apache.log4j.RollingFileAppender" object is not
> assignable to a "org.apache.log4j.Appender" variable.
> log4j:ERROR The class "org.apache.log4j.Appender" was loaded by
> log4j:ERROR
> [org.springframework.instrument.classloading.SimpleInstrumentableClassLoader@1dee400]
> whereas object of type
> log4j:ERROR "org.apache.log4j.RollingFileAppender" was loaded by
> [WebappClassLoader
> delegate: false
> repositories:
> /WEB-INF/classes/
> ----------> Parent Classloader:
> org.apache.catalina.loader.StandardClassLoader@665753
> ].
> log4j:ERROR Could not instantiate appender named "logfile".
> 68032 databotPersistence TRACE [http-8080-2] openjpa.jdbc.SQL - <t
> 12804261, conn 16655704> executing prepstmnt 14505601 SELECT t0.id,
> t0.email, t0.name, t0.password, t0.screenname FROM user t0 WHERE
> (t0.screenname = ?) [params=(String) Frieder]
> 68110 databotPersistence TRACE [http-8080-2] openjpa.jdbc.SQL - <t
> 12804261, conn 16655704> [78 ms] spent
>
>
>
>
>
>
--
Patrick Linskey
202 669 5907