dev@glassfish.java.net

Re: web container still starts in 3.1 embedded ejb

From: Marina Vatkina <marina.vatkina_at_oracle.com>
Date: Thu, 03 Jun 2010 14:25:37 -0700

Amy Roh wrote:
> Marina Vatkina wrote:
>> I'm not sure if I need to do anything extra in 3.1 or if the 3.1 code
>> tries to outsmart me, but something that I was able to do in v3,
>> doesn't work any more.
>>
>> That something is suppressing web container from being started when
>> the EJB embeddable API is used to run GF in embedded mode.
>>
>> In v3 I was able to achieve that goal by creating a modified version
>> of the existing domain.xml (EJB embeddable container is supported
>> only against a pre-existing install) that had empty elements for
>> <network-listeners> and <protocols>, and skipped lazy-init attribute
>> in the <iiop-listener>. At that time I did try to suppress wider
>> elements, but that caused nasty errors and we were in a time crunch
>> (embedded was coming in at the last minute) to try and solve the
>> problem in a better way.
> Where is this modified domain.xml located?

java.io.tmpdir (but it's deleted on exit - so add a sleep between create
and close calls to see it)
>
> [java] SEVERE: WEB0355: network-listener [http-listener-1] referenced
> by virtual server [server] does not exist
>
> This error happens because you have virtual-server "server" with
> network-listeners "http-listener-1", however, you have empty
> <network-listeners> as you mentioned.
>
> <virtual-server id="server"
> network-listeners="http-listener-1,http-listener-2" />
>
> Try removing network-listeners and you'll no longer see the warning.

This causes NPE ([1] below) and the server can't even start (though it
still tries to start the web container - something I want to avoid).

> Looks like embedded does get started and the test passes despite of
> the warning messages.

Yes, but it starts the web container as well :(

thanks,
-marina
>
> [java] INFO: GlassFish3.1-SNAPSHOT (Amy-private) startup time :
> Embedded(3041ms) startup services(4992ms) total(8033ms)
> ......
> [java] INFO: Portable JNDI names for EJB SimpleEjb :
> [java:global/ejb-ejb31-embedded-profile-ejb/SimpleEjb!org.glassfish.tests.ejb.profile.SimpleEjb,
> java:global/ejb-ejb31-embedded-profile-ejb/SimpleEjb]
> [java]
> [java] ==> Spent on CREATE: 11131 msec
> [java] Looking up EJB...
> [java] Invoking EJB...
> [java]
> [java] ==> Spent on LOOKUP: 2 msec
> [java]
> [java] ==> Spent on CALL: 60 msec
> [java] EJB said: hello
> [java] Jun 2, 2010 7:07:44 PM com.sun.logging.LogDomains$1 log
> [java] INFO: JMXStartupService and JMXConnectors have been shut down.
> [java] Jun 2, 2010 7:07:44 PM com.sun.logging.LogDomains$1 log
> [java] INFO: Shutdown procedure finished
> [java] Jun 2, 2010 7:07:44 PM AppServerStartup run
> [java] INFO: [Thread[GlassFish Kernel Main Thread,5,main]] exiting
> [java]
> [java] ==> Spent on CLOSE: 170 msec
> [java]
> [java] ==> Spent on TEST: 11365 msec
> [java] Value of key is: embedded with profile
> [java] Done calling EJB
> [java] Generating report at
> /Users/Amy/glassfish-v3/v3/appserv-tests/test_results.xml
> [java]
> [java]
> [java] -----------------------------------------
> [java] - embedded with profile: PASS -
> [java] -----------------------------------------
>

[1] [java] java.lang.NullPointerException
     [java] at
java.lang.reflect.Proxy.getInvocationHandler(Proxy.java:636)
     [java] at
org.jvnet.hk2.config.ConfigSupport.getImpl(ConfigSupport.java:265)
     [java] at
com.sun.enterprise.v3.services.impl.GrizzlyService.postConstruct(GrizzlyService.java:321)
     [java] at
com.sun.hk2.component.AbstractWombImpl.inject(AbstractWombImpl.java:174)
     [java] at
com.sun.hk2.component.ConstructorWomb$1.run(ConstructorWomb.java:87)
     [java] at java.security.AccessController.doPrivileged(Native
Method)
     [java] at
com.sun.hk2.component.ConstructorWomb.initialize(ConstructorWomb.java:84)
     [java] at
com.sun.hk2.component.AbstractWombImpl.get(AbstractWombImpl.java:77)
     [java] at
com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:58)
     [java] at
com.sun.hk2.component.LazyInhabitant.get(LazyInhabitant.java:107)
     [java] at
com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:60)
     [java] at
com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.java:236)
     [java] at
com.sun.enterprise.v3.server.AppServerStartup.start(AppServerStartup.java:128)
     [java] at
com.sun.enterprise.module.bootstrap.Main.launch(Main.java:458)
     [java] at
com.sun.enterprise.module.bootstrap.Main.launch(Main.java:402)
     [java] at
com.sun.enterprise.module.bootstrap.Main.launch(Main.java:311)
     [java] at
com.sun.enterprise.module.bootstrap.Main.launch(Main.java:304)
     [java] at
com.sun.enterprise.glassfish.bootstrap.ASEmbedded.start(ASEmbedded.java:94)
     [java] at org.glassfish.api.embedded.Server.<init>(Server.java:312)
     [java] at org.glassfish.api.embedded.Server.<init>(Server.java:75)
     [java] at
