Issue Details (XML | Word | Printable)

Key: GLASSFISH-18320
Type: Bug Bug
Status: Reopened Reopened
Priority: Critical Critical
Assignee: sirajg
Reporter: marina vatkina
Votes: 1
Watchers: 3
Operations

If you were logged in you would be able to see more operations.
glassfish

[Regression] Addition of AdminConsoleStartupService broke EJB embedded Container

Created: 03/Feb/12 11:24 PM   Updated: 15/Mar/12 04:44 AM
Component/s: admin
Affects Version/s: 4.0
Fix Version/s: None

Time Tracking:
Not Specified

Tags:
Participants: marina vatkina, sirajg and Tom Mueller


 Description  « Hide

EJB embeddable container suppresses services that won't be necessary for regular testing of local EJBs. One of such services is a Web container. We do it by modifying domain.xml on the fly and using that temporary version during the run.

02/03/2012 hudson build (http://hudson-sca.us.oracle.com/job/ejb-devtests-v3/623/) failed with

java.lang.IllegalStateException: Can't operate without at least one <network-listener>
[java] at com.sun.enterprise.config.util.ServerHelper.getAdminListener(ServerHelper.java:164)
[java] at com.sun.enterprise.config.serverbeans.Config$Duck.getAdminListener(Config.java:460)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:597)
[java] at org.jvnet.hk2.config.Dom.invokeDuckMethod(Dom.java:961)
[java] at org.jvnet.hk2.config.Dom.invoke(Dom.java:914)
[java] at org.glassfish.config.support.TranslatedConfigView.invoke(TranslatedConfigView.java:131)
[java] at $Proxy30.getAdminListener(Unknown Source)
[java] at com.sun.enterprise.v3.admin.adapter.AdminEndpointDecider.setValues(AdminEndpointDecider.java:118)
[java] at com.sun.enterprise.v3.admin.adapter.AdminEndpointDecider.<init>(AdminEndpointDecider.java:84)
[java] at com.sun.enterprise.v3.admin.adapter.AdminConsoleAdapter.init(AdminConsoleAdapter.java:507)
[java] at com.sun.enterprise.v3.admin.adapter.AdminConsoleAdapter.postConstruct(AdminConsoleAdapter.java:465)

To reproduce (assuming v2/appserv-tests lib/ and config/ are checked out):
cd v2/appserv-tests/devtests/ejb/ejb31/embedded
ant all-report



Tom Mueller added a comment - 07/Feb/12 05:43 PM

Marina,
Do you know when this broke? The recent changes to AdminConsoleAdapter do not change this code that eventually calls ServerHelper.getAdminListener, and ServerHelper hasn't changed since last July.

Can you provide the details of the changes you make to domain.xml. From the exception, it appears as though the admin-listener network-listener has been removed.


Tom Mueller added a comment - 07/Feb/12 05:47 PM

Masoud, this is actually a zero-config issue. Here, we have a situation where the embedded tests have removed the network listener named "admin-listener" and the server (in AdminConsoleAdapter) throws an exception because of it. I expect AdminAdapter would also have a problem here.

We need a design decision here as to whether some minimal configuration is required to have the admin interface (on port 4848) come up or whether it should come up by default if the config information isn't there. I would think that we would want to be able to configure a server that doesn't have an admin interface but this should be discussed.


marina vatkina added a comment - 07/Feb/12 06:32 PM

Tom,

The test started failing on 02/03/2012 (8am). So the change was made in the 24 hours prior to that.

Embedded EJB container is intended for testing EJBs so should start fast and have the least possible outside containers started (e.g. unless a WAR file is being deployed, the web container should not start). You can find all the transformations that are done in ejb/ejb-container/src/main/java/org/glassfish/ejb/embedded/DomainXmlTransformer.java. They were discussed back then with Jerome and Ken Saks.

Also note that there is no way to get currently to the GlassFish API when using embeddable EJB container (http://docs.oracle.com/javaee/6/api/javax/ejb/embeddable/EJBContainer.html).


Tom Mueller added a comment - 08/Feb/12 09:49 PM

The root cause of this was the addition of the AdminConsoleStartupService which was added to the trunk on 2/2/12 in revision 52405.

Assigning to Siraj for an immediate fix since this is breaking the embedded EJB tests.

Siraj, the AdminConsoleStartupService must take into account a configuration where no admin-listener is configured. With the current implementation, AdminConsoleStartupService eventually causes a call to ServerHelper.getAdminListener which throws an exception if there is no admin listener configured. AdminConsoleStartupService needs to handle this exception.

This fix is needed on the trunk.


sirajg added a comment - 09/Feb/12 10:37 PM

The test passes in 3.1.2. In the embedded case, the adapter code is not invoked in 3.1.2, but it is invoked on the trunk.


sirajg added a comment - 13/Feb/12 04:33 PM

Handle the case when no network listeners are found. Revision 52563


marina vatkina added a comment - 15/Mar/12 04:44 AM

The latest change to ServerHelper broke it again