Announcement Announcement Module
Collapse
No announcement yet.
Unknow entity type problem (Spring 3, Eclipselink 2) Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Unknow entity type problem (Spring 3, Eclipselink 2)

    Hello everyone,

    I'm trying to implement a web application using

    Spring 3.0.2, <- Dependence Injection
    Struts 2.1.8.1, <- Web framework
    EclipseLink 2.0.2, <- JPA 2.0
    lombok 0.9.2 <- @Data, @Getter, @Setter, etc.
    Tomcat 6.0.26

    eclipse as IDE

    when i try to persist the entity, i get such exception
    (full log in attachement)
    Code:
    java.lang.IllegalArgumentException: Object: mybase.entity.LoginUser@486cdd is not a known entity type.
    	at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.registerNewObjectForPersist(UnitOfWorkImpl.java:4184)
    	at org.eclipse.persistence.internal.jpa.EntityManagerImpl.persist(EntityManagerImpl.java:368)
    	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 org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:240)
    	at $Proxy10.persist(Unknown Source)
    	at mybase.persistence.LoginUserDao.persist(LoginUserDao.java:22)
    	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 org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
    	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
    	at $Proxy15.persist(Unknown Source)
    	at mybase.action.Start.execute(Start.java:52)
    	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.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.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.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.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
    	at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)

    here is my persistence.xml
    HTML Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <persistence version="2.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_2_0.xsd">
    	<persistence-unit name="OWSS-WEB-JPA">
    		<class>mybase.entity.LoginUser</class>
    
    		<properties>
    			<property name="eclipselink.logging.level" value="FINEST" />
    			<property name="eclipselink.logging.timestamp" value="false" />
    			<property name="eclipselink.logging.session" value="true" />
    			<property name="eclipselink.logging.thread" value="false" />
    		</properties>
    	</persistence-unit>
    </persistence>
    current jars:
    com.springsource.javax.transaction-1.1.0.jar
    com.springsource.net.sf.cglib-2.2.0.jar
    com.springsource.org.aopalliance-1.0.0.jar
    commons-fileupload-1.2.1.jar
    commons-io-1.3.2.jar
    commons-logging-1.0.4.jar
    commons-logging-api-1.1.jar
    eclipselink-jpa-modelgen_2.0.2.v20100323-r6872.jar
    eclipselink.jar
    freemarker-2.3.15.jar
    javax.persistence_2.0.0.v201002051058.jar
    log4j-1.2.15.jar
    lombok.jar
    mysql-connector-java-5.1.12-bin.jar
    ognl-2.7.3.jar
    org.springframework.aop-3.0.2.RELEASE.jar
    org.springframework.asm-3.0.2.RELEASE.jar
    org.springframework.aspects-3.0.2.RELEASE.jar
    org.springframework.beans-3.0.2.RELEASE.jar
    org.springframework.context-3.0.2.RELEASE.jar
    org.springframework.context.support-3.0.2.RELEASE.jar
    org.springframework.core-3.0.2.RELEASE.jar
    org.springframework.expression-3.0.2.RELEASE.jar
    org.springframework.instrument-3.0.2.RELEASE.jar
    org.springframework.instrument.tomcat-3.0.2.RELEASE.jar
    org.springframework.jdbc-3.0.2.RELEASE.jar
    org.springframework.jms-3.0.2.RELEASE.jar
    org.springframework.orm-3.0.2.RELEASE.jar
    org.springframework.oxm-3.0.2.RELEASE.jar
    org.springframework.test-3.0.2.RELEASE.jar
    org.springframework.transaction-3.0.2.RELEASE.jar
    org.springframework.web-3.0.2.RELEASE.jar
    org.springframework.web.portlet-3.0.2.RELEASE.jar
    org.springframework.web.servlet-3.0.2.RELEASE.jar
    org.springframework.web.struts-3.0.2.RELEASE.jar
    slf4j-api-1.5.11.jar
    slf4j-log4j12-1.5.11.jar
    struts2-core-2.1.8.1.jar
    struts2-spring-plugin-2.1.8.1.jar
    xwork-core-2.1.6.jar
    for further information (context.xml, some classes(entity, dao)) see attachement

    Thanks in advance

  • #2
    I could resolve the described problem this way
    http://static.springsource.org/sprin...a-setup-lcemfb.

    Comment

    Working...
    X