org.glassfish.api.embedded.Server$Builder.build(Server.java:185)
     [java] at
org.glassfish.api.embedded.Server$Builder.build(Server.java:167)
     [java] at
org.glassfish.ejb.embedded.EJBContainerProviderImpl.init(EJBContainerProviderImpl.java:154)
     [java] at
org.glassfish.ejb.embedded.EJBContainerProviderImpl.createEJBContainer(EJBContainerProviderImpl.java:114)
     [java] at
javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:116)
     [java] at
javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:92)
     [java] at com.acme.Client.test(Client.java:72)
     [java] at com.acme.Client.main(Client.java:62)
     [java] Jun 3, 2010 2:14:54 PM com.sun.logging.LogDomains$1 log
     [java] INFO: Startup service failed to start : null
     [java] Jun 3, 2010 2:14:55 PM com.sun.logging.LogDomains$1 log
     [java] INFO: enterprise_used_delegate_name
     [java] Jun 3, 2010 2:14:55 PM com.sun.logging.LogDomains$1 log
     [java] SEVERE: Unable to start container
com.sun.enterprise.web.WebContainer
     [java] org.jvnet.hk2.component.ComponentException: Injection failed
on com.sun.enterprise.v3.services.impl.GrizzlyService
com.sun.enterprise.web.WebContainer.grizzlyService
     [java] at
org.jvnet.hk2.component.InjectionManager.inject(InjectionManager.java:121)
     [java] at
org.jvnet.hk2.component.InjectionManager.inject(InjectionManager.java:66)
     [java] at
com.sun.hk2.component.AbstractWombImpl.inject(AbstractWombImpl.java:170)

>
> Amy
>
>>
>> Let me know what I can do in 3.1 to have the same behavior as in v3.
>>
>> See [v3] and [v3.1] below for the corresponding output of a simple
>> embedded ejb test. You can try yourself by running 'ant all' from
>> v2/appserv-tests/devtests/ejb/ejb31/embedded/profile (no need to
>> start a database or a server).
>>
>> thanks,
>> -marina
>>
>> [v3]
>> [java] Jun 2, 2010 5:59:24 PM
>> com.sun.enterprise.v3.server.AppServerStartup run
>> [java] INFO: GlassFish v3 (74.2) startup time : Embedded(2441ms)
>> startup services(932ms) total(3373ms)
>> [java] Jun 2, 2010 5:59:25 PM
>> org.glassfish.admin.mbeanserver.JMXStartupService$JMXConnectorsStarterThread
>> run
>> [java] INFO: JMXStartupService: JMXConnector system is disabled,
>> skipping.
>> [java] Jun 2, 2010 5:59:25 PM
>> com.sun.enterprise.transaction.JavaEETransactionManagerSimplified
>> initDelegates
>> [java] INFO: Using
>> com.sun.enterprise.transaction.jts.JavaEETransactionManagerJTSDelegate
>> as the delegate
>> [java] Jun 2, 2010 5:59:27 PM AppServerStartup run
>>
>>
>> [v3.1]
>> [java] Jun 2, 2010 6:06:44 PM
>> com.sun.enterprise.util.EarlyLogger add
>> [java] INFO: Total time to parse domain.xml: 76 milliseconds
>> [java] Jun 2, 2010 6:06:45 PM com.sun.logging.LogDomains$1 log
>> [java] INFO: enterprise_used_delegate_name
>> [java] Jun 2, 2010 6:06:45 PM
>> com.sun.common.util.logging.LoggingConfigImpl openPropFile
>> [java] INFO: Cannot read logging.properties file.
>> [java] Jun 2, 2010 6:06:46 PM com.sun.logging.LogDomains$1 log
>> [java] SEVERE: WEB0355: network-listener [http-listener-1]
>> referenced by virtual server [server] does not exist
>> [java] Jun 2, 2010 6:06:46 PM com.sun.logging.LogDomains$1 log
>> [java] SEVERE: WEB0355: network-listener [http-listener-2]
>> referenced by virtual server [server] does not exist
>> [java] Jun 2, 2010 6:06:46 PM com.sun.logging.LogDomains$1 log
>> [java] INFO: webContainer.virtualServer.created
>> [java] Jun 2, 2010 6:06:46 PM com.sun.logging.LogDomains$1 log
>> [java] SEVERE: WEB0355: network-listener [admin-listener]
>> referenced by virtual server [__asadmin] does not exist
>> [java] Jun 2, 2010 6:06:46 PM com.sun.logging.LogDomains$1 log
>> [java] INFO: webContainer.virtualServer.created
>> [java] Jun 2, 2010 6:06:46 PM com.sun.logging.LogDomains$1 log
>> [java] INFO: webContainer.virtualServer.loadedDefaultWebModule
>> [java] Jun 2, 2010 6:06:47 PM com.sun.logging.LogDomains$1 log
>> [java] INFO: Done with starting web container
>> [java] Jun 2, 2010 6:06:47 PM com.sun.logging.LogDomains$1 log
>> [java] INFO: GlassFish3.1-SNAPSHOT (mvatkina-private) startup
>> time : Embedded(2433ms) startup services(2483ms) total(4916ms)
>> [java] Jun 2, 2010 6:06:47 PM com.sun.logging.LogDomains$1 log
>> [java] INFO: JMXStartupService: JMXConnector system is disabled,
>> skipping.
>> [java] Jun 2, 2010 6:06:47 PM AppServerStartup run
>>
>> ---------------------------------------------------------------------
>> 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
>