Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Re: No EntityFactory in Eclipse
Re: No EntityFactory in Eclipse [message #210276] Wed, 12 March 2008 08:55 Go to next message
Eclipse User
Originally posted by: merks.ca.ibm.com

Dom,

This sounds like a question for the WTP newsgroup, so I've added that to
the to list of my reply.

Is something supposed to automagically initialize "factory" or is that
not what's null? (A stack trace is always good.)


dadom wrote:
> Hi...
>
> I have a little WebProject developes with Eclipse Europe (3.3.1.1) and
> a GlassFish v.2 (9.1_01). Because of some problems after the deploy
> with Eclipse I teste my Project with another IDE. Installed NetBeans
> 6, copied all my ProjectFiles, i left out only the persistence.xml and
> let NetBeans generate it for me.
> 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="DReminderPU" transaction-type="JTA">
> <provider>oracle.toplink.essentials.PersistenceProvider</provider >
> <jta-data-source>jdbc/dreminder</jta-data-source>
> <properties>
> <property name="toplink.ddl-generation" value="create-tables"/>
> </properties>
> </persistence-unit>
> </persistence>
> ***
>
> for this case i create a new connection pool for my server (worked
> fine) and try to get the EntityManagerFactory
>
> @PersistenceUnit
> private EntityManagerFactory factory;
>
> The PROBLEM. After the deploy with NetBeans, all work fine (even after
> a redploy). But when i deploy it with Eclipse (same SourceCode, same
> Config-XMLs!, same Server) i get a null-pointer exception when i try
> to get my EntityManager: EntityManager em =
> factory.createEntityManager();
> Its confusing me :( Pls help...
>
> thx
> Dom
>
Re: No EntityFactory in Eclipse [message #210285 is a reply to message #210276] Wed, 12 March 2008 10:36 Go to previous messageGo to next message
Eclipse User
Originally posted by: dadom110.NoMailThx.com

Hi...

the StackTrace is:
javax.persistence.PersistenceException: No Persistence provider for
EntityManager named default: The following providers:
oracle.toplink.essentials.PersistenceProvider
oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvi der
Returned null to createEntityManagerFactory.

at
javax.persistence.Persistence.createEntityManagerFactory(Per sistence.java:154)
at
javax.persistence.Persistence.createEntityManagerFactory(Per sistence.java:83)
at dd.servlets.DataManager.service(DataManager.java:46)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at
org.apache.catalina.core.ApplicationFilterChain.servletServi ce(ApplicationFilterChain.java:411)
at
org.apache.catalina.core.StandardWrapperValve.invoke(Standar dWrapperValve.java:290)
at
org.apache.catalina.core.StandardContextValve.invokeInternal (StandardContextValve.java:271)
at
org.apache.catalina.core.StandardContextValve.invoke(Standar dContextValve.java:202)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardP ipeline.java:632)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardP ipeline.java:577)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:9 4)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHo stValve.java:206)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardP ipeline.java:632)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardP ipeline.java:577)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPip eline.java:571)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase. java:1080)
at
org.apache.catalina.core.StandardEngineValve.invoke(Standard EngineValve.java:150)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardP ipeline.java:632)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardP ipeline.java:577)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPip eline.java:571)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase. java:1080)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapte r.java:272)
at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTas k.invokeAdapter(DefaultProcessorTask.java:637)
at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTas k.doProcess(DefaultProcessorTask.java:568)
at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTas k.process(DefaultProcessorTask.java:813)
at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.exe cuteProcessorTask(DefaultReadTask.java:341)
at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doT ask(DefaultReadTask.java:263)
at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doT ask(DefaultReadTask.java:214)
at
com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTa sk.doTask(PortUnificationPipeline.java:380)
at
com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBa se.java:265)
at
com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread .run(SSLWorkerThread.java:106)
|#]

i got no PersistenceFactory, i think it should be get an instance
automatically from the (?) Server Runtime? so i just have

@PersistenceUnit
private EntityManagerFactory factory;

