Somehow Toplink seems to think that you have PROPERTY based access to
entity and trying to get setMethod for one of the attributes which might
not exist and hence NPE. Try explicitly defining the access as FIELD in
your orm.xml
glassfish_at_javadesktop.org wrote:
> It doesn't look like the problem is that bug, because I've changed the persistence.xml to use a user with a password:
>
> [code]
> <?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="pfc" transaction-type="RESOURCE_LOCAL">
> <provider>oracle.toplink.essentials.PersistenceProvider</provider>
> <mapping-file>pfc/model/orm.xml</mapping-file>
> <properties>
> <property name="toplink.jdbc.driver" value="com.mysql.jdbc.Driver"/>
> <property name="toplink.jdbc.url" value="jdbc:mysql://localhost/pfc"/>
> <property name="toplink.jdbc.password" value="febrer"/>
> <property name="toplink.jdbc.user" value="usuariPFC"/>
> </properties>
> </persistence-unit>
> </persistence>
> [/code]
>
> and the exception remains the same:
>
> [code]
> org.springframework.web.util.NestedServletException: Request processing failed; nested exception is javax.persistence.PersistenceException: No Persistence provider for EntityManager named pfc: Provider named oracle.toplink.essentials.PersistenceProvider threw unexpected exception at create EntityManagerFactory:
> oracle.toplink.essentials.exceptions.PersistenceUnitLoadingException
> Local Exception Stack:
> Exception [TOPLINK-30005] (Oracle TopLink Essentials - 2.0 (Build b58g-fcs (09/07/2007))): oracle.toplink.essentials.exceptions.PersistenceUnitLoadingException
> Exception Description: An exception was thrown while searching for persistence archives with ClassLoader: WebappClassLoader
> delegate: false
> repositories:
> /WEB-INF/classes/
> ----------> Parent Classloader:
> org.apache.catalina.loader.StandardClassLoader_at_d1e604
>
> Internal Exception: javax.persistence.PersistenceException: Exception [TOPLINK-28018] (Oracle TopLink Essentials - 2.0 (Build b58g-fcs (09/07/2007))): oracle.toplink.essentials.exceptions.EntityManagerSetupException
> Exception Description: predeploy for PersistenceUnit [pfc] failed.
> Internal Exception: java.lang.NullPointerException
> at oracle.toplink.essentials.exceptions.PersistenceUnitLoadingException.exceptionSearchingForPersistenceResources(PersistenceUnitLoadingException.java:143)
> at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createEntityManagerFactory(EntityManagerFactoryProvider.java:169)
> at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:110)
> at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:83)
> at pfc.model.DAOFactory.connectarBD(DAOFactory.java:15)
> at pfc.model.FaƧanaDelModel.obtenirDadesIncidencia(FaƧanaDelModel.java:33)
> at pfc.IncidenciaController.handleRequest(IncidenciaController.java:18)
> at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
> at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:874)
> at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:808)
> at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476)
> at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:431)
> 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.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> 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.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:263)
> at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
> at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
> at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
> at java.lang.Thread.run(Thread.java:619)
> Caused by: javax.persistence.PersistenceException: Exception [TOPLINK-28018] (Oracle TopLink Essentials - 2.0 (Build b58g-fcs (09/07/2007))): oracle.toplink.essentials.exceptions.EntityManagerSetupException
> Exception Description: predeploy for PersistenceUnit [pfc] failed.
> Internal Exception: java.lang.NullPointerException
> at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:643)
> at oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.callPredeploy(JavaSECMPInitializer.java:171)
> at oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.initPersistenceUnits(JavaSECMPInitializer.java:239)
> at oracle.toplink.essentials.internal.ejb.cmp3.JavaSECMPInitializer.initialize(JavaSECMPInitializer.java:255)
> at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createEntityManagerFactory(EntityManagerFactoryProvider.java:155)
> ... 27 more
> Caused by: Exception [TOPLINK-28018] (Oracle TopLink Essentials - 2.0 (Build b58g-fcs (09/07/2007))): oracle.toplink.essentials.exceptions.EntityManagerSetupException
> Exception Description: predeploy for PersistenceUnit [pfc] failed.
> Internal Exception: java.lang.NullPointerException
> at oracle.toplink.essentials.exceptions.EntityManagerSetupException.predeployFailed(EntityManagerSetupException.java:228)
> ... 32 more
> Caused by: java.lang.NullPointerException
> at oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.objects.MetadataMethod.getSetMethodName(MetadataMethod.java:69)
> at oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.MetadataAccessor.getSetMethodName(MetadataAccessor.java:330)
> at oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.MetadataAccessor.setAccessorMethods(MetadataAccessor.java:575)
> at oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.BasicAccessor.processDirectToFieldMapping(BasicAccessor.java:182)
> at oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.BasicAccessor.process(BasicAccessor.java:160)
> at oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.ClassAccessor.processAccessor(ClassAccessor.java:528)
> at oracle.toplink.essentials.internal.ejb.cmp3.xml.accessors.XMLClassAccessor.processAccessors(XMLClassAccessor.java:371)
> at oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors.ClassAccessor.process(ClassAccessor.java:498)
> at oracle.toplink.essentials.internal.ejb.cmp3.xml.accessors.XMLClassAccessor.process(XMLClassAccessor.java:322)
> at oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataProcessor.processMappingFile(MetadataProcessor.java:568)
> at oracle.toplink.essentials.internal.ejb.cmp3.metadata.MetadataProcessor.processMappingFiles(MetadataProcessor.java:533)
> at oracle.toplink.essentials.ejb.cmp3.persistence.PersistenceUnitProcessor.processORMetadata(PersistenceUnitProcessor.java:368)
> at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.predeploy(EntityManagerSetupImpl.java:607)
> ... 31 more
>
>
> The following providers:
> oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider
> Returned null to createEntityManagerFactory.
>
> org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:488)
> org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:431)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
>
> [/code]
> [Message sent by forum member 'asdfawer' (asdfawer)]
>
> http://forums.java.net/jive/thread.jspa?messageID=285647
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>