dev@glassfish.java.net

Re: Wrong ServerEnvironmentImpl properties in embedded mode?

From: Jerome Dochez <Jerome.Dochez_at_Sun.COM>
Date: Mon, 17 Aug 2009 02:27:18 -0700

On Aug 14, 2009, at 2:31 PM, Marina Vatkina wrote:

> Jerome Dochez wrote:
>> On Aug 14, 2009, at 10:43 AM, Marina Vatkina wrote:
>>> Now I'm totally confused :(.
>>>
>>> 1. Didn't you tell us (on another thread) that embedded EJB can't
>>> use the inplanted mode? And that I shouldn't call setInstanceRoot
>>> because it results in 'address already in use' error?
>> it's inplanted mode because you end up using an existing glassfish
>> installation but the classloading is very different, only one
>> classloader to load the entire application server jars. as for the
>> setInstanceRoot, it better not be called at that time because you
>> will set the location of the installation by using the new
>> embedded- static.jar location.
>>>
>>> 2. If the partially-inplanted mode is when the embedded EJB is
>>> used with the existing GF installation (and not uber-jar
>>> downloaded separately), and setInstallRoot is not called, do I
>>> call a) setInstanceRoot and setConfigurationFile? or b) only
>>> setConfigurationFile?
>>>
>> only b)
>>> If I can't call setInstallRoot, how will its location be
>>> calculated if the instance location is not the default?
>>>
>> the location will be relative to the location of the embedded-
>> static.jar file (which reference all the modules jars).
>
> OK.
>>> 3. If in that partially-inplanted mode (#2), there will be a
>>> special embedded-xxx.jar which will reference all installed jars
>>> under modules, it won't include keystore.jks and __ds_jdbc_ra, as
>>> they will be used from the GF installation. Right?
>>>
>> right, but the installRoot will be set (again relative to the
>> special embedded-xxx.jar) so keystore, and connectors will be found.
>
> When do you plan to have this code in place?
>
> I tried with the embedded-static.jar created by Siraj and placed in
> the <gf>/lib/embedded. It doesn't find anything on its own: if the
> instanceRoot is not set, both the instance and the install root
> default to <java-command-start-location>/gfembed63918tmp and with
> the last subdir portion being chopped by ASenvPropertyReader, the
> installRoot ends up as the <java-command-start-location>, which is
> not you'd expect it to be :(
yes there is a bit of work in the embedded startup to realize that we
are in this hybrid mode. I should be able to do it before wednesday.

jerome

>
> Regards,
> -marina
>
>>> If yes, we are back to the problem that the calculation of the
>>> "com.sun.aas.installRoot" produces wrong result in embedded mode :(.
>>>
>> no :)
>> jerome
>>> thanks,
>>> -marina
>>>
>>> Jerome Dochez wrote:
>>>
>>>> On Aug 13, 2009, at 1:55 PM, Marina Vatkina wrote:
>>>>
>>>>> For a "pure" embedded-all.jar - yes, but how about the one that
>>>>> can work with the existing gf installation in no-inplanted
>>>>> (how do you call it btw?) mode?
>>>>
>>>> this will still be inplanted mode so it should work out of the
>>>> box since the installRoot exist and is correct. I don't have a
>>>> name for that mode yet, static inplanted maybe since it's
>>>> basically not extensible as opposed to the normal inplanted
>>>> where we put all jars in the modules directory in the classpath.
>>>> jerome
>>>>
>>>>>
>>>>> thanks,
>>>>> -marina
>>>>>
>>>>> Jerome Dochez wrote:
>>>>>
>>>>>> Security and connector team will need to provide a solution
>>>>>> for this. It's obvious that when using the embedded-all.jar,
>>>>>> there will not be a valid populated installRoot.
>>>>>> Jagadish, any suggestion ? In this scenario, glassfish is
>>>>>> shipped as a single jar file, and there are no installRoot
>>>>>> where to load the adapters from. Would that be enough to
>>>>>> shop the adapters in this uber- jar along with the runtime ?
>>>>>> Jerome
>>>>>> On Aug 13, 2009, at 9:26 AM, Marina Vatkina wrote:
>>>>>>
>>>>>>> Jerome Dochez wrote:
>>>>>>>
>>>>>>>> in the case of using the gf-embedded-all,
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> I saw this error with inplanted mode also, but as it won't
>>>>>>> work for embedded EJB container, I switched to use gf-
>>>>>>> embedded-all to try to make some progress.
>>>>>>>
>>>>>>> there is no installRoot since
>>>>>>>
>>>>>>>> there is no installation so you should get the same
>>>>>>>> installRoot and instanceRoot values.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> This is not what's happening :(.
>>>>>>>
>>>>>>> Can you clarify why is this creating an issue down
>>>>>>>
>>>>>>>> to road ?
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> keystore.jks and __ds_jdbc_ra can't be found by the code that
>>>>>>> use "com.sun.aas.installRoot" property to locate them.
>>>>>>> Without __ds_jdbc_ra, connector code can't bootstrap itself.
>>>>>>>
>>>>>>> thanks,
>>>>>>> -marina
>>>>>>>
>>>>>>>> jerome
>>>>>>>> On Aug 12, 2009, at 4:18 PM, Marina Vatkina wrote:
>>>>>>>>
>>>>>>>>> Jerome,
>>>>>>>>>
>>>>>>>>> I'm trying the gf-embedded-all.jar for
>>>>>>>>> When I try to point to a pre-existing GF installation
>>>>>>>>> via <EmbeddedFileSystem.Builder>.setConfigurationFile()
>>>>>>>>> for domain.xml and
>>>>>>>>> EmbeddedFileSystem.Builder.setInstanceRoot() for
>>>>>>>>> <install>/ glassfishv3/glassfish/domains/domain1, the
>>>>>>>>> system properties in thServerEnvironmentImpl are getting
>>>>>>>>> wrong (?) values from the injected StartupContext ref:
>>>>>>>>>
>>>>>>>>> com.sun.aas.configRoot <install>/glassfishv3/glassfish/
>>>>>>>>> domains/ config
>>>>>>>>> com.sun.aas.installRoot <install>/glassfishv3/glassfish/
>>>>>>>>> domains
>>>>>>>>>
>>>>>>>>> If I set instance root to the <install>/glassfishv3/
>>>>>>>>> glassfish, or don't set the instance root at all, the
>>>>>>>>> problem with calculating the right locations is still
>>>>>>>>> the same :(.
>>>>>>>>>
>>>>>>>>> Everything is (obviously) fine in the non-embedded mode:
>>>>>>>>>
>>>>>>>>> com.sun.aas.configRoot <install>/glassfishv3/glassfish/config
>>>>>>>>> com.sun.aas.installRoot <install>/glassfishv3/glassfish
>>>>>>>>>
>>>>>>>>> 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
>