in my code and that should be enough, bacause NetBeans runs with it fine :(
Re: No EntityFactory in Eclipse [message #210301 is a reply to message #210285] Wed, 12 March 2008 11:12 Go to previous messageGo to next message
Eclipse User
Originally posted by: dadom110.noReply.de

...have the first mistake...i really don't know where eclipse has stored
the Persistence-Unit name "default", but if i change it in
persistence.xml, he get the Factory i thing. But now i have my old
Problem: "missing deployment descriptor" (only with eclipse)

Exception:
[#|2008-03-12T16:12:27.954+0100|SEVERE|sun-appserver9.1|java x.enterprise.system.container.web|_ThreadID=17;_ThreadName=h ttpSSLWorkerThread-8080-0;_RequestID=6547fbd4-c661-4d2a-960d -e9cd78ab290d;|StandardWrapperValve[data]:
PWC1406: Servlet.service() for servlet data threw exception
Local Exception Stack:
Exception [TOPLINK-6007] (Oracle TopLink Essentials - 2.0.1 (Build
b09d-fcs (12/06/2007))):
oracle.toplink.essentials.exceptions.QueryException
Exception Description: Missing descriptor for [class
dd.entities.Dreminder].
Query: ReadAllQuery(dd.entities.Dreminder)
at
oracle.toplink.essentials.exceptions.QueryException.descript orIsMissing(QueryException.java:419)
at
oracle.toplink.essentials.queryframework.ObjectLevelReadQuer y.checkDescriptor(ObjectLevelReadQuery.java:412)
at
oracle.toplink.essentials.queryframework.ObjectLevelReadQuer y.checkPrePrepare(ObjectLevelReadQuery.java:494)
at
oracle.toplink.essentials.queryframework.ObjectLevelReadQuer y.checkEarlyReturn(ObjectLevelReadQuery.java:433)
at
oracle.toplink.essentials.queryframework.DatabaseQuery.execu te(DatabaseQuery.java:575)
at
oracle.toplink.essentials.queryframework.ObjectLevelReadQuer y.execute(ObjectLevelReadQuery.java:692)
at
oracle.toplink.essentials.queryframework.ObjectLevelReadQuer y.executeInUnitOfWork(ObjectLevelReadQuery.java:746)
at
oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.i nternalExecuteQuery(UnitOfWorkImpl.java:2233)
at
oracle.toplink.essentials.internal.sessions.AbstractSession. executeQuery(AbstractSession.java:952)
at
oracle.toplink.essentials.internal.sessions.AbstractSession. executeQuery(AbstractSession.java:924)
at
oracle.toplink.essentials.internal.ejb.cmp3.base.EJBQueryImp l.executeReadQuery(EJBQueryImpl.java:367)
at
oracle.toplink.essentials.internal.ejb.cmp3.base.EJBQueryImp l.getResultList(EJBQueryImpl.java:478)
at dd.servlets.DataManager.getData(DataManager.java:107)
at dd.servlets.DataManager.service(DataManager.java:87)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
at
org.apache.catalina.core.ApplicationFilterChain.servletServi ce(ApplicationFilterChain.java:411)
at
org.apache.catalina.core.StandardWrapperValve.invoke(Standar dWrapperValve.java:290)
at
org.apache.catalina.core.StandardContextValve.invokeInternal (StandardContextValve.java:271)
at
org.apache.catalina.core.StandardContextValve.invoke(Standar dContextValve.java:202)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardP ipeline.java:632)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardP ipeline.java:577)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:9 4)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHo stValve.java:206)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardP ipeline.java:632)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardP ipeline.java:577)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPip eline.java:571)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase. java:1080)
at
org.apache.catalina.core.StandardEngineValve.invoke(Standard EngineValve.java:150)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardP ipeline.java:632)
at
org.apache.catalina.core.StandardPipeline.doInvoke(StandardP ipeline.java:577)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPip eline.java:571)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase. java:1080)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapte r.java:272)
at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTas k.invokeAdapter(DefaultProcessorTask.java:637)
at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTas k.doProcess(DefaultProcessorTask.java:568)
at
com.sun.enterprise.web.connector.grizzly.DefaultProcessorTas k.process(DefaultProcessorTask.java:813)
at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.exe cuteProcessorTask(DefaultReadTask.java:341)
at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doT ask(DefaultReadTask.java:263)
at
com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doT ask(DefaultReadTask.java:214)
at
com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTa sk.doTask(PortUnificationPipeline.java:380)
at
com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBa se.java:265)
at
com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread .run(SSLWorkerThread.java:106)
|#]
Re: No EntityFactory in Eclipse [message #210309 is a reply to message #210285] Wed, 12 March 2008 11:18 Go to previous messageGo to next message
Eclipse User
Originally posted by: dadom110.xxx.de

additional here my Entity...

@Entity
@Table(name="dreminder")
public class Dreminder implements Serializable {

@Id
@GeneratedValue
private int id;
....
..
..
..

i added the class additional even in my persistence.xml, but no deployment
descriptor :(
Re: No EntityFactory in Eclipse [message #210722 is a reply to message #210309] Fri, 21 March 2008 16:57 Go to previous message
David Williams is currently offline David Williams
Messages: 690
Registered: July 2009
Senior Member
On Wed, 12 Mar 2008 11:18:14 -0400, dadom <dadom110@xxx.de> wrote:

>
> i added the class additional even in my persistence.xml, but no deployment
> descriptor :(
>
>

Let's start with the basics ... which is about as far as I can go :)
but do you have WTP (with JPT tools) installed?
Almost sounds like maybe you have only Eclipse and EclipseLink?
Previous Topic:Eclipse 3.2: doesn't build war and deploy to jboss anymore
Next Topic:Sysdeo plugin: how to control which directories to pack up as .war file?
Goto Forum:
  


Current Time: Wed Apr 16 23:52:40 EDT 2014

Powered by FUDForum. Page generated in 0.03882 seconds