Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Spring + Stripes + Eclipselink - Problems with EntityManager and/or injection

This error occurs when EclipseLink thinks that it weaved the classes, but the
classes were not actually weaved.  During the weaving EclipseLink uses a
temporary class loader to load the persistent classes so it can weave the
class on the real class loader, this error normally occurs when the
temporary class loader is loading the class with the real class loader.

Try:
1 - List each persistent class in your persistence.xml.  Sometimes you may
also need to list classes referenced by your persistent classes if they
could trigger a load of your persistent classes.
2 - If that does not work in could be something Spring related, but I'm not
Spring expert, so I'm not sure what this could be.
3 - If all else fails you can disable weaving, in your persistence.xml add
the property "eclipselink.weaving"="false".



Kasper Hansen-4 wrote:
> 
> I've tried to follow what instructions I've been able to find, on how to
> configure both Spring, Stripes and EclipseLink. If this is indeed a
> Stripes
> error, then what does this mean (snippet taken from the stacktrace
> attached
> in earlier mail);
> 
> Exception [EclipseLink-60] (Eclipse Persistence Services - 1.0 (Build
> SNAPSHOT - 20080707)):
> org.eclipse.persistence.exceptions.DescriptorException
> Exception Description: The method [_persistence_setsettings_vh] or
> [_persistence_getsettings_vh] is not defined in the object
> [dk.logiksyndikatet.ibslogic.domain.Provider].
> Internal Exception: java.lang.NoSuchMethodException:
> dk.logiksyndikatet.ibslogic.domain.Provider._persistence_getsettings_vh()
> Mapping: org.eclipse.persistence.mappings.OneToOneMapping[settings]
> Descriptor:
> RelationalDescriptor(dk.logiksyndikatet.ibslogic.domain.Provider
> --> [DatabaseTable(PROVIDER)])
> 
> NoSuchMethodException ? What is going on here ?
> 
> :-) Kasper
> 
> On Wed, Feb 18, 2009 at 1:21 PM, Tim Hollosy <hollosyt@xxxxxxxxx> wrote:
> 
>> This looks like more of a Stripes error than an EclipseLink error.
>>
>> ./tch
>>
>>
>>
>> On Wed, Feb 18, 2009 at 7:19 AM, Kasper Hansen <kbhdk1976@xxxxxxxxx>
>> wrote:
>> > I'm looking for a simple example for the configuration of Spring,
>> Stripes
>> > and EclipseLink. I've provided my config files so far, which I'm sure
>> is
>> > error-prone. It would be very helpfull if You would look them through,
>> and
>> > comment them;
>> >
>> > I've attached the error i'm currently having, as a htm file. I would
>> > appriciate any help or hints it's possible for You to supply.
>> >
>> > Thanks.
>> >
>> >
>> >
>> > Persistence.xml:
>> > <?xml version="1.0" encoding="UTF-8"?>
>> > <persistence version="1.0"
>> >     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";>
>> >
>> >     <persistence-unit name="ibslogic">
>> >
>> <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
>> >
>> >         <class>dk.logiksyndikatet.ibslogic.domain.Settings</class>
>> >
>> >         <properties>
>> >             <property name="eclipselink.jdbc.user"
>> value="ibslogicuser"/>
>> >             <property name="eclipselink.jdbc.password"
>> > value="ibslogicpassword"/>
>> >             <property name="eclipselink.jdbc.driver"
>> > value="com.mysql.jdbc.Driver"/>
>> >             <property name="eclipselink.ddl-generation"
>> > value="create-tables"/>
>> >         </properties>
>> >     </persistence-unit>
>> > </persistence>
>> >
>> > spring-context.xml:
>> > <?xml version="1.0" encoding="UTF-8"?>
>> > <beans    xmlns="http://www.springframework.org/schema/beans";
>> >         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>> >         xmlns:aop="http://www.springframework.org/schema/aop";
>> >         xmlns:tx="http://www.springframework.org/schema/tx";
>> >         xmlns:context="http://www.springframework.org/schema/context";
>> >         xsi:schemaLocation="
>> >         http://www.springframework.org/schema/beans
>> > http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>> >         http://www.springframework.org/schema/tx
>> > http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
>> >         http://www.springframework.org/schema/aop
>> > http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
>> >         http://www.springframework.org/schema/context
>> > http://www.springframework.org/schema/context/spring-context-2.5.xsd";>
>> >
>> >     <bean id="jpaVendorAdapter"
>> > class="org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter">
>> >         <property name="databasePlatform"
>> > value="org.eclipse.persistence.platform.database.MySQLPlatform" />
>> >         <property name="generateDdl" value="true" />
>> >         <property name="showSql" value="true" />
>> >         <property name="database" value="MYSQL" />
>> >     </bean>
>> >
>> >     <bean id="entityManagerFactory"
>> >
>> class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
>> >         <property name="jpaVendorAdapter" ref="jpaVendorAdapter" />
>> >         <property name="persistenceXmlLocation"
>> > value="WEB-INF/spring/persistence.xml" />
>> >         <property name="persistenceUnitName" value="ibslogic" />
>> >     </bean>
>> >
>> >     <context:load-time-weaver />
>> >
>> >        <bean id="providerManager"
>> > class="dk.logiksyndikatet.ibslogic.manager.ProviderManager">
>> >         <property name="entityManagerFactory"
>> ref="entityManagerFactory"
>> />
>> >     </bean>
>> > </beans>
>> >
>> > web.xml:
>> > <?xml version="1.0" encoding="UTF-8"?>
>> > <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>> >     xmlns="http://java.sun.com/xml/ns/javaee";
>> > xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_4.xsd";
>> >     xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
>> > http://java.sun.com/xml/ns/javaee/web-app_2_4.xsd";
>> >     id="NewHairID" version="2.4">
>> >
>> >     <taglib>
>> >         <taglib-uri>http://java.sun.com/jstl/fmt</taglib-uri>
>> >        
>> <taglib-location>/WEB-INF/classes/tlds/fmt.tld</taglib-location>
>> >     </taglib>
>> >
>> >     <taglib>
>> >         <taglib-uri>http://java.sun.com/jstl/fmt-rt</taglib-uri>
>> >
>> <taglib-location>/WEB-INF/classes/tlds/fmt-rt.tld</taglib-location>
>> >     </taglib>
>> >
>> >     <taglib>
>> >         <taglib-uri>http://java.sun.com/jstl/core</taglib-uri>
>> >         <taglib-location>/WEB-INF/classes/tlds/c.tld</taglib-location>
>> >     </taglib>
>> >
>> >     <taglib>
>> >         <taglib-uri>http://java.sun.com/jstl/core-rt</taglib-uri>
>> >        
>> <taglib-location>/WEB-INF/classes/tlds/c-rt.tld</taglib-location>
>> >     </taglib>
>> >
>> >     <taglib>
>> >         <taglib-uri>http://java.sun.com/jstl/sql</taglib-uri>
>> >        
>> <taglib-location>/WEB-INF/classes/tlds/sql.tld</taglib-location>
>> >     </taglib>
>> >
>> >     <taglib>
>> >         <taglib-uri>http://java.sun.com/jstl/sql-rt</taglib-uri>
>> >
>> <taglib-location>/WEB-INF/classes/tlds/sql-rt.tld</taglib-location>
>> >     </taglib>
>> >
>> >     <taglib>
>> >         <taglib-uri>http://java.sun.com/jstl/x</taglib-uri>
>> >         <taglib-location>/WEB-INF/classes/tlds/x.tld</taglib-location>
>> >     </taglib>
>> >
>> >     <taglib>
>> >         <taglib-uri>http://java.sun.com/jstl/x-rt</taglib-uri>
>> >        
>> <taglib-location>/WEB-INF/classes/tlds/x-rt.tld</taglib-location>
>> >     </taglib>
>> >
>> >     <display-name>newhair</display-name>
>> >
>> >     <filter>
>> >         <display-name>Stripes Filter</display-name>
>> >         <filter-name>StripesFilter</filter-name>
>> >
>> >
>> <filter-class>net.sourceforge.stripes.controller.StripesFilter</filter-class>
>> >
>> >         <init-param>
>> >             <param-name>Configuration.Class</param-name>
>> >
>> >
>> <param-value>net.sourceforge.stripes.config.RuntimeConfiguration</param-value>
>> >         </init-param>
>> >
>> >         <init-param>
>> >             <param-name>ActionResolver.Packages</param-name>
>> >
>> > <param-value>dk.logiksyndikatet.applications.newhair</param-value>
>> >         </init-param>
>> >
>> >         <init-param>
>> >             <param-name>ActionBeanContext.Class</param-name>
>> >
>> >
>> <param-value>dk.logiksyndikatet.common.stripes.ActionBeanContextNewHair</param-value>
>> >         </init-param>
>> >
>> >         <init-param>
>> >             <param-name>LocalePicker.Locales</param-name>
>> >             <param-value>da_DK:UTF-8</param-value>
>> >         </init-param>
>> >
>> >         <init-param>
>> >             <param-name>Interceptor.Classes</param-name>
>> >
>> >
>> <param-value>net.sourceforge.stripes.integration.spring.SpringInterceptor,
>> > dk.logiksyndikatet.common.stripes.SecurityInterceptor</param-value>
>> >         </init-param>
>> >
>> >     </filter>
>> >
>> >     <filter-mapping>
>> >         <filter-name>StripesFilter</filter-name>
>> >         <url-pattern>*.jsp</url-pattern>
>> >         <dispatcher>REQUEST</dispatcher>
>> >     </filter-mapping>
>> >
>> >     <filter-mapping>
>> >         <filter-name>StripesFilter</filter-name>
>> >         <servlet-name>StripesDispatcher</servlet-name>
>> >         <dispatcher>REQUEST</dispatcher>
>> >     </filter-mapping>
>> >
>> >     <servlet>
>> >         <servlet-name>StripesDispatcher</servlet-name>
>> >
>> >
>> <servlet-class>net.sourceforge.stripes.controller.DispatcherServlet</servlet-class>
>> >         <load-on-startup>1</load-on-startup>
>> >     </servlet>
>> >
>> >     <servlet-mapping>
>> >         <servlet-name>StripesDispatcher</servlet-name>
>> >         <url-pattern>*.htm</url-pattern>
>> >     </servlet-mapping>
>> >
>> >     <env-entry>
>> >         <description>IBS provider id</description>
>> >         <env-entry-name>bean/provider-id</env-entry-name>
>> >         <env-entry-type>java.lang.String</env-entry-type>
>> >         <env-entry-value>1</env-entry-value>
>> >     </env-entry>
>> >
>> >     <listener>
>> >
>> >
>> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
>> >     </listener>
>> >
>> >     <context-param>
>> >         <param-name>contextConfigLocation</param-name>
>> >         <param-value>/WEB-INF/spring/spring-context.xml</param-value>
>> >     </context-param>
>> > </web-app>
>> >
>> >
>> > IndexActionBean.java:
>> > ...
>> > public class IndexActionBean implements ActionBean {
>> >     private ActionBeanContextNewHair context;
>> >
>> >     @SpringBean
>> >     protected ProviderManager providerManager;
>> >
>> >     public ActionBeanContextNewHair getContext() {
>> >         return context;
>> >     }
>> >
>> >     public void setContext(ActionBeanContext context) {
>> >         this.context = (ActionBeanContextNewHair) context;
>> >     }
>> >
>> >     @DefaultHandler
>> >     public Resolution defaultHandler() {
>> >         return new ForwardResolution("/WEB-INF/index.jsp");
>> >     }
>> > ...
>> > }
>> >
>> >
> 
> 


-----
---
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland 
http://www.eclipse.org/eclipselink/
 EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
TopLink 
Wiki:  http://wiki.eclipse.org/EclipseLink EclipseLink , 
http://wiki.oracle.com/page/TopLink TopLink 
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , 
http://www.nabble.com/EclipseLink-f26430.html EclipseLink 
Book:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence 
-- 
View this message in context: http://www.nabble.com/Spring-%2B-Stripes-%2B-Eclipselink---Problems-with-EntityManager-and-or-injection-tp22077463p22078832.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top