Joaquin,

Looks like JPA is having trouble finding a class named "Inventory" 
either b/c of something that has to do with JPA or isn't compiled.

Caused by: java.lang.ClassNotFoundException: Inventory


Here are some ideas:

1) If you explicitly specify class names in persistence.xml then make 
sure its there.  Simple enough I know - but ya never know... :-)

2) Also I found that I could not have 2 classes with the same class name 
even if the package structure was different for the 2 classes - JPA 
would complain that it would not be able to find one of the 2 classes 
i.e. make sure you don't have:

some.package.name.Inventory
some.other.package.name.Inventory

3) Some times a deployment might get out of sync and classes might not 
end up where they need to go.  IF you are using Eclipse what I some 
times end up doing that pretty much makes sure everything gets on the 
same page is:

a) Remove the deployment (if any)
b) Do a "clean" on the project (i.e. remove all class files)
c) Rebuild the project (typically in Eclipse most people will have that 
setup to automatic... but just in case its manual)

Of course you can do a similar thing in your IDE of choice... .

HTH,

--Nikolaos




Joaquin Valdez wrote:
> Hello!
>
> I am having trouble with my app.  It's not longer finding one of my model 
> classes.  I am using a structure similar to the Stripes book.  Any how, when 
> I run my app, I get the following error:
>
> javax.persistence.PersistenceException: [PersistenceUnit: loginPU] Unable to 
> configure EntityManagerFactory
>        at 
> org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:265)
>        at 
> org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:125)
>        at 
> javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:51)
>        at 
> javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:33)
>        at org.stripesstuff.stripersist.Stripersist.init(Stripersist.java:167)
>        at org.stripesstuff.stripersist.Stripersist.init(Stripersist.java:117)
>        at 
> net.sourceforge.stripes.config.DefaultConfiguration.addInterceptor(DefaultConfiguration.java:470)
>        at 
> net.sourceforge.stripes.config.RuntimeConfiguration.initInterceptors(RuntimeConfiguration.java:233)
>        at 
> net.sourceforge.stripes.config.RuntimeConfiguration.initInterceptors(RuntimeConfiguration.java:214)
>        at 
> net.sourceforge.stripes.config.DefaultConfiguration.init(DefaultConfiguration.java:204)
>        at 
> net.sourceforge.stripes.config.RuntimeConfiguration.init(RuntimeConfiguration.java:291)
>        at 
> net.sourceforge.stripes.controller.StripesFilter.init(StripesFilter.java:125)
>        at 
> org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
>        at 
> org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
>        at 
> org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
>        at 
> org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3709)
>        at 
> org.apache.catalina.core.StandardContext.start(StandardContext.java:4356)
>        at 
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
>        at 
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
>        at 
> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
>        at 
> org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:626)
>        at 
> org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:511)
>        at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1229)
>        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.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
>        at 
> com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
>        at 
> com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:761)
>        at 
> org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1465)
>        at 
> org.apache.catalina.manager.ManagerServlet.deploy(ManagerServlet.java:821)
>        at 
> org.apache.catalina.manager.ManagerServlet.doGet(ManagerServlet.java:349)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>        at 
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>        at 
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>        at 
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
>        at 
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
>        at 
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
>        at 
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>        at 
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>        at 
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>        at 
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
>        at 
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
>        at 
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>        at 
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
>        at java.lang.Thread.run(Thread.java:637)
> Caused by: java.lang.TypeNotPresentException: Type Inventory not present
>        at 
> sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:98)
>        at 
> sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:107)
>        at 
> sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:31)
>        at 
> sun.reflect.generics.visitor.Reifier.reifyTypeArguments(Reifier.java:50)
>        at 
> sun.reflect.generics.visitor.Reifier.visitClassTypeSignature(Reifier.java:120)
>        at 
> sun.reflect.generics.tree.ClassTypeSignature.accept(ClassTypeSignature.java:31)
>        at 
> sun.reflect.generics.repository.MethodRepository.getReturnType(MethodRepository.java:50)
>        at java.lang.reflect.Method.getGenericReturnType(Method.java:236)
>        at 
> org.hibernate.annotations.common.reflection.java.JavaXClass.getDeclaredMethodProperties(JavaXClass.java:90)
>        at 
> org.hibernate.annotations.common.reflection.java.JavaXClass.getDeclaredProperties(JavaXClass.java:106)
>        at 
> org.hibernate.annotations.common.reflection.java.JavaXClass.getDeclaredProperties(JavaXClass.java:98)
>        at 
> org.hibernate.cfg.AnnotationBinder.addElementsOfAClass(AnnotationBinder.java:1023)
>        at 
> org.hibernate.cfg.AnnotationBinder.getElementsToProcess(AnnotationBinder.java:859)
>        at 
> org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:666)
>        at 
> org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:534)
>        at 
> org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:286)
>        at 
> org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1115)
>        at 
> org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1225)
>        at 
> org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:159)
>        at 
> org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:854)
>        at 
> org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:191)
>        at 
> org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:253)
>        ... 47 more
> Caused by: java.lang.ClassNotFoundException: Inventory
>        at 
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1360)
>        at 
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1206)
>        at java.lang.Class.forName0(Native Method)
>        at java.lang.Class.forName(Class.java:247)
>        at 
> sun.reflect.generics.factory.CoreReflectionFactory.makeNamedType(CoreReflectionFactory.java:95)
>        ... 68 more
>
> Seems like something silly, but I can't figure it out.
>
> Thanks!
>
> Joaquin Valdez
> joaqu...@mind.net
>
>
>
>
>
> ------------------------------------------------------------------------------
> Start uncovering the many advantages of virtual appliances
> and start using them to simplify application deployment and
> accelerate your shift to cloud computing
> http://p.sf.net/sfu/novell-sfdev2dev
> _______________________________________________
> Stripes-users mailing list
> Stripes-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/stripes-users
>
>   


------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to