Hi Jon,
i try it , but it not work, i have the same error;
i use mysql as database:
i add this on
<Resource id="movieDatabase" type="DataSource">
JdbcDriver com.mysql.jdbc.Driver
JdbcUrl jdbc:mysql://localhost:3306/test2?user=max&password=max
UserName max
Password max
JtaManaged true
</Resource>
on openejb.xml on config directory of tomcat,
and i create
CREATE TABLE `test2`.`openjpa_sequence_table` (
`ID` tinyint(4) NOT NULL,
`SEQUENCE_VALUE` bigint(20) default NULL,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
to use jpa on mysql;
the same code works fine on standalone server on port 4201.
i think there is a difference , but i don't known where...
javax.naming.NamingException: Unknown error in container [Root exception is
<openjpa-1.1.0-r422266:659716 nonfatal user error>
org.apache.openjpa.persistence.InvalidStateException: The factory has been
closed. The stack trace at which the factory was closed is held in the
embedded exception.]
at
org.apache.openejb.server.ejbd.JndiRequestHandler.processRequest(JndiRequestHandler.java:131)
at
org.apache.openejb.server.ejbd.EjbDaemon.processJndiRequest(EjbDaemon.java:200)
at org.apache.openejb.server.ejbd.EjbDaemon.service(EjbDaemon.java:153)
thanks a lot
giovacar
Jonathan Gallimore-2 wrote:
>
> Hi there,
>
> I was able to get your code working in a unit test, the standalone server,
> and in Tomcat. The only real change I made was to remove orm.xml and
> change
> the properties in persistence.xml.
>
> Here is the property I set in persistence.xml (I commented all the others
> out):
>
> <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema" />
>
> I've attached my Eclipse project and the resulting jar I deployed in
> Tomcat.
>
> Hope that helps.
>
> Jon
>
>
> On Fri, Mar 20, 2009 at 4:43 PM, giovacar <[email protected]> wrote:
>
>>
>> hi Gurus,
>> try to put as much information as i can :
>> I have
>> apache tomcat 6.0.18
>> openejb 3.1
>> windows xp professional sp3
>>
>> when call this EJB
>> http://www.nabble.com/file/p22623668/EJBentity_and%2Bsource%2Bcode.jar
>> EJBentity_and+source+code.jar
>> with this test , on localhost:4201 work fine,
>>
>> ******* start code
>> private String INITIALEJBentity.jar_FACTORY
>> ="org.apache.openejb.client.RemoteInitialContextFactory";
>>
>> //end point to call remote
>> //private String END_POINT ="localhost:4201";
>> private String END_POINT="http://localhost:8080/openejb/ejb";
>>
>> p = new Properties();
>> p.put("java.naming.factory.initial", INITIAL_FACTORY);
>> p.put("java.naming.provider.url", END_POINT);
>> ctx = new InitialContext( p );
>>
>> ctx = new InitialContext(p);
>>
>> TheMoviesRemote movies = (TheMoviesRemote)
>> ctx.lookup("theMovieRemote");
>>
>> .....
>>
>>
>> ******* end code
>>
>> when i try to call it on tomcat
>> "http://localhost:8080/openejb/ejb
>> (i copy the bean jar on lib directory on
>> apache-tomcat-6.0.18\webapps\openejb\lib)
>> i have an error :
>>
>> the trace for localhost is :
>>
>> http://www.nabble.com/file/p22623668/localhost.trace localhost.trace
>>
>> for tomcat is :
>>
>> http://www.nabble.com/file/p22623668/tomcat.trace tomcat.trace
>>
>> the difference that i see is that jpa is not starting...
>>
>> the error is:
>>
>> javax.naming.NamingException: Unknown error in container [Root exception
>> is
>> <openjpa-1.1.0-r422266:659716 nonfatal user error>
>> org.apache.openjpa.persistence.InvalidStateException: The factory has
>> been
>> closed. The stack trace at which the factory was closed is held in the
>> embedded exception.]
>> at
>>
>> org.apache.openejb.server.ejbd.JndiRequestHandler.processRequest(JndiRequestHandler.java:131)
>> at
>>
>> org.apache.openejb.server.ejbd.EjbDaemon.processJndiRequest(EjbDaemon.java:200)
>> at
>> org.apache.openejb.server.ejbd.EjbDaemon.service(EjbDaemon.java:153)
>> at
>> org.apache.openejb.server.ejbd.EjbServer.service(EjbServer.java:71)
>> at
>>
>> org.apache.openejb.server.httpd.ServerServlet.service(ServerServlet.java:44)
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>> 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:191)
>> at
>>
>> org.apache.openejb.tomcat.catalina.OpenEJBValve.invoke(OpenEJBValve.java:45)
>> at
>>
>> org.apache.catalina.valves.RequestFilterValve.process(RequestFilterValve.java:269)
>> at
>> org.apache.catalina.valves.RemoteAddrValve.invoke(RemoteAddrValve.java:81)
>> 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:845)
>> 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:595)
>> Caused by: <openjpa-1.1.0-r422266:659716 nonfatal user error>
>> org.apache.openjpa.persistence.InvalidStateException: The factory has
>> been
>> closed. The stack trace at which the factory was closed is held in the
>> embedded exception.
>> at
>>
>> org.apache.openjpa.kernel.AbstractBrokerFactory.assertOpen(AbstractBrokerFactory.java:676)
>> at
>>
>> org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:182)
>> at
>>
>> org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:142)
>> at
>>
>> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:192)
>> at
>>
>> org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:56)
>> at
>>
>> org.apache.openejb.core.stateful.StatefulContainer.createEntityManagers(StatefulContainer.java:710)
>> at
>>
>> org.apache.openejb.core.stateful.StatefulContainer.createEJBObject(StatefulContainer.java:283)
>> at
>>
>> org.apache.openejb.core.stateful.StatefulContainer.invoke(StatefulContainer.java:263)
>> at
>>
>> org.apache.openejb.core.ivm.EjbHomeProxyHandler.create(EjbHomeProxyHandler.java:270)
>> at
>>
>> org.apache.openejb.core.ivm.EjbHomeProxyHandler._invoke(EjbHomeProxyHandler.java:161)
>> at
>>
>> org.apache.openejb.core.ivm.BaseEjbProxyHandler.invoke(BaseEjbProxyHandler.java:286)
>> at $Proxy45.create(Unknown Source)
>> at
>>
>> org.apache.openejb.core.ivm.naming.BusinessRemoteReference.getObject(BusinessRemoteReference.java:33)
>> at
>> org.apache.openejb.core.ivm.naming.IvmContext.lookup(IvmContext.java:150)
>> at
>>
>> org.apache.openejb.server.ejbd.JndiRequestHandler.doLookup(JndiRequestHandler.java:189)
>> at
>>
>> org.apache.openejb.server.ejbd.JndiRequestHandler.processRequest(JndiRequestHandler.java:125)
>> ... 20 more
>> Caused by: java.lang.Exception: java.lang.Exception:
>> java.lang.IllegalStateException
>> at
>>
>> org.apache.openjpa.util.Exceptions.replaceNestedThrowables(Exceptions.java:249)
>> at
>>
>> org.apache.openjpa.persistence.InvalidStateException.writeObject(InvalidStateException.java:107)
>> 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:585)
>> at
>> java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:917)
>> at
>> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1339)
>> at
>>
>> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
>> at
>> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
>> at
>> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1375)
>> at
>> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1347)
>> at
>>
>> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1290)
>> at
>> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
>> at
>> java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
>> at
>>
>> org.apache.openejb.client.ThrowableArtifact.writeExternal(ThrowableArtifact.java:49)
>> at
>> java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1310)
>> at
>>
>> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1288)
>> at
>> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1079)
>> at
>> java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:302)
>> at
>> org.apache.openejb.client.JNDIResponse.writeExternal(JNDIResponse.java:131)
>> at
>>
>> org.apache.openejb.server.ejbd.JndiRequestHandler.processRequest(JndiRequestHandler.java:143)
>> ... 20 more
>> --
>> View this message in context:
>> http://www.nabble.com/jpa-not-start-in-tomcat-server-tp22623668p22623668.html
>> Sent from the OpenEJB Dev mailing list archive at Nabble.com.
>>
>>
>
>
>
>
--
View this message in context:
http://www.nabble.com/jpa-not-start-in-tomcat-server-tp22623668p22661074.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.