dev@glassfish.java.net

Re: JPA in embedded GF?

From: Marina Vatkina <Marina.Vatkina_at_Sun.COM>
Date: Mon, 27 Jul 2009 17:00:39 -0700

Jerome Dochez wrote:
> I have fixed both issues, I still see a flashlight related issue that I
> will look at tomorrow but it seems to be functional now.

Only the 1st one. The 2nd (opening ports and failing for an already opened port)
could be caused caused by using the pre-existing domain.xml. There is no such
error if I don't set the pointer(s).

I've checked in my changes to the UnitTest, so that you can see exactly what I'm
doing. To test existing domain.xml, set env variable S1AS_HOME to the existing
GF installation (like for QL in V2).

thanks,
-marina

>
> Earlier today, I also should have added support for JPA but I don't
> have anything to test with. could you or mitesh try it out and add a test.
>
> to turn on the jpa container just do
>
> server.addContainer(ContainerBuillder.Type.jpa);
>
> jerome
>
> On Jul 27, 2009, at 12:05 PM, Marina Vatkina wrote:
>
>> Hi Jerome,
>>
>> I still see both problems. Did you have a chance to look at them?
>>
>> thanks,
>> -marina
>>
>> Marina Vatkina wrote:
>>
>>> Jerome Dochez wrote:
>>>
>>>>
>>>> On Jul 22, 2009, at 6:21 PM, Marina Vatkina wrote:
>>>>
>>>>> Now that you added another test case, I see that I need to call
>>>>> separately setInstallRoot() for GF installation and
>>>>> setConfigurationFile() for domain.xml ;)
>>>>>
>>>>> But(!)
>>>>>
>>>>> 1. The default setup (e.g. EmbeddedTest or UnitTest without my
>>>>> temp changes) fail with NPE in binding and lookup caused by:
>>>>>
>>>>>
>>>>> Caused by: java.lang.RuntimeException: Orb initialization erorr
>>>>> at org .glassfish .enterprise
>>>>> .iiop.api.GlassFishORBHelper.getORB(GlassFishORBHelper.java:128)
>>>>> at com .sun .enterprise
>>>>> .naming.impl.SerialContext.getRemoteProvider(SerialContext.java: 294)
>>>>> at com .sun .enterprise
>>>>> .naming.impl.SerialContext.getProvider(SerialContext.java: 269)
>>>>> ... 28 more
>>>>> Caused by: java.lang.NullPointerException
>>>>> at org .glassfish .enterprise
>>>>> .iiop.api.GlassFishORBHelper.getORB(GlassFishORBHelper.java:98)
>>>>> ... 30 more
>>>>
>>>>
>>>>
>>>> I have no idea what's going on, I will need Ken Saks to look at it.
>>>>
>>>>>
>>>>> 2. If I try to set install root and config file, the ports are
>>>>> beeing open and the server doesn't even get to deployment:
>>>>>
>>>>> INFO: GlassFish v3 startup time : Embedded(2728ms) startup
>>>>> services(3792ms) total(6520ms)
>>>>> Jul 22, 2009 6:08:29 PM
>>>>> com.sun.enterprise.v3.server.AppServerStartup run
>>>>> SEVERE: Shutting down v3 due to startup exception : Address
>>>>> already in use:
>>>>> 8080=com.sun.grizzly.http.SelectorThreadHandler_at_1609c13
>>>>> Jul 22, 2009 6:08:29 PM
>>>>> org.glassfish.admin.mbeanserver.JMXStartupService shutdown
>>>>> INFO: ConnectorStartupService: shutting down AMX and JMX
>>>>> Jul 22, 2009 6:08:29 PM
>>>>> org.glassfish.admin.mbeanserver.JMXStartupService
>>>>> $JMXConnectorsStarterThread shutdown
>>>>> INFO: Stopped JMXConnectorServer: service:jmx:rmi:///jndi/rmi://
>>>>> uphill:8686/jmxrmi
>>>>> Jul 22, 2009 6:08:29 PM AppServerStartup run
>>>>>
>>>>> Note that there is no other gf instance running at that time.
>>>>
>>>>
>>>>
>>>> I have an idea of what might be going on here... did you
>>>> instantiate any embedded Port here ?
>>>
>>> I'm doing this:
>>> Server.Builder builder = new
>>> Server.Builder("GFEJBContainerProviderImpl");
>>> ... creating Files for gf install and domain.xml...
>>> EmbeddedFileSystem.Builder efsb = new EmbeddedFileSystem.Builder();
>>> efsb.setInstallRoot(installed_root);
>>> efsb.setConfigurationFile(domain_file);
>>> builder.setEmbeddedFileSystem(efsb.build());
>>> server = builder.build();
>>> -marina
>>>
>>>>
>>>>>
>>>>> thanks,
>>>>> -marina
>>>>>
>>>>> Jerome Dochez wrote:
>>>>>
>>>>>> look in the tests/embedded/inplanted, there are examples of
>>>>>> using the embedded file system.
>>>>>> jerome
>>>>>> On Jul 21, 2009, at 3:25 PM, Marina Vatkina wrote:
>>>>>>
>>>>>>> What should setEmbeddedFileSystem() be set to? using my GF
>>>>>>> installation (/export/v3/gfs/glassfishv3/glassfish) causes
>>>>>>>
>>>>>>>
>>>>>>> java.io.FileNotFoundException: /export/v3/gfs/glassfishv3/lib/
>>>>>>> install/applications/__ds_jdbc_ra
>>>>>>>
>>>>>>> (see missing "glassfish" after "glassfishv3").
>>>>>>>
>>>>>>> There are also strange NameNotFoundExceptions like "__SYSTEM"
>>>>>>> but this can be a side effect of the original problem.
>>>>>>>
>>>>>>> thanks,
>>>>>>> -marina
>>>>>>>
>>>>>>> Marina Vatkina wrote:
>>>>>>>
>>>>>>>> Jerome Dochez wrote:
>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Jul 21, 2009, at 8:41 AM, Marina Vatkina wrote:
>>>>>>>>>
>>>>>>>>>> Jerome Dochez wrote:
>>>>>>>>>>
>>>>>>>>>>> On Jul 20, 2009, at 10:01 AM, Marina Vatkina wrote:
>>>>>>>>>>>
>>>>>>>>>>>> Jerome Dochez wrote:
>>>>>>>>>>>>
>>>>>>>>>>>>> On Jul 17, 2009, at 7:18 PM, Marina Vatkina wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>>> Is it possible to use JPA with the latest embedded GF?
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>> no yet, I have not tried
>>>>>>>>>>>>>
>>>>>>>>>>>>>> If yes, how do I specify the details of the jdbc
>>>>>>>>>>>>>> resource to be used?
>>>>>>>>>>>>>>
>>>>>>>>>>>>> you would need to run asadmin commands, the embedded
>>>>>>>>>>>>> way, through the EmbeddedAdminContainer.
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> Is it possible to point to an existing domain.xml instead?
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> yes you can do that see Server.ServerBuilder
>>>>>>>>>>> setEmbeddedFileSystem()
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Will it also load all apps registered in such domain?
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> yes but that suppose you have a valid domains directory
>>>>>>>>> (inplanted mode). why would you want to do that ?
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> I won't, I'm afraid of side-effects :(.
>>>>>>>> What the setEmbeddedFileSystem() should be set to and what is
>>>>>>>> the expected behavior?
>>>>>>>> thanks,
>>>>>>>> -marina
>>>>>>>>
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>>> If not, are there any examples that I can look at?
>>>>>>>>>>>>
>>>>>>>>>>> yes look at EmbeddedTest in distribution/web.
>>>>>>>>>>>
>>>>>>>>>>>>>> thanks,
>>>>>>>>>>>>>> -marina
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> To unsubscribe, e-mail: dev-
>>>>>>>>>>>>>> unsubscribe_at_glassfish.dev.java.net
>>>>>>>>>>>>>> For additional commands, e-mail: dev-
>>>>>>>>>>>>>> help_at_glassfish.dev.java.net
>>>>>>>>>>>>>>
>>>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>>>>
>>>>>>>>>>>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>>>>>>>>>>>> For additional commands, e-mail:
>>>>>>>>>>>>> dev-help_at_glassfish.dev.java.net
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>>>
>>>>>>>>>>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>>>>>>>>>>> For additional commands, e-mail: dev-
>>>>>>>>>>>> help_at_glassfish.dev.java.net
>>>>>>>>>>>>
>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>>
>>>>>>>>>>> To unsubscribe, e-mail: dev- unsubscribe_at_glassfish.dev.java.net
>>>>>>>>>>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>
>>>>>>>>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>>>>>>>>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>
>>>>>>>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>>>>>>>> For additional commands, e-mail: dev- help_at_glassfish.dev.java.net
>>>>>>>>>
>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>
>>>>>>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>>>>>>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>>
>>>>>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>>>>>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>>>>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>>>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>