Can you post some more context? I'm specifically interested in seeing how
you're building your oggetto object (assuming it's of class Log) and how
you're getting a reference to your entityManagerSession.

Also, since you're using JPA, you shouldn't be calling flush outside of a
transaction.

- Jason

On Fri, Aug 28, 2009 at 2:56 AM, infrarosso <[email protected]> wrote:

>
> Hi,
>
>  I have a web application on GAE with JPA persistence and one entity
> enhanced with datanucleos tool
>
> This entity compiled and jar in extra library was on WEB-INF/lib of my
> web application
>
> when I try to persist my Object like this code ...
>
> try
>                {
>                        entityManagerSession.persist(oggetto);
>                        entityManagerSession.flush();
>                }
>                catch (Throwable e)
>                {
>                        throw new PersistenceException(e);
>                }
>                finally
>                {
>
>                }
>
>
> I get this error (only on GAE enviroment, because on my local
> development IDE work ok)...
>
>
>
>
> java.lang.IllegalArgumentException: Type ("it.irex.stats.beans.Log")
> is not that of an entity but needs to be for this operation >
>  it.irex.stats.StatsHandlerGaeImpl.logStats(StatsHandlerGaeImpl.java:
> 41) >
>  sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >
>  sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) >
>  sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) >
>  java.lang.reflect.Method.invoke(Unknown Source) >
>
>
> com.google.apphosting.runtime.security.shared.intercept.java.lang.reflect.Method_
> $3.run(Method_.java:149) >
>  java.security.AccessController.doPrivileged(Native Method) >
>
>
> com.google.apphosting.runtime.security.shared.intercept.java.lang.reflect.Method_.privilegedInvoke
> (Method_.java:147) >
>
>
> com.google.apphosting.runtime.security.shared.intercept.java.lang.reflect.Method_.invoke
> (Method_.java:120) >
>
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection
> (AopUtils.java:307) >
>  ....
>
>
>
> My entity bean is this:
>
>
> import java.io.Serializable;
> import java.util.Date;
>
> import javax.persistence.Entity;
> import javax.persistence.GeneratedValue;
> import javax.persistence.GenerationType;
> import javax.persistence.Id;
>
> @Entity
> public class Log implements Serializable {
>
>        /**
>         *   Entity bean JPA for persistence of log bean
>         */
>        private static final long serialVersionUID = 5776764707008905528L;
>
>        @Id
>    @GeneratedValue(strategy = GenerationType.IDENTITY)
>    private Long logId;
>
>
>
>        /**
>         * url view (URI)
>         */
>        private String uriView;
>
>        /**
>         *  query string view
>         */
>        private String urlParamView;
>
>
>
>
>        public Long getLogId() {
>                return logId;
>        }
>
>        public void setLogId(Long logId) {
>                this.logId = logId;
>        }
>
>
>        public String getUriView() {
>                return uriView;
>        }
>
>        public void setUriView(String uriView) {
>                this.uriView = uriView;
>        }
>
>        public String getUrlParamView() {
>                return urlParamView;
>        }
>
>        public void setUrlParamView(String urlParamView) {
>                this.urlParamView = urlParamView;
>        }
>
>
>
>
> }
>
>
> Why I get "is not that of an entity but needs to be for this
> operation" ?
>
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to