[GLASSFISH-16587] request.getUserPrincipal() does not return MyPrincipal Created: 09/May/11  Updated: 14/May/15

Status: Open
Project: glassfish
Component/s: web_container
Affects Version/s: 3.1
Fix Version/s: future release

Type: Bug Priority: Major
Reporter: gernot1 Assignee: kumarjayanti
Resolution: Unresolved Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: 3_1-next, 3_1_1-exclude, 3_1_1-scrubbed, 3_1_2-exclude

 Description   

I've an own javax.security.auth.message.module.ServerAuthModule implementation.
In validateRequest() I put an instance of MyPrincipal to the callbackhandler
MyPrincipal myprincipal = ...;
callbackHandler.handle(new Callback[]

{ new CallerPrincipalCallback(clientSubject, myprincipal), new GroupPrincipalCallback(...) }

);
In the application request.getUserPrincipal() returns an instance of com.sun.enterprise.security.web.integration.WebPrincipal and NOT an instance of MyPrincipal!

In an ejb the call of ejbContext.getCallerPrincipal() does return an instance of MyPrincipal!

==> request.getUserPrincipal() should return the principal which is set in the ServerAuthModule



 Comments   
Comment by kumarjayanti [ 09/May/11 ]

yes this is a known issue and we made some work on it to get the behavior you are looking for. It is still not committed, more work to do.

Comment by kumarjayanti [ 18/May/11 ]

We will make an attempt to get this fixed for 3.1.1 but cannot commit based on resources and time left.

Comment by sultry [ 14/May/15 ]

Depends on this bug made that workaround:

private static Principal glassfishWorkAround(HttpServletRequest request) {
        Principal principal = null;
        try {
            Principal webPrincipal = request.getUserPrincipal();
            if (webPrincipal != null) {
                Class glassfishWrapper = Class.forName("com.sun.enterprise.security.web.integration.WebPrincipal");
                if (glassfishWrapper.isInstance(webPrincipal)) {
                    Field customPrincipal = glassfishWrapper.getDeclaredField("customPrincipal");
                    customPrincipal.setAccessible(true);
                    principal = (Principal) customPrincipal.get(webPrincipal);
                } else {
                    principal = webPrincipal;
                }
            }
        } catch (IllegalArgumentException | IllegalAccessException | NoSuchFieldException | SecurityException | ClassNotFoundException ex) {
            LOGGER.throwing("SecurityConstraint", "glassfishWorkAround", ex);
        }
        return principal;
}

public static Principal getPrincipal(HttpServletRequest request) {
        return glassfishWorkAround(request);
}

Hope it helps somebody! Anyway hope this bug will be resolved soon.





[GLASSFISH-21322] Threads blocking in ApplicationContext.mergeParameters method Created: 02/Mar/15  Updated: 11/May/15

Status: In Progress
Project: glassfish
Component/s: web_container
Affects Version/s: 3.1.2.2
Fix Version/s: None

Type: Bug Priority: Blocker
Reporter: Yury_Morozov Assignee: Shaifali Kansal
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: javaee_ri_target

 Description   

Related to GLASSFISH-20670

During performance tests of our application we discovered that most of http threads were eventually locked on org.apache.catalina.core.ApplicationContext.mergeParameters method.

Part of stack trace of one blocked thread:
Thread "http-thread-pool-8181(2)": at org.apache.catalina.core.ApplicationContext.mergeParameters() at org.apache.catalina.core.ApplicationContext.getInitParameter(java.lang.String) at org.apache.catalina.core.ApplicationContextFacade.getInitParameter(java.lang.String) at com.sun.faces.context.ExternalContextImpl.getInitParameter(java.lang.String) at javax.faces.context.ExternalContextWrapper.getInitParameter(java.lang.String) at javax.faces.component.UIComponent.popComponentFromEL(javax.faces.context.FacesContext)

First call to mergeParameters() will execute and only the few threads trying to access it during that time need to be synchronized. After that all calls just check condition and finish. Since synchronizing a method could in some extreme cases decrease performance by a factor of 100 or higher, the overhead of acquiring and releasing a lock every time this method is called seems unnecessary: once the execution of this method has been completed, acquiring and releasing the locks would appear unnecessary.

The bug hasn't been fixed in "GLASSFISH-20670", the method mergeParameters is still synchronized and blocks all threads.
Solution that is submitted in commets for "GLASSFISH-20670" fixes the problem.
Please, include this in your next release.



 Comments   
Comment by Yury_Morozov [ 02/Mar/15 ]

This bug can be easily fixed by double-checked locking pattern (as suggested for ''GLASSFISH-20670'' by Sergey Rezvan):

ApplicationContext.java
org.apache.catalina.ApplicationContext

public class ApplicationContext implements ServletContext {
....
private volatile Object lockObject = new Object();
....
	private void mergeParameters() {
		if (!this.parametersMerged) {
			synchronized (this.lockObject) {
				if (!this.parametersMerged) {
					for (String name : this.context.findParameters()) { 
						this.parameters.put(name, this.context.findParameter(name)); 
					}
					List<ApplicationParameter> params = this.context.findApplicationParameters();
					Iterator<ApplicationParameter> i = params.iterator();
					while (i.hasNext()) {
						ApplicationParameter param = (ApplicationParameter)i.next();
						if (param.getOverride()) {
							if (this.parameters.get(param.getName()) == null) { 
								this.parameters.put(param.getName(), param.getValue()); 
							}
						} else { 
							this.parameters.put(param.getName(), param.getValue()); 
						}
					}
					this.parametersMerged = true;
				}
			}
		}
	}
...
}
Comment by Shaifali Kansal [ 11/May/15 ]

This issue has been resolved in revision 63827 on 03/Apr/15 as a part of bug fix for GLASSFISH-20670.





[GLASSFISH-20932] Error occurs when default-web-module is set. Created: 17/Dec/13  Updated: 29/Apr/15  Resolved: 29/Apr/15

Status: Resolved
Project: glassfish
Component/s: web_container
Affects Version/s: 4.1
Fix Version/s: 4.2

Type: Bug Priority: Major
Reporter: xianwu Assignee: Arindam Bandyopadhyay
Resolution: Fixed Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

OS
Windows 7 Enterprise (Service Pack 1)

JDK
java version "1.7.0_11"
Java(TM) SE Runtime Environment (build 1.7.0_11-b21) Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)

GlassFish build: glassfish-4.0.1-b02-07_22_2013


Tags: javaee_ri_fix

 Description   

Reproducible operational steps:

1) deploy a web application e.g. HelloServlet.war
asadmin deploy c:\tmp\HelloServlet.war
Application deployed with name HelloServlet.
Command deploy executed successfully.

2) set default-web-module to HelloServlet
asadmin set server.http-service.virtual-server.server.default-web-module=HelloServlet
server.http-service.virtual-server.server.default-web-module=HelloServlet
Command set executed successfully.

3) set http-listener-1.http.max-post-size-bytes
asadmin set server.network-config.protocols.protocol.http-listener-1.http.max-post-size-bytes=2000
server.network-config.protocols.protocol.http-listener-1.http.max-post-size-bytes=2000
Command set executed successfully.

4) error occurs in server.log

[2013-12-17T16:29:08.916+1100] [glassfish 4.0] [SEVERE] [AS-WEB-GLUE-00115] [javax.enterprise.web] [tid: _ThreadID=145 _ThreadName=pool-50-thread-1] [timeMillis: 1387258148916] [levelValue: 1000] [[
Exception processing HttpService configuration change
org.apache.catalina.LifecycleException: java.lang.Exception: No context matching /HelloServlet deployed on virtual server server
at com.sun.enterprise.web.WebContainer.updateDefaultWebModule(WebContainer.java:2340)
at com.sun.enterprise.web.WebContainer.updateHost(WebContainer.java:3157)
at com.sun.enterprise.web.reconfig.WebConfigListener$1.changed(WebConfigListener.java:156)
at org.jvnet.hk2.config.ConfigSupport.sortAndDispatch(ConfigSupport.java:331)
at com.sun.enterprise.web.reconfig.WebConfigListener.changed(WebConfigListener.java:132)
at org.jvnet.hk2.config.Transactions$ConfigListenerJob.process(Transactions.java:400)
at org.jvnet.hk2.config.Transactions$ConfigListenerJob.process(Transactions.java:390)
at org.jvnet.hk2.config.Transactions$ConfigListenerNotifier$1$1.call(Transactions.java:280)
at org.jvnet.hk2.config.Transactions$ConfigListenerNotifier$1$1.call(Transactions.java:278)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.Exception: No context matching /HelloServlet deployed on virtual server server
at org.glassfish.grizzly.http.server.util.Mapper.addDefaultContext(Mapper.java:791)
at org.glassfish.grizzly.http.server.util.Mapper.setDefaultContextPath(Mapper.java:755)
at com.sun.enterprise.web.WebContainer.updateDefaultWebModule(WebContainer.java:2332)
... 13 more
]]

5) get http-listener-1.http.max-post-size-bytes
asadmin get server.network-config.protocols.protocol.http-listener-1.http.max-post-size-bytes
server.network-config.protocols.protocol.http-listener-1.http.max-post-size-bytes=2000
Command get executed successfully.



 Comments   
Comment by jifeng [ 13/Jan/14 ]

Hi
Shing Wai Chan
xianwu

After a few investigation about the source, I found the exact precise place where the failure happens:

org.glassfish.grizzly.http.server.util.Mapper
private void addDefaultContext(Host host, String defaultContextPath)
            throws Exception {

        boolean defaultContextFound = false;

        Context[] contexts = host.contextList.contexts;

        if (contexts != null) {
            for (Context context1 : contexts) {
                if (context1.name.equals(defaultContextPath)) {
                    host.defaultContexts[0] = context1;
                    defaultContextFound = true;
                    break;
                }
            }
        }

        if (!defaultContextFound) {
            throw new Exception("No context matching " + defaultContextPath
                                + " deployed on virtual server "
                                + host.name);★
        }
    }

I have debuged the 'Mapper' class and found the [context.name] object has never been valued。

The [context.name] object's initialization processing as follows:

package com.sun.enterprise.v3.services.impl.ContainerMapper
private final static String ROOT = "";★
protected void configureMapper() {
    ......
    try {
    ....
         mapper.addContext(defaultHostName, ROOT★,
                    new ContextRootInfo(this, null),
                    new String[]{"index.html", "index.htm"}, null);
    ....
        } finally {
            mapperLock.writeLock().unlock();
        }
}

org.glassfish.grizzly.http.server.util.Mapper
public void addContext
            (String hostName, String path★, Object context,
            String[] welcomeResources, NamingContext resources,
            List<AlternateDocBase> alternateDocBases) {
    ......
    newContext.name = path;★//the [context.name] object's 
                             //value always equals to ""
    ......
 }
Comment by jifeng [ 24/Jan/14 ]

Hi
Shing Wai Chan
xianwu

I modify the following code, it works fine,could you please confirm it and give me some suggestions?

package com.sun.enterprise.v3.services.impl.ContainerMapper
@@ -69,6 +69,8 @@
 import org.glassfish.grizzly.http.util.MimeType;
 import org.glassfish.internal.grizzly.ContextMapper;
 import org.glassfish.kernel.KernelLoggerInfo;
+import com.sun.enterprise.config.serverbeans.ConfigBeansUtilities;
+import com.sun.enterprise.config.serverbeans.VirtualServer;
 
 /**
  * Container's mapper which maps {@link ByteBuffer} bytes representation to an  {@link HttpHandler}, {@link
@@ -148,7 +150,7 @@
         try {
             mapper.setDefaultHostName(defaultHostName);
             mapper.addHost(defaultHostName, new String[]{}, null);
-            mapper.addContext(defaultHostName, ROOT,
+            mapper.addContext(defaultHostName, getContextRoot(),
                     new ContextRootInfo(this, null),
                     new String[]{"index.html", "index.htm"}, null);
             // Container deployed have the right to override the default setting.
@@ -157,7 +159,29 @@
             mapperLock.writeLock().unlock();
         }
     }
-
+    
+    private String getContextRoot() {
+        String defaultWebModule = null;
+        String contextRoot = null;
+        Collection<VirtualServer> list = grizzlyService.getHabitat().getAllServices(VirtualServer.class);
+        ConfigBeansUtilities cbu = grizzlyService.getHabitat().getService(ConfigBeansUtilities.class);
+        for (VirtualServer virtualServer : list) {
+            if (virtualServer.getId().equals(defaultHostName)) {
+                defaultWebModule = virtualServer.getDefaultWebModule();
+                if (cbu == null) {
+                    contextRoot = null;
+                }
+                else {
+                    if (defaultWebModule != null) {
+                        contextRoot = cbu.getContextRoot(defaultWebModule);
+                    }
+                }
+                break;
+            }
+        }
+        return contextRoot == null ?ROOT:contextRoot;
+    }
+   
Comment by oleksiys [ 17/May/14 ]

IMO ContainerMapper has nothing to do with the problem. I think the problem occurs because WebContainer tries to set default web module even before this module is registered/deployed in the Mapper. The registration sequence has to be fixed in WebContainer.

Comment by bradvido [ 12/Feb/15 ]

I have this problem as well in 4.1.
I have a virtual server set up with a default web module defined. Whenever I update the settings for the network-listener that the virtual server uses, I get the same error. Moreover, the server becomes unresponsive and starts returning zero-length responses for all HTTP requests. Only a restart fixes it.

Comment by Arindam Bandyopadhyay [ 29/Apr/15 ]

Committed in trunk/main
Sending appserver/web/web-glue/src/main/java/com/sun/enterprise/web/WebContainer.java
Transmitting file data .
Committed revision 63862.





[GLASSFISH-21295] Some EE7 APIs missing during JSP compilation Created: 03/Feb/15  Updated: 25/Apr/15

Status: In Progress
Project: glassfish
Component/s: web_container
Affects Version/s: 4.1
Fix Version/s: None

Type: Bug Priority: Major
Reporter: emailnbw Assignee: Shaifali Kansal
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Glassfish 4.1 full zip, RHEL 7.0, Oracle 1.7.0_71 JDK


Tags: glassfish, jsp

 Description   

I have a web application (single war) which includes a few JSPs. This web app worked fine under Glassfish 3.1.2.x and GF would compile the JSPs just fine.

When Glassfish 4.1 attempts to compile these same JSPs I get a bunch of errors because it can't locate javax.jax-rs API classes. This never happened in Glassfish 3.1.2.x. It appears that the contents of the default-web.xml have changed related to how the JSP servlet is configured. Specifically the APIs listed in the system-jar-includes no longer included javax.jaxrs as they once did. Instead it now includes jersey-mvc-jsp.jar. This seems like a regression.



 Comments   
Comment by Shaifali Kansal [ 08/Apr/15 ]

Can you please provide this particular war file here?

Comment by emailnbw [ 25/Apr/15 ]

Not really, it's proprietary, but this issue is with the default-web.xml file bundled in Glassfish 4.1. I could try to reproduce this with a simple test case JSP which has import which have dependencies on jax-rs when I have some time.





[GLASSFISH-20712] Session Replication (Possibly CNF error in web container?) Created: 19/Jul/13  Updated: 23/Apr/15

Status: Open
Project: glassfish
Component/s: web_container
Affects Version/s: 3.1.2.2
Fix Version/s: None

Type: Bug Priority: Blocker
Reporter: alev50 Assignee: Rajiv Mordani
Resolution: Unresolved Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

1 node, 1 cluster, 2 instances


Attachments: Zip Archive logs_180713_1612.zip    
Tags: javaee_ri_target

 Description   

Here is the scenario I played :

1 - Start cluster
2 - Deploy web app
3 - Connect through load balancer -> instance 2
4 - Log on
5 - Stop instance 2
6 - Refresh browser -> instance 1
7 - Session lost + StreamCorruptedException
8 - Stop cluster

Logs are attached.

Thanks for help.

Regards,

Anthony

-----------------------------------------------------------------------------------------------------------------
Fialli Joe joe.fialli@oracle.com via shoal.java.net

Thanks for providing a full set of server logs just containing the test scenario that is failing for you.

I just want to make an overall statement that we are trying to track down class loading issues in the web container.
So you might want to post this issue to glassfish alias instead of the shoal alias.
So it is overkill to turn on the shoal logging to FINEST since that subsystem could not even be responsible
for corrupted stream (grizzly is the transport for messages between cluster members and the web container passes a
byte of serialized content into Shoal messaging system and when trying to reconstitute replicated session,
the byte array is taken out of shoal messaging subsystem and deserialized should be deserialized using web container class path.
While the failure is stating corrupted stream, the failure is always exactly the same type code of "00". If it truely was a corrupted stream,
we would see different values all the time. The best bet for Type Code 00 in stream is a class not being found.
The ClassNotFoundException is getting consumed and not reported.

Possible reason for the ClassNotFoundException is the following.

My observations when looking at the server log you sent yesterday was that it was incorrect
for there not to be a Web Container classloader context to deserialize the session context
(after all, the class is the app loaded in the container, the default ObjectInputStream is not going
to be able to deserialize that.)

So this failure is significant and needs interpretation by someone who works on web container. It happens quite a bit in the server logs that you sent in.
I am not aware why this would happen. The following might explain trying to deserialize replicated content in web container without using a web container
class path.

[#|2013-07-18T16:00:02.639+0200|FINEST|glassfish3.1.2|org.apache.catalina.loader.WebappLoader|_ThreadID=10;_ThreadName=Thread-2;ClassName=null;MethodName=null;|getClasspath
java.lang.NoSuchMethodException: com.sun.enterprise.v3.server.APIClassLoaderServiceImpl$APIClassLoader.getClasspath()
at java.lang.Class.getMethod(Class.java:1607)
at org.apache.catalina.loader.WebappLoader.getClasspath(WebappLoader.java:1196)
at org.apache.catalina.loader.WebappLoader.setClassPath(WebappLoader.java:1145)
at org.apache.catalina.loader.WebappLoader.start(WebappLoader.java:692)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5298)
at com.sun.enterprise.web.WebModule.start(WebModule.java:498)
at org.apache.catalina.core.ContainerBase.startChildren(ContainerBase.java:1518)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1184)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:995)
at org.apache.catalina.core.ContainerBase.startChildren(ContainerBase.java:1518)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1184)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:529)
at org.apache.catalina.startup.Embedded.start(Embedded.java:942)
at com.sun.enterprise.web.WebContainer.postConstruct(WebContainer.java:604)
at com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.java:131)
at com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreator.java:91)
at com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:82)
at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
at com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:78)
at org.glassfish.internal.data.EngineInfo.getContainer(EngineInfo.java:93)
at com.sun.enterprise.v3.services.impl.WebContainerStarter.startWebContainer(WebContainerStarter.java:202)
at com.sun.enterprise.v3.services.impl.WebContainerStarter.postConstruct(WebContainerStarter.java:134)
at com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.java:131)
at com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreator.java:91)
at com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:82)
at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
at com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:78)
at com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.java:253)
at com.sun.enterprise.v3.server.AppServerStartup.doStart(AppServerStartup.java:145)
at com.sun.enterprise.v3.server.AppServerStartup.start(AppServerStartup.java:136)
at com.sun.enterprise.glassfish.bootstrap.GlassFishImpl.start(GlassFishImpl.java:79)
at com.sun.enterprise.glassfish.bootstrap.GlassFishDecorator.start(GlassFishDecorator.java:63)
at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishImpl.start(OSGiGlassFishImpl.java:69)
at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.launch(GlassFishMain.java:117)
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:597)
at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.java:97)
at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:55)

#]

*************

Here is time of first stream corrupted warning log message.
#|2013-07-18T16:06:35.588+0200|WARNING|glassfish3.1.2|javax.enterprise.system.container.web.org.glassfish.web.ha.session.management|_ThreadID=75;_ThreadName=Thread-2;|Exception occurred in getSession

java.io.StreamCorruptedException: invalid type code: 00

Here is ClassNotFoundException that was probably related to that failure. (Note that this is a nested anonymous class. Typically difficult to serialize correctly.)
So the class below is probably one to look at.

[#|2013-07-18T16:06:35.584+0200|FINER|glassfish3.1.2|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=75;_ThreadName=Thread-2;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=findClass;| findClassInternal(com.transat.ga2010.service.BanqueServiceImpl$$EnhancerByCGLIB$$fedb0661)|#]

[#|2013-07-18T16:06:35.584+0200|FINER|glassfish3.1.2|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=75;_ThreadName=Thread-2;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=findClass;| --> Passing on ClassNotFoundException|#]

Here are a large number classes that are being looked for just before this ClassNotFoundException log message.
[#|2013-07-18T16:06:34.749+0200|FINER|glassfish3.1.2|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=75;_ThreadName=Thread-2;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=findClass;| --> Passing on ClassNotFoundException|#]

Note that the classes are mostly UI classes related to ajax, java faces.

[#|2013-07-18T16:06:37.493+0200|FINER|glassfish3.1.2|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=76;_ThreadName=Thread-2;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=findClass;| findClassInternal(com.transat.ga2010.web.messages)|#]
[#|2013-07-18T16:06:37.508+0200|FINER|glassfish3.1.2|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=76;_ThreadName=Thread-2;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=findClass;| findClassInternal(com.transat.ga2010.web.messages_fr)|#]
[#|2013-07-18T16:06:37.514+0200|FINER|glassfish3.1.2|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=76;_ThreadName=Thread-2;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=findClass;| findClassInternal(com.transat.ga2010.web.messages_fr_FR)|#]

[#|2013-07-18T16:06:38.123+0200|FINER|glassfish3.1.2|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=76;_ThreadName=Thread-2;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=findClass;| findClassInternal(org.ajax4jsf.xml.serializer.XMLEntities)|#]
[#|2013-07-18T16:06:38.129+0200|FINER|glassfish3.1.2|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=76;_ThreadName=Thread-2;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=findClass;| findClassInternal(org.ajax4jsf.xml.serializer.XMLEntities_fr)|#]

[#|2013-07-18T16:06:38.137+0200|FINER|glassfish3.1.2|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=76;_ThreadName=Thread-2;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=findClass;| findClassInternal(org.ajax4jsf.xml.serializer.XMLEntities_fr_FR)|#]

[#|2013-07-18T16:06:35.921+0200|FINER|glassfish3.1.2|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=76;_ThreadName=Thread-2;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=findClass;| findClassInternal(org.ajax4jsf.component.AjaxViewRootBeanInfo)|#]

[#|2013-07-18T16:06:35.925+0200|FINER|glassfish3.1.2|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=76;_ThreadName=Thread-2;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=findClass;| findClassInternal(javax.faces.component.UIViewRootBeanInfo)|#]

[#|2013-07-18T16:06:35.926+0200|FINER|glassfish3.1.2|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=76;_ThreadName=Thread-2;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=findClass;| findClassInternal(javax.faces.component.UIComponentBaseBeanInfo)|#]

[#|2013-07-18T16:06:36.012+0200|FINER|glassfish3.1.2|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=76;_ThreadName=Thread-2;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=findClass;| findClassInternal(org.ajax4jsf.messages_fr)|#]

[#|2013-07-18T16:06:36.019+0200|FINER|glassfish3.1.2|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=76;_ThreadName=Thread-2;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=findClass;| findClassInternal(org.ajax4jsf.messages_fr_FR)|#]

[#|2013-07-18T16:06:37.178+0200|FINER|glassfish3.1.2|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=76;_ThreadName=Thread-2;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=findClass;| findClassInternal(com.sun.facelets.compiler.UIInstructionsBeanInfo)|#]

[#|2013-07-18T16:06:37.183+0200|FINER|glassfish3.1.2|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=76;_ThreadName=Thread-2;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=findClass;| findClassInternal(com.sun.facelets.compiler.UILeafBeanInfo)|#]

[#|2013-07-18T16:06:37.190+0200|FINER|glassfish3.1.2|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=76;_ThreadName=Thread-2;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=findClass;| findClassInternal(login)|#]
[#|2013-07-18T16:06:37.198+0200|FINER|glassfish3.1.2|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=76;_ThreadName=Thread-2;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=findClass;| findClassInternal(login_fr_FR)|#]

[#|2013-07-18T16:06:37.205+0200|FINER|glassfish3.1.2|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=76;_ThreadName=Thread-2;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=findClass;| findClassInternal(javax.faces.component.html.HtmlFormBeanInfo)|#]
[#|2013-07-18T16:06:37.207+0200|FINER|glassfish3.1.2|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=76;_ThreadName=Thread-2;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=findClass;| findClassInternal(javax.faces.component.UIFormBeanInfo)|#]

[#|2013-07-18T16:06:37.253+0200|FINER|glassfish3.1.2|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=76;_ThreadName=Thread-2;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=findClass;| findClassInternal(javax.faces.component.html.HtmlMessagesBeanInfo)|#]
[#|2013-07-18T16:06:37.255+0200|FINER|glassfish3.1.2|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=76;_ThreadName=Thread-2;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=findClass;| findClassInternal(javax.faces.component.UIMessagesBeanInfo)|#]
[#|2013-07-18T16:06:37.265+0200|FINER|glassfish3.1.2|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=76;_ThreadName=Thread-2;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=findClass;| findClassInternal(org.richfaces.component.html.HtmlInputTextBeanInfo)|#]
[#|2013-07-18T16:06:37.273+0200|FINER|glassfish3.1.2|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=76;_ThreadName=Thread-2;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=findClass;| findClassInternal(javax.faces.component.UIInputBeanInfo)|#]

[#|2013-07-18T16:06:37.277+0200|FINER|glassfish3.1.2|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=76;_ThreadName=Thread-2;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=findClass;| findClassInternal(javax.faces.component.UIOutputBeanInfo)|#]
[#|2013-07-18T16:06:37.326+0200|FINER|glassfish3.1.2|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=76;_ThreadName=Thread-2;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=findClass;| findClassInternal(org.richfaces.component.html.HtmlInputSecretBeanInfo)|#]

[#|2013-07-18T16:06:37.328+0200|FINER|glassfish3.1.2|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=76;_ThreadName=Thread-2;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=findClass;| findClassInternal(org.richfaces.component.html.HtmlInputSecretBeanInfo)|#]

[#|2013-07-18T16:06:37.341+0200|FINER|glassfish3.1.2|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=76;_ThreadName=Thread-2;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=findClass;| findClassInternal(javax.faces.component.html.HtmlCommandButtonBeanInfo)|#]
[#|2013-07-18T16:06:37.344+0200|FINER|glassfish3.1.2|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=76;_ThreadName=Thread-2;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=findClass;| findClassInternal(javax.faces.component.UICommandBeanInfo)|#]
[#|2013-07-18T16:06:37.392+0200|FINER|glassfish3.1.2|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=76;_ThreadName=Thread-2;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=findClass;| findClassInternal(javax.faces.component.html.HtmlSelectBooleanCheckboxBeanInfo)|#]

[#|2013-07-18T16:06:37.195+0200|FINER|glassfish3.1.2|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=76;_ThreadName=Thread-2;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=findClass;| findClassInternal(login_fr)|#]

[#|2013-07-18T16:06:35.582+0200|FINER|glassfish3.1.2|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=75;_ThreadName=Thread-2;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=loadClass;|loadClass(com.transat.ga2010.service.BanqueServiceImpl$$EnhancerByCGLIB$$fedb0661)|#]

[#|2013-07-18T16:06:35.582+0200|FINER|glassfish3.1.2|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=75;_ThreadName=Thread-2;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=loadClass;| Delegating to classloader1 org.glassfish.internal.api.DelegatingClassLoader@7a8f9805|#]

[#|2013-07-18T16:06:35.584+0200|FINER|glassfish3.1.2|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=75;_ThreadName=Thread-2;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=loadClass;| Searching local repositories|#]

[#|2013-07-18T16:06:35.584+0200|FINER|glassfish3.1.2|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=75;_ThreadName=Thread-2;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=findClass;| findClass(com.transat.ga2010.service.BanqueServiceImpl$$EnhancerByCGLIB$$fedb0661)|#]

[#|2013-07-18T16:06:35.584+0200|FINER|glassfish3.1.2|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=75;_ThreadName=Thread-2;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=findClass;| findClassInternal(com.transat.ga2010.service.BanqueServiceImpl$$EnhancerByCGLIB$$fedb0661)|#]

[#|2013-07-18T16:06:35.584+0200|FINER|glassfish3.1.2|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=75;_ThreadName=Thread-2;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=findClass;| --> Passing on ClassNotFoundException|#]

[#|2013-07-18T16:06:35.582+0200|FINER|glassfish3.1.2|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=75;_ThreadName=Thread-2;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=loadClass;|loadClass(com.transat.ga2010.service.BanqueServiceImpl$$EnhancerByCGLIB$$fedb0661)|#]

[#|2013-07-18T16:06:35.582+0200|FINER|glassfish3.1.2|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=75;_ThreadName=Thread-2;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=loadClass;| Delegating to classloader1 org.glassfish.internal.api.DelegatingClassLoader@7a8f9805|#]

[#|2013-07-18T16:06:35.584+0200|FINER|glassfish3.1.2|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=75;_ThreadName=Thread-2;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=loadClass;| Searching local repositories|#]

[#|2013-07-18T16:06:35.584+0200|FINER|glassfish3.1.2|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=75;_ThreadName=Thread-2;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=findClass;| findClass(com.transat.ga2010.service.BanqueServiceImpl$$EnhancerByCGLIB$$fedb0661)|#]

[#|2013-07-18T16:06:35.584+0200|FINER|glassfish3.1.2|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=75;_ThreadName=Thread-2;ClassName=org.glassfish.web.loader.WebappClassLoader;MethodName=findClass;| findClassInternal(com.transat.ga2010.service.BanqueServiceImpl$$EnhancerByCGLIB$$fedb0661)|#]



 Comments   
Comment by Ed Bratt [ 19/Jul/13 ]

Posting for Reporter. Clear virus scan.

Comment by Sanjeeb Sahoo [ 22/Jul/13 ]

The following exception happens because WebappLoader is reflectively calling getClasspath method in all class loaders in the class loader chain and APIClassLoader does not have such a method. From what I see WebappLoader does not consider this to be an issue, as it logs the exception in FINEST level. So, I am assigning the issue to web container folks to figure out why session replication does not happen.

"[#|2013-07-18T16:00:02.639+0200|FINEST|glassfish3.1.2|org.apache.catalina.loader.WebappLoader|_ThreadID=10;_ThreadName=Thread-2;ClassName=null;MethodName=null;|getClasspath
java.lang.NoSuchMethodException: com.sun.enterprise.v3.server.APIClassLoaderServiceImpl$APIClassLoader.getClasspath()

Thanks,
Sahoo

Comment by Shing Wai Chan [ 06/Aug/13 ]

Can you attach a test case for this?

Comment by alev50 [ 12/Aug/13 ]

Not really, I deploy my production web app on a cluster, I stop the current instance and replication fails on a StreamCorruptedException. How could I write a simple test case for this ?

Thanks,

Anthony

Comment by Shing Wai Chan [ 12/Aug/13 ]

We have a unit test for session replication. It is working fine. So, we need more information to debug this. Can you try to construct a unit test case?

Comment by Shing Wai Chan [ 13/Aug/13 ]

Assign to Rajiv for session replication issue.





[GLASSFISH-21073] GlassFish Fails to Deploy WAR With JodaTime Library Dependency Created: 27/May/14  Updated: 23/Apr/15

Status: Open
Project: glassfish
Component/s: web_container
Affects Version/s: 4.0
Fix Version/s: None

Type: Bug Priority: Blocker
Reporter: peter_pilgrim Assignee: Shing Wai Chan
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: javaee_ri_target

 Description   

I discovered that GlassFish fails to deploy WAR with JodaTime Library Dependency. It results in a ClassNotFoundException. I suspect that this is classloader hierarchy issue.

Here is the stacktrace:

[2014-05-27T10:10:04.696+0100] [glassfish 4.0] [SEVERE] [] [javax.enterprise.system.core] [tid: _ThreadID=44 _ThreadName=admin-listener(4)] [timeMillis: 1401181804696] [levelValue: 1000] [[
Exception while loading the app : javax.ejb.CreateException: Initialization failed for Singleton PopulateDataService
javax.ejb.CreateException: Initialization failed for Singleton PopulateDataService
at com.sun.ejb.containers.AbstractSingletonContainer.createSingletonEJB(AbstractSingletonContainer.java:476)
at com.sun.ejb.containers.AbstractSingletonContainer.access$000(AbstractSingletonContainer.java:74)
at com.sun.ejb.containers.AbstractSingletonContainer$SingletonContextFactory.create(AbstractSingletonContainer.java:647)
at com.sun.ejb.containers.AbstractSingletonContainer.instantiateSingletonInstance(AbstractSingletonContainer.java:389)
at org.glassfish.ejb.startup.SingletonLifeCycleManager.initializeSingleton(SingletonLifeCycleManager.java:219)
at org.glassfish.ejb.startup.SingletonLifeCycleManager.initializeSingleton(SingletonLifeCycleManager.java:180)
at org.glassfish.ejb.startup.SingletonLifeCycleManager.doStartup(SingletonLifeCycleManager.java:158)
at org.glassfish.ejb.startup.EjbApplication.start(EjbApplication.java:166)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:500)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:539)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:535)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:356)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:534)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:565)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:557)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:356)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:556)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1464)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1300(CommandRunnerImpl.java:109)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1846)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1722)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534)
at com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224)
at org.glassfish.grizzly.http.server.StaticHttpHandlerBase.service(StaticHttpHandlerBase.java:189)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:215)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:291)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:209)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:137)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:115)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:550)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.Exception: java.lang.NoClassDefFoundError: org/joda/time/DateTime
at com.sun.ejb.containers.interceptors.CallbackInvocationContext.proceed(CallbackInvocationContext.java:209)
at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:55)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.sun.ejb.containers.interceptors.CallbackInterceptor.intercept(InterceptorManager.java:986)
at com.sun.ejb.containers.interceptors.CallbackChainImpl.invokeNext(CallbackChainImpl.java:72)
at com.sun.ejb.containers.interceptors.CallbackInvocationContext.proceed(CallbackInvocationContext.java:205)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doCall(SystemInterceptorProxy.java:163)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.init(SystemInterceptorProxy.java:125)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.sun.ejb.containers.interceptors.CallbackInterceptor.intercept(InterceptorManager.java:986)
at com.sun.ejb.containers.interceptors.CallbackChainImpl.invokeNext(CallbackChainImpl.java:72)
at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:412)
at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:375)
at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:2014)
at com.sun.ejb.containers.AbstractSingletonContainer.createSingletonEJB(AbstractSingletonContainer.java:468)
... 49 more
Caused by: java.lang.NoClassDefFoundError: org/joda/time/DateTime
at uk.co.xenonique.digital.PopulateDataService.populate(PopulateDataService.java:50)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.sun.ejb.containers.interceptors.BeanCallbackInterceptor.intercept(InterceptorManager.java:1035)
at com.sun.ejb.containers.interceptors.CallbackChainImpl.invokeNext(CallbackChainImpl.java:72)
at com.sun.ejb.containers.interceptors.CallbackInvocationContext.proceed(CallbackInvocationContext.java:205)
... 69 more
Caused by: java.lang.ClassNotFoundException: org.joda.time.DateTime
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1783)
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1633)
... 77 more
]]

This is serious blocker to any application that prefers to use JodaTime.

The Gradle dependency is this:

dependencies {
compile 'org.glassfish.main.extras:glassfish-embedded-all:4.0.1-b01'
providedCompile 'javax:javaee-api:7.0'

// WARNING: Joda time is broken with Glassfish 4
compile 'joda-time:joda-time:2.2'
compile 'org.slf4j:slf4j-simple:1.6.4'
compile 'com.javaeehandbook.book1:glassfish-embedded-runner:1.0'
compile 'org.jboss.shrinkwrap:shrinkwrap-api:1.0.1'
compile 'org.jboss.shrinkwrap:shrinkwrap-impl-base:1.0.1'

testCompile 'junit:junit:4.11'
}

And the test EJB class looks like this:

package uk.co.xenonique.digital;

import org.joda.time.DateTime;

import javax.annotation.PostConstruct;
import javax.ejb.Singleton;
import javax.ejb.Startup;
import javax.inject.Inject;
import java.util.Calendar;

/**

  • The type PopulateDataService
    *
  • @author Peter Pilgrim
    */
    @Singleton
    @Startup
    public class PopulateDataService {

@Inject
ContactDetailService contactDetailService;

@PostConstruct
public void populate()

{ Calendar cal = Calendar.getInstance(); ContactDetail contact2 = new ContactDetail(); contact2.setAllowEmails(false); contact2.setTitle("Ms"); contact2.setEmail("oprah.winfrey@harpo.com"); contact2.setFirstName("Oprah"); contact2.setMiddleName("Gail"); contact2.setLastName("Winfrey"); cal.set(1954,1,29); contact2.setDob(cal.getTime()); contactDetailService.add(contact2); DateTime dt = new DateTime(); System.out.printf("dt=%s",dt); }

}

The WAR file extracted looks like this:

0 Sun May 25 10:44:46 BST 2014 WEB-INF/lib/
573912 Wed Dec 11 20:13:10 GMT 2013 WEB-INF/lib/joda-time-2.2.jar
7662 Wed Dec 11 20:15:52 GMT 2013 WEB-INF/lib/slf4j-simple-1.6.4.jar
62589 Tue Dec 10 07:59:06 GMT 2013 WEB-INF/lib/shrinkwrap-api-1.0.1.jar
146419 Tue Dec 10 07:59:06 GMT 2013 WEB-INF/lib/shrinkwrap-impl-base-1.0.1.jar
25962 Wed Dec 11 20:15:52 GMT 2013 WEB-INF/lib/slf4j-api-1.6.4.jar
3648 Tue Dec 10 07:59:06 GMT 2013 WEB-INF/lib/shrinkwrap-spi-1.0.1.jar



 Comments   
Comment by Sanjeeb Sahoo [ 11/Aug/14 ]

Assigning to web container team to analyse why webapp class loader is not able to load org.joda.time.DateTime.class. May be this is specific to embedded glassfish in which case web container team can assign to embedded team.

Comment by Shing Wai Chan [ 15/Oct/14 ]

Can you provide a test war for this?





[GLASSFISH-21228] glassfish web IO hangs on html5 video requests(mp4) from client Created: 09/Oct/14  Updated: 23/Apr/15

Status: Open
Project: glassfish
Component/s: web_container
Affects Version/s: 3.1.2_b22
Fix Version/s: None

Type: Bug Priority: Blocker
Reporter: pradyut Assignee: oleksiys
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Glassfish running on any envirenment, Client is Google Chrome


Tags: javaee_ri_target

 Description   

This is related to Grizzly.

Caused by: java.io.IOException: Client is busy or timed out
at com.sun.grizzly.util.OutputWriter.flushChannel(OutputWriter.java:129)
at com.sun.grizzly.util.OutputWriter.flushChannel(OutputWriter.java:76)


 Comments   
Comment by pradyut [ 09/Oct/14 ]

Any further requests to the server fails and the proxy server shows that the server failed to respond to the GET request.
Shutting down the client browser(chrome) resumes the services from the server.

The logs show -

org.apache.catalina.connector.ClientAbortException: java.io.IOException: Client is busy or timed out
at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:430)
at com.sun.grizzly.util.buf.ByteChunk.flushBuffer(ByteChunk.java:458)
at com.sun.grizzly.util.buf.ByteChunk.append(ByteChunk.java:380)
at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:455)
at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:442)
at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:160)
at org.apache.catalina.servlets.DefaultServlet.copyRange(DefaultServlet.java:2365)
at org.apache.catalina.servlets.DefaultServlet.copy(DefaultServlet.java:2100)
at org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.java:1090)
at org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:466)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
at newa.StoreImage.doFilter(StoreImage.java:100)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
at newa.CEFilter.doFilter(CEFilter.java:193)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: Client is busy or timed out
at com.sun.grizzly.util.OutputWriter.flushChannel(OutputWriter.java:129)
at com.sun.grizzly.util.OutputWriter.flushChannel(OutputWriter.java:76)
at com.sun.grizzly.http.SocketChannelOutputBuffer.flushChannel(SocketChannelOutputBuffer.java:426)
at com.sun.grizzly.http.SocketChannelOutputBuffer.flushBuffer(SocketChannelOutputBuffer.java:498)
at com.sun.grizzly.http.SocketChannelOutputBuffer.realWriteBytes0(SocketChannelOutputBuffer.java:382)
at com.sun.grizzly.http.SocketChannelOutputBuffer.realWriteBytes(SocketChannelOutputBuffer.java:364)
at com.sun.grizzly.tcp.http11.InternalOutputBuffer$OutputStreamOutputBuffer.doWrite

(InternalOutputBuffer.java:894)
at com.sun.grizzly.tcp.http11.filters.IdentityOutputFilter.doWrite(IdentityOutputFilter.java:159)
at com.sun.grizzly.tcp.http11.InternalOutputBuffer.doWrite(InternalOutputBuffer.java:661)
at com.sun.grizzly.tcp.Response.doWrite(Response.java:685)
at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:425)
... 43 more

#]

at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:430)|#]

at com.sun.grizzly.util.buf.ByteChunk.flushBuffer(ByteChunk.java:458)|#]

at com.sun.grizzly.util.buf.ByteChunk.append(ByteChunk.java:380)|#]

at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:455)|#]

at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:442)|#]

at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:160)|#]

at org.apache.catalina.servlets.DefaultServlet.copyRange(DefaultServlet.java:2365)|#]

at org.apache.catalina.servlets.DefaultServlet.copy(DefaultServlet.java:2100)|#]

at org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.java:1090)|#]

at org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:466)|#]

at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)|#]

at javax.servlet.http.HttpServlet.service(HttpServlet.java:770)|#]

at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1550)|#]

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)|#]

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)|#]

at newa.StoreImage.doFilter(StoreImage.java:100)|#]

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)|#]

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)|#]

at newa.CEFilter.doFilter(CEFilter.java:193)|#]

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)|#]

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)|#]

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)|#]

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)|#]

at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)|#]

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)|#]

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)|#]

at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)|#]

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)|#]

at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)|#]

at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)|#]

at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)|#]

at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)|#]

at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)|#]

at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)|#]

at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)|#]

at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)|#]

at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)|#]

at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)|#]

at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)|#]

at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)|#]

at com.sun.grizzly.ContextTask.run(ContextTask.java:71)|#]

at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)|#]

at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)|#]

at java.lang.Thread.run(Thread.java:745)|#]

Caused by: java.io.IOException: Client is busy or timed out|#]

at com.sun.grizzly.util.OutputWriter.flushChannel(OutputWriter.java:129)|#]

at com.sun.grizzly.util.OutputWriter.flushChannel(OutputWriter.java:76)|#]

at com.sun.grizzly.http.SocketChannelOutputBuffer.flushChannel(SocketChannelOutputBuffer.java:426)|#]

at com.sun.grizzly.http.SocketChannelOutputBuffer.flushBuffer(SocketChannelOutputBuffer.java:498)|#]

at com.sun.grizzly.http.SocketChannelOutputBuffer.realWriteBytes0(SocketChannelOutputBuffer.java:382)|#]

at com.sun.grizzly.http.SocketChannelOutputBuffer.realWriteBytes(SocketChannelOutputBuffer.java:364)|#]

at com.sun.grizzly.tcp.http11.InternalOutputBuffer$OutputStreamOutputBuffer.doWrite

(InternalOutputBuffer.java:894)|#]

at com.sun.grizzly.tcp.http11.filters.IdentityOutputFilter.doWrite(IdentityOutputFilter.java:159)|#]

at com.sun.grizzly.tcp.http11.InternalOutputBuffer.doWrite(InternalOutputBuffer.java:661)|#]

at com.sun.grizzly.tcp.Response.doWrite(Response.java:685)|#]

at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:425)|#]

... 43 more|#]

Comment by oleksiys [ 15/Oct/14 ]

Can you pls. clarify, after hitting the problem the server is not able to respond to a simple GET from the same browser? What about other browsers/clients are they still ok?
And everything comes to normal after you restart the client/browser, not the server, right?





[GLASSFISH-21278] SessionScoped object sharing between different sessions when Async Servlet 3.0 involved in execution path Created: 22/Dec/14  Updated: 23/Apr/15

Status: Open
Project: glassfish
Component/s: web_container, web_socket
Affects Version/s: 3.1.2.2
Fix Version/s: None

Type: Bug Priority: Blocker
Reporter: moonysun Assignee: oleksiys
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

JDK 1.7.0_62


Tags: javaee_ri_target

 Description   

We've noticed a bug related to Session "sharing" between threads when using the Servlet 3.0 Async implementation in Glassfish.
If few users log in to the application, use an Async Servlet and logout, there is a reuse of a @javax.enterprise.context.SessionScoped object between the frontend threads.

Find attached a test case that easely reproduces the errors, with the following configuration at the application server domain:

server-config -> Web Container -> (Tab) Manager Properties -> Max Sessions: 2
server-config -> Thread Pools -> http-thread-pool -> Max Thread Pool Size : 6, Min Thread Pool Size: 6
server-config -> Network Config -> Network Listeners -> http-listener-1 -> (Tab) HTTP -> Comet Support: true, Websocket support: true

The code is commented to enable easy change, and STOP the problem from happening by setting asyncSupported=false in both the AuditFilter and the AsyncDownloadProxy servlet (the AsyncDownloadProxy servlet has comments to indicate where to change the code to support synchronous mode only - marked by "//COMMENT FOR SYNC TESTING")...

The problem shows in the domain's server.log file in the following forms:

1.Looking for the String "REUSING INSTANCES", as by this example:

[#|2014-11-17T17:16:19.624+0000|INFO|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=108;_ThreadName=Thread-2;|AuditFilter: ************** REUSING INSTANCES!!!!!|#]

2. Checking for this exception in the logs:
[#|2014-11-17T17:16:21.059+0000|SEVERE|glassfish3.1.2|com.sun.grizzly.config.GrizzlyServiceListener|_ThreadID=108;_ThreadName=Thread-2;|java.lang.NullPointerException
at com.sun.grizzly.arp.AsyncProcessorTask.obtainAndSetThreadAttachment(AsyncProcessorTask.java:233)
at com.sun.grizzly.arp.AsyncProcessorTask.enableTimeout(AsyncProcessorTask.java:227)
at com.sun.grizzly.arp.AsyncProcessorTask.doTask(AsyncProcessorTask.java:131)
at com.sun.grizzly.http.TaskBase.run(TaskBase.java:193)
at com.sun.grizzly.http.TaskBase.execute(TaskBase.java:175)
at com.sun.grizzly.arp.DefaultAsyncHandler.handle(DefaultAsyncHandler.java:145)
at com.sun.grizzly.arp.AsyncProtocolFilter.execute(AsyncProtocolFilter.java:210)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:745)

#]

[#|2014-11-17T17:16:21.060+0000|INFO|glassfish3.1.2|com.sun.grizzly.config.GrizzlyServiceListener|_ThreadID=108;_ThreadName=Thread-2;|Processor exception
java.lang.RuntimeException: java.lang.NullPointerException
at com.sun.grizzly.arp.AsyncProcessorTask.doTask(AsyncProcessorTask.java:144)
at com.sun.grizzly.http.TaskBase.run(TaskBase.java:193)
at com.sun.grizzly.http.TaskBase.execute(TaskBase.java:175)
at com.sun.grizzly.arp.DefaultAsyncHandler.handle(DefaultAsyncHandler.java:145)
at com.sun.grizzly.arp.AsyncProtocolFilter.execute(AsyncProtocolFilter.java:210)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
at com.sun.grizzly.arp.AsyncProcessorTask.obtainAndSetThreadAttachment(AsyncProcessorTask.java:233)
at com.sun.grizzly.arp.AsyncProcessorTask.enableTimeout(AsyncProcessorTask.java:227)
at com.sun.grizzly.arp.AsyncProcessorTask.doTask(AsyncProcessorTask.java:131)
... 14 more

#]

We've allready tried to use the following strategies:
1. Update the grizzly-*.jar from the "modules" directory (don't forget to clean the osgi-cache from the domain dir after this process) to the latest minor released version 1.9.60
2. Update only the grizzly-websockets.jar with the fix indicated at the https://java.net/jira/browse/GRIZZLY-1289

None of them resolved the problem efectively.

Moreover, the NullPointerException is confirmed on this line:

case AsyncTask.FINISH:
enableTimeout();

asyncExecutor.finishExecute();
asyncExecutor.getAsyncHandler().returnTask(this);
return;

caused by the highlighted code returning "null".

final SelectionKey selectionKey = asyncExecutor.getProcessorTask().getSelectionKey();

And I think that on NPE, the code

asyncExecutor.finishExecute();

is not allowed to run, and so the "session" is left associated with the thread, which will come to cause trouble later on following requests.

The most similar report we found is on StackOverflow:
http://stackoverflow.com/questions/25017334/weld-gf4-sessionscoped-sometimes-wrong-bean
which states the same problem very accurately, although with Glassfish 4 instead.



 Comments   
Comment by moonysun [ 22/Dec/14 ]

I also have example code to show this (the code that is referenced by my initial comment) but I can't seem to find any way to upload it to the issue...

Comment by oleksiys [ 22/Dec/14 ]

can you pls. try to apply this patch first
https://dl.dropboxusercontent.com/u/7319744/grizzly-gf3122-patch.zip
?

If you still can reproduce the problem - then we'll need a testcase. Unfortunately you can't upload it here

Comment by moonysun [ 23/Dec/14 ]

Bug is still very much reproducible even with the patch provided.

During this last test, some exceptions showed up in the logs:

[#|2014-12-23T01:49:13.524+0000|SEVERE|glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=83;_ThreadName=Thread-2;|WebModule[/session-share-bug]PWC1322: Error invoking requestDestroyed method on ServletRequestListener org.jboss.weld.servlet.WeldListener
java.lang.IllegalArgumentException: null source
at java.util.EventObject.<init>(EventObject.java:56)
at javax.servlet.ServletRequestEvent.<init>(ServletRequestEvent.java:77)
at javax.servlet.ServletRequestAttributeEvent.<init>(ServletRequestAttributeEvent.java:83)
at org.apache.catalina.connector.Request.removeAttribute(Request.java:1625)
at org.apache.catalina.connector.RequestFacade.removeAttribute(RequestFacade.java:581)
at org.jboss.weld.context.http.HttpConversationContextImpl.removeRequestAttribute(HttpConversationContextImpl.java:32)
at org.jboss.weld.context.http.HttpConversationContextImpl.removeRequestAttribute(HttpConversationContextImpl.java:12)
at org.jboss.weld.context.AbstractConversationContext.dissociate(AbstractConversationContext.java:163)
at org.jboss.weld.servlet.WeldListener.requestDestroyed(WeldListener.java:117)
at org.apache.catalina.core.StandardContext.fireRequestDestroyedEvent(StandardContext.java:4648)
at org.apache.catalina.core.StandardHostValve.postInvoke(StandardHostValve.java:242)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:333)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1042)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:745)

#]

and

[#|2014-12-23T01:49:14.772+0000|SEVERE|glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=85;_ThreadName=Thread-2;|WebModule[/session-share-bug]PWC1322: Error invoking requestDestroyed method on ServletRequestListener org.jboss.weld.servlet.WeldListener
java.lang.NullPointerException
at org.apache.catalina.connector.Request.doGetSession(Request.java:2845)
at org.apache.catalina.connector.Request.getSession(Request.java:2583)
at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:920)
at org.jboss.weld.context.http.HttpConversationContextImpl.setSessionAttribute(HttpConversationContextImpl.java:16)
at org.jboss.weld.context.http.HttpConversationContextImpl.setSessionAttribute(HttpConversationContextImpl.java:12)
at org.jboss.weld.context.AbstractConversationContext.dissociate(AbstractConversationContext.java:157)
at org.jboss.weld.servlet.WeldListener.requestDestroyed(WeldListener.java:117)
at org.apache.catalina.core.StandardContext.fireRequestDestroyedEvent(StandardContext.java:4648)
at org.apache.catalina.core.StandardHostValve.postInvoke(StandardHostValve.java:242)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:333)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1042)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:745)
14566,15-22 72%

and even more:

[#|2014-12-23T01:49:13.973+0000|SEVERE|glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=82;_ThreadName=Thread-2;|WebModule[/session-share-bug]PWC1322: Error invoking requestDestroyed method on ServletRequestListener org.jboss.weld.servlet.WeldListener
java.lang.NullPointerException
at org.apache.catalina.connector.Request.removeAttribute(Request.java:1621)
at org.apache.catalina.connector.RequestFacade.removeAttribute(RequestFacade.java:581)
at org.jboss.weld.context.http.HttpConversationContextImpl.removeRequestAttribute(HttpConversationContextImpl.java:32)
at org.jboss.weld.context.http.HttpConversationContextImpl.removeRequestAttribute(HttpConversationContextImpl.java:12)
at org.jboss.weld.context.AbstractConversationContext.dissociate(AbstractConversationContext.java:163)
at org.jboss.weld.servlet.WeldListener.requestDestroyed(WeldListener.java:117)
at org.apache.catalina.core.StandardContext.fireRequestDestroyedEvent(StandardContext.java:4648)
at org.apache.catalina.core.StandardHostValve.postInvoke(StandardHostValve.java:242)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:333)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1042)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:745)

#]

Relative to the test, at this web addres:

https://www.dropbox.com/sh/stk0cgehvch4ecd/AABI-mPTo9722U5PiIxMNFfCa?dl=0

You will find three files:
session-share-bug.war (deploy to glassfish)
session-share-bug.zip (maven project source code)
TestCDILogout.jmx (jmeter test plan to show the problem)

To reproduce the issue:
Use apache-jmeter to run the TestCDILogout.jmx

and loof for messages in the server.log as:

REUSING

Comment by oleksiys [ 24/Dec/14 ]

Just wanted to confirm, you are able to reproduce the problem with only one jmeter user thread?
How long you normally wait?

Comment by jpereira@linkare.com [ 24/Dec/14 ]

I am able to reproduce it with 2 user threads. But with 10 users it takes about 1 min (sometimes less) to get a few errors like the one i mentioned (finding in the logs REUSING is considered an error as you might understand from the code for obvious reasons).

I can also do it using two browsers each with two tabs/windows and hitting refresh in a quick but random order on the two servlet urls... so you don't actually need too much load to run into it...

Comment by oleksiys [ 25/Dec/14 ]

Pls. try this patch

https://dl.dropboxusercontent.com/u/7319744/grizzly-gf3122-patch.zip

Comment by moonysun [ 25/Dec/14 ]

Nope. Still nothing changes... It even looks like the problem repeated faster... (but that might be my new laptop being faster).

Oh, and by the way, I tested again with a single thread on jmeter and the problem also shows.

Comment by oleksiys [ 25/Dec/14 ]

can you pls. attach the stacktrace?

Comment by moonysun [ 25/Dec/14 ]

The problem shows up even in the event of no StackTrace.
I hope you understand the severity of the problem of sharing session objects in between sessions from different users.

Sometimes, this NPE also shows up, but it is quite rare:

[#|2014-12-25T20:06:08.337+0000|SEVERE|glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=94;_ThreadName=Thread-2;|WebModule[/session-share-bug]PWC1322: Error invoking requestDestroyed method on ServletRequestListener org.jboss.weld.servlet.WeldListener
java.lang.NullPointerException
at org.apache.catalina.connector.Request.doGetSession(Request.java:2845)
at org.apache.catalina.connector.Request.getSession(Request.java:2583)
at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:920)
at org.jboss.weld.context.http.HttpConversationContextImpl.getSessionAttribute(HttpConversationContextImpl.java:23)
at org.jboss.weld.context.http.HttpConversationContextImpl.getSessionAttribute(HttpConversationContextImpl.java:12)
at org.jboss.weld.context.AbstractConversationContext.dissociate(AbstractConversationContext.java:156)
at org.jboss.weld.servlet.WeldListener.requestDestroyed(WeldListener.java:117)
at org.apache.catalina.core.StandardContext.fireRequestDestroyedEvent(StandardContext.java:4648)
at org.apache.catalina.core.StandardHostValve.postInvoke(StandardHostValve.java:242)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:333)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1042)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:745)

#]
Comment by oleksiys [ 25/Dec/14 ]

Do you see NPE similar to the one you reported earlier:

_ThreadName=Thread-2;|java.lang.NullPointerException
at com.sun.grizzly.arp.AsyncProcessorTask.obtainAndSetThreadAttachment(AsyncProcessorTask.java:233)
at com.sun.grizzly.arp.AsyncProcessorTask.enableTimeout(AsyncProcessorTask.java:227)
at com.sun.grizzly.arp.AsyncProcessorTask.doTask(AsyncProcessorTask.java:131)
.....

?

Comment by jpereira@linkare.com [ 25/Dec/14 ]

This time I didn't. But before it only showed up sometimes so there is an amount of uncertainty on tthe observation

even so the main issue of session sharing is still present

Comment by oleksiys [ 26/Dec/14 ]

I think Grizzly part is fixed, the rest IMO is related to webcontainer.
It (webcontainer) must not executes chain postInvoke in the service() thread, if Servlet request was suspended.

Comment by jpereira@linkare.com [ 26/Dec/14 ]

Ok. So I will test your last patch more throughly and report if I can find the NPE or some other bugs related to grizzly... meanwhile have you seen my initial comment stating that an error at the enableTimeout() method call would never allow the finishExecute to be reached?

One other thing... what were the code changes related to your last patch?

Comment by oleksiys [ 26/Dec/14 ]

Right, enableTimeout() race is fixed
https://java.net/jira/browse/GRIZZLY-1729

Comment by moonysun [ 26/Dec/14 ]

So now, as far as I can tell, the only exceptions that remained are:

[#|2014-12-26T22:13:28.230+0000|SEVERE|glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=75;_ThreadName=Thread-2;|WebModule[/session-share-bug]PWC1322: Error invoking requestDestroyed method on ServletRequestListener org.jboss.weld.servlet.WeldListener
java.lang.NullPointerException
at org.apache.catalina.connector.Request.removeAttribute(Request.java:1621)
at org.apache.catalina.connector.RequestFacade.removeAttribute(RequestFacade.java:581)
at org.jboss.weld.context.http.HttpConversationContextImpl.removeRequestAttribute(HttpConversationContextImpl.java:32)
at org.jboss.weld.context.http.HttpConversationContextImpl.removeRequestAttribute(HttpConversationContextImpl.java:12)
at org.jboss.weld.context.AbstractConversationContext.dissociate(AbstractConversationContext.java:163)
at org.jboss.weld.servlet.WeldListener.requestDestroyed(WeldListener.java:117)
at org.apache.catalina.core.StandardContext.fireRequestDestroyedEvent(StandardContext.java:4648)
at org.apache.catalina.core.StandardHostValve.postInvoke(StandardHostValve.java:242)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:333)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1042)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:745)

#]

-------------------------

[#|2014-12-26T22:13:28.235+0000|SEVERE|glassfish3.1.2|org.apache.catalina.connector.CoyoteAdapter|_ThreadID=75;_ThreadName=Thread-2;|PWC3989: An exception or error occurred in the container during the request processing
java.lang.NullPointerException
at org.apache.catalina.connector.Request.setAttribute(Request.java:1689)
at org.apache.catalina.connector.RequestFacade.setAttribute(RequestFacade.java:570)
at org.apache.catalina.core.StandardContext.fireRequestDestroyedEvent(StandardContext.java:4654)
at org.apache.catalina.core.StandardHostValve.postInvoke(StandardHostValve.java:242)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:333)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1042)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:745)

#]

------------------------------------

[#|2014-12-26T22:13:32.325+0000|SEVERE|glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=79;_ThreadName=Thread-2;|WebModule[/session-share-bug]PWC1322: Error invoking requestDestroyed method on ServletRequestListener org.jboss.weld.servlet.WeldListener
java.lang.NullPointerException
at org.jboss.weld.context.http.HttpConversationContextImpl.getSessionAttribute(HttpConversationContextImpl.java:24)
at org.jboss.weld.context.http.HttpConversationContextImpl.getSessionAttribute(HttpConversationContextImpl.java:12)
at org.jboss.weld.context.AbstractConversationContext.dissociate(AbstractConversationContext.java:159)
at org.jboss.weld.servlet.WeldListener.requestDestroyed(WeldListener.java:117)
at org.apache.catalina.core.StandardContext.fireRequestDestroyedEvent(StandardContext.java:4648)
at org.apache.catalina.core.StandardHostValve.postInvoke(StandardHostValve.java:242)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:333)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1042)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:745)

#]

--------------------------------------------

[#|2014-12-26T22:13:39.775+0000|SEVERE|glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=77;_ThreadName=Thread-2;|WebModule[/session-share-bug]PWC1322: Error invoking requestDestroyed method on ServletRequestListener org.jboss.weld.servlet.WeldListener
java.lang.NullPointerException
at org.apache.catalina.connector.Request.doGetSession(Request.java:2845)
at org.apache.catalina.connector.Request.getSession(Request.java:2583)
at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:920)
at org.jboss.weld.context.http.HttpConversationContextImpl.getSessionAttribute(HttpConversationContextImpl.java:23)
at org.jboss.weld.context.http.HttpConversationContextImpl.getSessionAttribute(HttpConversationContextImpl.java:12)
at org.jboss.weld.context.AbstractConversationContext.dissociate(AbstractConversationContext.java:156)
at org.jboss.weld.servlet.WeldListener.requestDestroyed(WeldListener.java:117)
at org.apache.catalina.core.StandardContext.fireRequestDestroyedEvent(StandardContext.java:4648)
at org.apache.catalina.core.StandardHostValve.postInvoke(StandardHostValve.java:242)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:333)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1042)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:745)

#]

------------------------------------------

[#|2014-12-26T22:13:46.649+0000|WARNING|glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=78;_ThreadName=Thread-2;|StandardWrapperValve[AsyncDownloadProxy]: PWC1406: Servlet.service() for servlet AsyncDownloadProxy threw exception
java.lang.IllegalStateException: Missing wrapper
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:226)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
at pt.segsocial.ii.session.AuditFilter.doFilter(AuditFilter.java:63)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:217)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:331)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1042)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:745)

#]

---------------------------------------------------------

And the main problem still remains, as reported in the initial statement.

Comment by moonysun [ 26/Dec/14 ]

Meanwhile, sorry for bothering, but the error still seems to be present, just by inspection of the code... I'll explain my reasoning:

in the following lines, at method doTask of class AsyncProcessor Task:

case AsyncTask.FINISH:
enableTimeout(); //If this method fails for some reason, the "finishExecute" will never get called...

asyncExecutor.finishExecute(); //this might never get called at all, if enableTimeout() above fails
asyncExecutor.getAsyncHandler().returnTask(this);
return;

on the other hand, at the method enableTimeout(), we have:

private void enableTimeout()

{ final ThreadAttachment attachment = obtainAndSetThreadAttachment();//check this method for possible exceptions... attachment.setIdleTimeoutDelay(SelectionKeyAttachment.UNSET_TIMEOUT); //this is not prone to exceptions unless "attachment" is null attachment.setTimeout(System.currentTimeMillis()); //this is not prone to exceptions unless "attachment" is null }

and on the method obtainAndSetThreadAttachment() we have:

private ThreadAttachment obtainAndSetThreadAttachment() {
final ProcessorTask processorTask = asyncExecutor.getProcessorTask();//
final SelectionKey selectionKey = processorTask.getSelectionKey();

//those two previous lines were previously written
//final SelectionKey selectionKey = asyncExecutor.getProcessorTask().getSelectionKey();
//so the NPE at asyncExecutor.getProcessorTask() might still occur nonetheless...

Object attachment = selectionKey.attachment();
if (attachment == null || !(attachment instanceof ThreadAttachment))

{ attachment = obtainThreadAttachment(); selectionKey.attach(attachment); }

return (ThreadAttachment) attachment;
}

(check my comments in the code snippets above)...

-------------------------

Nonetheless, I made a more comprehensive run (100 virtual users, download -> logout) and I didn't find the original NPE in the logs anymore...

Comment by jpereira@linkare.com [ 10/Feb/15 ]

Bump





[GLASSFISH-20842] X-Forwarded-Proto not honored by glassfish 4.0 Created: 02/Oct/13  Updated: 09/Apr/15  Resolved: 09/Apr/15

Status: Resolved
Project: glassfish
Component/s: web_container
Affects Version/s: 4.0
Fix Version/s: 4.2

Type: Bug Priority: Major
Reporter: marcos_sakamoto Assignee: Arindam Bandyopadhyay
Resolution: Fixed Votes: 8
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Linux and Windows


Issue Links:
Relates
relates to GLASSFISH-18685 X-Forwarded-Proto not honored by glas... Resolved
Tags: javaee_ri_fix, payara, ssl-offload

 Description   

I'm using a NginX server as a SSL terminating proxy and set the following HTTP headers:

Host: <NginX host>
X-Forwarded-Proto: https

In Glassfish I set the following property:

asadmin set server.network-config.protocols.protocol.http-listener-1.http.scheme-mapping=X-Forwarded-Proto

Glassfish ignores the X-Forwarded-Proto and uses HTTP to build HttpServletRequest.getRequestURL() or evaluate HttpServletRequest.getScheme() and HttpServletRequest.isSecure()

I've tested on both Glassfish 3.1.2.2 and Glassfish 4.0 and on Glassfish 3.1.2.2 works like a charm!
But it's not working on Glassfish 4.0! Seems a regression? (Similar issue https://java.net/jira/browse/GLASSFISH-18685)



 Comments   
Comment by frederickkaempfer [ 06/Oct/14 ]

The issue still exists on Glassfish 4.1. Probably the patch in GLASSFISH-18685 was never ported to the 4.x branch.

Comment by juliohm1978 [ 06/Oct/14 ]

I can't express how disappointing that is. We were waiting for 4.1 hoping this would be fixed in the official release

Comment by smillidge-c2b2 [ 07/Oct/14 ]

If you have the patch available I can see if we can get it into a Payara build and upstream into a later GlassFish

Comment by notabenem [ 25/Nov/14 ]

I really need this patched in GF4.1 / payara. After a long-long search, I have finally found the patch needed (hopefully).
It was committed against Grizzly 1.9.50 and likely backported to 1.9.46 (based on the zips attached to GLASSFISH-18685).

The ticket in question with the corresponding commits is the following: GRIZZLY-1281
Commits: 6b35876, 42089bc and 58ce8c4
Note, it was committed against 1.9.50. Apparently (according to GIT), these fixes were not applied to branch 2.2.x (and thus neither to 2.3.x)

PS: I created a patch (created from those commits), but can't upload it here.

Comment by smillidge-c2b2 [ 25/Nov/14 ]

I've created this to see if we can help out and test this https://github.com/payara/Payara/issues/75

Comment by notabenem [ 26/Nov/14 ]

One more thing: I noticed the fix(es) for GRIZZLY-1281 were also included in the main trunk. Commits: e54698c and ed7de1e.
According to the git log, these commits made their ways to the 'master' branch, but never into the '2.3.x' branch from which the Glassfish 4.1 branch was forked.
BTW: not sure how the 2.3.x branch was kept up to date. The first commit in this branch after 8/6/2012 (commit e54698c) is from 3/6/2013 (a year later, commit: 09d8c82) and even that commit was not a squashed commit of all changes from master. Strange. Seems like a completely isolated branch from master

Comment by smillidge-c2b2 [ 26/Nov/14 ]

I would also suggest you raise the issue within the Grizzly project as the fix needs to go into Grizzly rather than GlassFish.

Comment by notabenem [ 26/Nov/14 ]

Check out the Payara issue linked above for the pull-request to have this solved. I also have a patched nucleus-grizzly-all.jar, but can't attach it here.
The related GRIZZLY issue is GRIZZLY-1720

Comment by Arindam Bandyopadhyay [ 27/Mar/15 ]

Hi Oleksiy,
I saw your git comment that GRIZZLY-1720 is merged on 2.3.x and glassfishv41. So whether the issue will be still reproduce-able in GF trunk/main?
Please note that I have noticed that the patch for GRIZZLY-1720 is not there in grizzly-http-server-2.3.15-gfa.jar (which is coming from maven central ).grizzly-http-server-2.3.15-gfa.jar is using by both GF 4.1 and GF trunk/main.

Comment by Arindam Bandyopadhyay [ 02/Apr/15 ]

As per Oleksiy --> GRIZZLY-1720 haven't been fixed on GF trunk yet. It will be fixed with the next Grizzly integration.

Comment by Arindam Bandyopadhyay [ 08/Apr/15 ]

Grizzly 2.3.19 is integrated with GF trunk/main.
Committed revision 63835

Comment by Arindam Bandyopadhyay [ 09/Apr/15 ]

Fixed in trunk/main
Sending nucleus/grizzly/config/src/main/java/org/glassfish/grizzly/config/GenericGrizzlyListener.java
Transmitting file data .
Committed revision 63837.





[GLASSFISH-21159] X-PoweredBy sent even when disabled in the console Created: 07/Aug/14  Updated: 05/Apr/15

Status: In Progress
Project: glassfish
Component/s: web_container
Affects Version/s: 4.0
Fix Version/s: None

Type: Bug Priority: Major
Reporter: smillidge-c2b2 Assignee: Arindam Bandyopadhyay
Resolution: Unresolved Votes: 0
Labels: FishCat
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

All


Tags: javaee_ri_fix, review-blk

 Description   

When x-PoweredBy is disabled in the Admin console if a web application uses JSP the header is still set with the value JSP/2.3. This can be disabled by the web application developer by modifying the web.xml to add
<init-param>
<param-name>xpoweredBy</param-name>
<param-value>false</param-value>
</init-param>

however I think the administration option should be relied upon not relying on developers.

Steps to reproduce;

Disable X-PoweredBy in the administration console for the http-listener
Deploy a web application that uses JSP
Access the webapplication and check the headers sent to the browser
X-PoweredBy is present



 Comments   
Comment by smillidge-c2b2 [ 07/Aug/14 ]

We have fixed this is our version of GlassFish by adding the method below to the class com.sun.enterprise.v3.services.impl.GlassfishNetworkListener in the nucleus kernel module.This method checks the response before sending to the browser and if the X-PoweredBy header has been set by another subsystem during request processing it is stripped from the response thereby honouring the setting in the administration console.

// override to check whether x-Powered By has been added by something else
@Override
protected void onInitialLineEncoded(HttpHeader httpHeader, FilterChainContext ctx) {

if (xPoweredBy == null && httpHeader.containsHeader(Header.XPoweredBy))

{ httpHeader.getHeaders().removeHeader(Header.XPoweredBy); }

}

Comment by Arindam Bandyopadhyay [ 25/Mar/15 ]

I analysed the root cause of the bug and found out that $

{com.sun.aas.instanceRoot}

/config/default-web.xml is responsible for the issue. The default value in default-web.xml for jsp is the following

<servlet>
<servlet-name>jsp</servlet-name>
<servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
<init-param>
<param-name>xpoweredBy</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
.....
.......
So even if x-PoweredBy is disabled in the Admin console it is true in the default-web.xml. Now as per GF documentation "You can use the default-web.xml file to define features such as filters and security constraints that apply to all web applications."
As a result we are we are getting X-PoweredBy headers when X-PoweredBy is disabled in admin console. If you make xpoweredBy parameter false in the default-web.xml and disable it in the admin console you will get no X-PoweredBy header in the response.

Comment by Arindam Bandyopadhyay [ 25/Mar/15 ]

I observed that default-web.xml setting always overrides the admin console setting.Please find bellow the GF behaviour in the combination of admin console and default-web.xml when we deploy jsp files.

Default-web admin-console Headers displayed
TRUE FALSE X-PoweredBy header displayed . Value is "JSP/2.3"
TRUE TRUE X-PoweredBy header displayed . Value is "JSP/2.3"
FALSE FALSE X-PoweredBy header is not displayed.
FALSE TRUE X-PoweredBy header displayed . Value is "Servlet/3.1 JSP/2.3 (GlassFish Server Open Source Edition 4.1 Java/Oracle Corporation/1.7)"

Please note that if we make defalut-web.xml false and admin console true then only we are getting the X-PoweredBy header value from GlassfishNetworkListener.java class. Otherwise in all the cases defalut-web.xml overrides the X-PoweredBy header set by admin console.
We can fix the issue by setting the default value of xpoweredBy false in default-web.xml(/appserver/admin/template/src/main/resources/config/default-web.xml) .But before that we need to make sure if this is working as per design.

Hi Shing Wai Chan,

Could you let us know if this a bug or it's working as per design.





[GLASSFISH-20670] Performance problem in getInitParameter and getInitParameterNames() of org.apache.catalina.core.ApplicationContext (glassfish version), which are called very often by JSF frameworks Created: 28/Jun/13  Updated: 03/Apr/15  Resolved: 13/May/14

Status: Resolved
Project: glassfish
Component/s: performance, web_container
Affects Version/s: 3.1.2.2, 4.0_b89_RC5
Fix Version/s: 4.1_b08

Type: Bug Priority: Major
Reporter: lsxx Assignee: Scott Oaks
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: 4_0_1-review

 Description   

During performance tests (multiple parallel threads) of our enterprise application we discovered that 62% of time is spent in org.apache.catalina.core.ApplicationContext.mergeParameters.

      • Background:
        The calls to this method have origin in JSF stack - there are calls to context.getExternalContext().getInitParameter() from
        javax.faces.component.UIComponent.pushComponentToEL
        javax.faces.component.UIComponent.popComponentFromEL
        In default JSF implementation provided with glassfish the value for UIComponent.HONOR_CURRENT_COMPONENT_ATTRIBUTES_PARAM_NAME is obtained (without caching) for each call withing these methods.
      • Source of problem:
        The mergeParameters, which is internally called from getInitParameter and getInitParameterNames(), is synchronized.
        I analysed source of this class and believe that synchronization in this area could be improved.
        The problem was discovered during tests with glassfish 3.1.1.2, but it seems that other versions including trunk are affected as well.
      • Suggested solution:
        The problem seems to be easy to fix.

This is the original body for mergeParameters:
private synchronized void mergeParameters() {
if (parametersMerged)

{ return; }

[...]

parametersMerged = true;
}

As:
- this is the only synchronized method and there no "synchronized (this)" in this class
- the field parametersMerged is assigned a value only in mergeParameters (last line) and at initialization (private volatile boolean parametersMerged = false
- after the first execution of mergeParameters the field parametersMerged will never be assigned any value (especially false) and other calls to mergeParameters are waste of time.
- the field parametersMerged is volatile
the problem could be successfully solved by moving the synchronization to inside of the method and double checking the initial condition:

private void mergeParameters() {
if (parametersMerged) { return; }

synchronized(this){
if (parametersMerged)

{ return; }

[...]

parametersMerged = true;
}
}



 Comments   
Comment by Shing Wai Chan [ 13/May/14 ]

Sending src/main/java/org/apache/catalina/core/ApplicationContext.java
Transmitting file data .
Committed revision 63266.

Comment by lsxx [ 08/Aug/14 ]

The bug is not fixed - the introduced change has no effect as long the method mergeParameters is still synchronized.
Adding "sychnronized(this)"-block within synchronized method has no effect.

Comment by Sergiy_Rezvan [ 26/Feb/15 ]

I have had the same problem. This bug can be fixed by using the double-checked locking pattern.
It looks like:
org.apache.catalina.ApplicationContext

public class ApplicationContext implements ServletContext {
....
private volatile Object lockObject = new Object();
....
private void mergeParameters()
{
if (!this.parametersMerged) {
synchronized (this.lockObject) {
if (!this.parametersMerged) {
for (String name : this.context.findParameters())

{ this.parameters.put(name, this.context.findParameter(name)); }

List<ApplicationParameter> params = this.context.findApplicationParameters();
Iterator<ApplicationParameter> i = params.iterator();
while (i.hasNext())
{
ApplicationParameter param = (ApplicationParameter)i.next();
if (param.getOverride())
{
if (this.parameters.get(param.getName()) == null)

{ this.parameters.put(param.getName(), param.getValue()); }

}
else

{ this.parameters.put(param.getName(), param.getValue()); }

}
this.parametersMerged = true;
}
}
}
}

Could you please check this approach and give me feedback that everything is okay?
I have tested it and now I don't have this problem, but I want to be sure that it is correct.

Comment by Yury_Morozov [ 02/Mar/15 ]

The bug hasn't been fixed in any version, the method mergeParameters is still synchronized and blocks all threads.
Solution above fixes the problem. Please, include this in your next release.

Comment by Shing Wai Chan [ 03/Apr/15 ]

Tomcat 7 has a different fix on this issue by moving the merging parameters logic into the beginning of the life cycle.
Sending org/apache/catalina/core/ApplicationContext.java
Sending org/apache/catalina/core/StandardContext.java
Transmitting file data ..
Committed revision 63827.





[GLASSFISH-21219] SingleSignOnEntry uses session.hashCode, which may change Created: 30/Sep/14  Updated: 02/Apr/15

Status: In Progress
Project: glassfish
Component/s: web_container
Affects Version/s: 4.1
Fix Version/s: None

Type: Bug Priority: Major
Reporter: dmatej Assignee: Arindam Bandyopadhyay
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: 1 hour
Time Spent: Not Specified
Original Estimate: 1 hour

Tags: javaee_ri_fix, payara, review-blk, serialization, sso

 Description   

Since all Session implementations I have seen do not implement their own hashCode, so the value may change in time (depending on JVM).
Session is serializable, so serialization is one possible scenario.

protected Set<Session> sessions = new HashSet<Session>();

Similar things in Glassfish obviously use hash maps where the key is session id.



 Comments   
Comment by dmatej [ 06/Oct/14 ]

Apache version: http://svn.apache.org/repos/asf/tomcat/trunk/java/org/apache/catalina/authenticator/SingleSignOnEntry.java
My fixed version based on Glassfish: https://github.com/dmatej/Glassfish/commit/d8014d716c054bcab784bd08e35eaea5c9de4fcc

Comment by dmatej [ 14/Oct/14 ]

Two patches to apply to SVN:

commit 6984a431d154c4c9134b3b432f29ed5665c5f9cb
Author: David Matejcek <david.matejcek@i.cz>
Date:   Tue Sep 30 16:06:59 2014 +0200

    GLASSFISH-21219 Using HashMap instead of HashSet
    
    - Session.hashCode may change

diff --git a/main/appserver/web/web-core/src/main/java/org/apache/catalina/authenticator/SingleSignOnEntry.java b/main/appserver/web/web-core/src/main/java/org/apache/catalina/authenticator/SingleSignOnEntry.java
index 12c9751..006b685 100644
--- a/main/appserver/web/web-core/src/main/java/org/apache/catalina/authenticator/SingleSignOnEntry.java
+++ b/main/appserver/web/web-core/src/main/java/org/apache/catalina/authenticator/SingleSignOnEntry.java
@@ -58,38 +58,39 @@
 
 package org.apache.catalina.authenticator;
 
-import org.apache.catalina.Session;
-import org.apache.catalina.core.StandardServer;
-
 import java.security.Principal;
-import java.util.HashSet;
-import java.util.Set;
+import java.util.HashMap;
+import java.util.Map;
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
+import org.apache.catalina.Session;
+import org.apache.catalina.core.StandardServer;
+
 /**
- * A private class representing entries in the cache of authenticated users.
+ * A class representing entries in the cache of authenticated users.
  */
 public class SingleSignOnEntry {
 
     private static final Logger log = StandardServer.log;
 
-    protected String id = null;
+    protected final String id;
 
-    protected String authType = null;
+    protected final String authType;
 
-    protected Principal principal = null;
+    /** Reset by HASingleSignOnEntry */
+    protected Principal principal;
 
-    protected Set<Session> sessions = new HashSet<Session>();
+    protected final Map<String, Session> sessions = new HashMap<String, Session>();
 
-    protected String username = null;
+    protected final String username;
 
-    protected String realmName = null;
+    protected final String realmName;
 
     protected long lastAccessTime;
 
-    protected AtomicLong version = null;
+    protected final AtomicLong version;
 
     public SingleSignOnEntry(String id, long ver,
                              Principal principal, String authType,
@@ -107,20 +108,20 @@ public class SingleSignOnEntry {
     /**
      * Adds the given session to this SingleSignOnEntry if it does not
      * already exist.
-     * 
+     *
      * @return true if the session was added, false otherwise
      */
     public synchronized boolean addSession(SingleSignOn sso, Session session) {
-        boolean result = sessions.add(session);
-        if (result) {
+        final Session oldEntry = sessions.put(session.getId(), session);
+        if (oldEntry == null) {
             session.addSessionListener(sso);
         }
-
-        return true;
+        return oldEntry == null;
     }
 
     public synchronized void removeSession(Session session) {
-        sessions.remove(session);
+        final Session removed = sessions.remove(session.getId());
+        log.warning("session " + session.getId() + "found (and removed): " + removed);
     }
 
 
@@ -132,7 +133,7 @@ public class SingleSignOnEntry {
      * associated with it, and false otherwise
      */
     public synchronized boolean isEmpty() {
-        return (sessions.size() == 0);
+        return sessions.isEmpty();
     }
 
 
@@ -141,23 +142,16 @@ public class SingleSignOnEntry {
      *
      */
     public synchronized void expireSessions() {
-        for (Session session: sessions) {
+        for (Session session: sessions.values()) {
             if (log.isLoggable(Level.FINE)) {
-
                 log.log(Level.FINE, " Invalidating session " + session);
             }
-        
-            //6406580 START
-            /*
-            // Invalidate this session
-            session.expire();
-             */
+
             // Invalidate this session
             // if it is not already invalid(ated)
-            if( (session).getIsValid() ) {
+            if(session.getIsValid() ) {
                 session.expire();
             }
-            //6406580 END
         }
     }
commit 128644b6a890f9959a3e641f4c27e8022c192899
Author: David Matejcek <david.matejcek@i.cz>
Date:   Tue Oct 14 12:08:24 2014 +0200

    GLASSFISH-21219 Using HashMap instead of HashSet (HA/SSO)

diff --git a/main/appserver/web/web-ha/src/main/java/org/glassfish/web/ha/authenticator/HASingleSignOnEntry.java b/main/appserver/web/web-ha/src/main/java/org/glassfish/web/ha/authenticator/HASingleSignOnEntry.java
index c9a7025..7d0cedc 100644
--- a/main/appserver/web/web-ha/src/main/java/org/glassfish/web/ha/authenticator/HASingleSignOnEntry.java
+++ b/main/appserver/web/web-ha/src/main/java/org/glassfish/web/ha/authenticator/HASingleSignOnEntry.java
@@ -91,7 +91,7 @@ public class HASingleSignOnEntry extends SingleSignOnEntry {
                 throw new IllegalStateException("Cannot find the session: " + data.getSessionId(), ex);
             }
             if (session != null) {
-              sessions.add(session);
+              sessions.put(data.getSessionId(), session);
             }
         }
         logger.log(Level.FINER, "Loaded HA SSO entry from metadata. Principal: {}", this.principal);
Comment by dmatej [ 30/Oct/14 ]

Note: patch depends on patches in GLASSFISH-21148

Comment by dmatej [ 06/Nov/14 ]

Patches applied in Payara: https://github.com/payara/Payara/commit/f87a306cf64b6d0d434a40a7b61753012bd27f19

Comment by Arindam Bandyopadhyay [ 09/Mar/15 ]

I was working on to incorporate the patch to svn.
Is there a set of test case which I can run to validate the patch ?

Comment by prasads [ 02/Apr/15 ]

It is a structural bug . Waiting for test-case from Shing Wai Chan to validate the fix





[GLASSFISH-21007] HTTP Upgrade handler init called twice when access log is turned on Created: 17/Mar/14  Updated: 02/Apr/15

Status: In Progress
Project: glassfish
Component/s: web_container
Affects Version/s: 4.1
Fix Version/s: None

Type: Bug Priority: Critical
Reporter: mreichman Assignee: Arindam Bandyopadhyay
Resolution: Unresolved Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Glassfish 4.0.1b4 Promoted, Windows 7 x64, JDK 1.7.0_51


Issue Links:
Blocks
blocks TYRUS-306 java.lang.IllegalStateException: Alre... Open
Dependency
blocks TYRUS-306 java.lang.IllegalStateException: Alre... Open
Tags: javaee_ri_fix, payara, review-blk

 Description   

When HTTP access logging is turned on, the init method of HttpUpgradeHandler implementations is called twice at upgrade-time. I'd previously filed TYRUS-306 for this, the necessary information, test components to reproduce are in that ticket. In the Tyrus case, the effect is that two websockets are created for one request which creates management difficulty and potential leaks.



 Comments   
Comment by smillidge-c2b2 [ 12/Jan/15 ]

A suggested fix for this is here
https://github.com/payara/Payara/commit/4b0951d503e416813cc4fba82edd2d60e8a77a53

Comment by prasads [ 02/Apr/15 ]

Pending Review from Amy Roh and Shing Wai Chan





[GLASSFISH-21009] The behavior of --timeout-seconds is not in line with the document Created: 19/Mar/14  Updated: 30/Mar/15

Status: Open
Project: glassfish
Component/s: web_container
Affects Version/s: 4.0
Fix Version/s: None

Type: Bug Priority: Major
Reporter: xj Assignee: Vinay Vishal
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: 4_0_1-approved, licbug

 Description   

One licensee found a contradicting behavior in Java EE 7 RI if 0 is set at
--timeout-seconds on command asadmin create-http.

There is such a description in GlassFish Reference Manual.

GlassFish Server Open Source Edition
Reference Manual Release 4.0
Page 1-77.
https://glassfish.java.net/docs/4.0/reference-manual.pdf

--timeout-seconds
The maximum time in seconds for which a keep alive connection is kept
open. A value of 0 or less means keep alive connections are kept open
indefinitely. The default is 30.

However, In Java EE 7 RI the connection is terminated immediately if
0 is set at --timeout-seconds which means 0 second is used.

It seems there is an inconsistent implementation in RI.

To reproduce.

1. Set following configurations
asadmin start-domain
asadmin create-protocol --securityenabled=false http-1
asadmin create-http --timeout-seconds 0 --default-virtual-server server http-1
asadmin create-network-listener --listenerport 7272 --protocol http-1 --enabled=true http-listener-3

The following config is set.
[domain.xml]
<protocol name="http-1">
<http timeout-seconds="0" default-virtual-server="server">
<file-cache></file-cache>
</http>
</protocol>

2. Connect the server
telnet 127.0.0.1 7272

You can see the connection is terminated immediately.



 Comments   
Comment by timmaher [ 30/Oct/14 ]

It gets even worse if you set the web session-timeout to 0 using the 4848 admin console.
Where previously there was no timeout entry in domain.xml when the timeout was set to 1800.
Saving 0 in the admin console results in the following:-
<web-container>
<session-config>
<session-manager>
<manager-properties></manager-properties>
<store-properties></store-properties>
</session-manager>
<session-properties timeout-in-seconds="0"></session-properties>
</session-config>
</web-container>
This is guaranteed to bomb all connections, including the admin console with a 500.
The only repair is to go into the domain.xml and reset the value to 1800 (I haven't tried removing it instead).





[GLASSFISH-21183] Web container still does not call AsynContext.complete() on timeout/exception Created: 03/Sep/14  Updated: 26/Mar/15

Status: In Progress
Project: glassfish
Component/s: web_container
Affects Version/s: 4.0_b89_RC5
Fix Version/s: None

Type: Bug Priority: Major
Reporter: patson Assignee: Vinay Vishal
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

As reported in https://java.net/jira/browse/GLASSFISH-19364, that AsyncContext.complete() was not called for timeout/exception, and it was fixed in rev 57176 (https://java.net/projects/glassfish/lists/commits/archive/2012-11/message/316)

After that fix, timeout/exception indeed calls Request.asyncComplete(), however that call still would not call AsyncContext.complete(), therefore does not adhere to the defintion of AsyncContext which:

Timeout:

In the event that an asynchronous operation has timed out, the container must run through these steps:

Invoke, at their onTimeout method, all AsyncListener instances registered with the ServletRequest on which the asynchronous operation was initiated.
If none of the listeners called complete() or any of the dispatch() methods, perform an error dispatch with a status code equal to HttpServletResponse.SC_INTERNAL_SERVER_ERROR.
If no matching error page was found, or the error page did not call complete() or any of the dispatch() methods, call complete().

Error:

Any errors or exceptions that may occur during the execution of this method must be caught and handled by the container, as follows:

Invoke, at their onError method, all AsyncListener instances registered with the ServletRequest for which this AsyncContext was created, and make the caught Throwable available via AsyncEvent#getThrowable.
If none of the listeners called complete() or any of the dispatch() methods, perform an error dispatch with a status code equal to HttpServletResponse.SC_INTERNAL_SERVER_ERROR, and make the above Throwable available as the value of the RequestDispatcher.ERROR_EXCEPTION request attribute.
If no matching error page was found, or the error page did not call complete() or any of the dispatch() methods, call complete().

Many thanks for your kind attention in advance!!






[GLASSFISH-20858] Message "Invalid Url Pattern" contains placeholder, while it obviously must contain the invalid pattern Created: 16/Oct/13  Updated: 26/Mar/15

Status: Open
Project: glassfish
Component/s: web_container
Affects Version/s: 4.0
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: mkarg Assignee: Shing Wai Chan
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Debian 7.2, AMD64, JDK 8 (Developer's Preview)


Attachments: Text File WebResourceCollectionNode.java.patch    

 Description   

I did a typo in the URL pattern of web-resource-collection in web.xml, and as a result receive this stacktrace. Apparently the message contains the placeholder

{0} while it should contain the false pattern instead.

[2013-10-16T19:25:11.020+0200] [glassfish 4.0] [SEVERE] [NCLS-CORE-00026] [javax.enterprise.system.core] [tid: _ThreadID=99 _ThreadName=AutoDeployer] [timeMillis: 1381944311020] [levelValue: 1000] [[
Exception during lifecycle processing
java.lang.IllegalArgumentException: Invalid URL Pattern: [{0}

]
at org.glassfish.web.deployment.node.WebResourceCollectionNode.setElementValue(WebResourceCollectionNode.java:136)
at com.sun.enterprise.deployment.node.SaxParserHandler.endElement(SaxParserHandler.java:583)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:606)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.endElement(XMLSchemaValidator.java:863)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1786)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2951)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:116)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:846)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:775)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1210)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:626)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:332)
at com.sun.enterprise.deployment.io.DeploymentDescriptorFile.read(DeploymentDescriptorFile.java:318)
at com.sun.enterprise.deployment.io.DeploymentDescriptorFile.read(DeploymentDescriptorFile.java:245)
at com.sun.enterprise.deployment.archivist.Archivist.readStandardDeploymentDescriptor(Archivist.java:665)
at com.sun.enterprise.deployment.archivist.Archivist.readDeploymentDescriptors(Archivist.java:391)
at com.sun.enterprise.deployment.archivist.Archivist.open(Archivist.java:271)
at com.sun.enterprise.deployment.archivist.Archivist.open(Archivist.java:280)
at com.sun.enterprise.deployment.archivist.Archivist.open(Archivist.java:241)
at com.sun.enterprise.deployment.archivist.ApplicationFactory.openArchive(ApplicationFactory.java:161)
at org.glassfish.javaee.core.deployment.DolProvider.processDOL(DolProvider.java:198)
at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:222)
at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:96)
at com.sun.enterprise.v3.server.ApplicationLifecycle.loadDeployer(ApplicationLifecycle.java:878)
at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:818)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:374)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:537)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
at org.glassfish.deployment.autodeploy.AutoOperation.run(AutoOperation.java:164)
at org.glassfish.deployment.autodeploy.AutoDeployer.deploy(AutoDeployer.java:595)
at org.glassfish.deployment.autodeploy.AutoDeployer.deployAll(AutoDeployer.java:482)
at org.glassfish.deployment.autodeploy.AutoDeployer.run(AutoDeployer.java:410)
at org.glassfish.deployment.autodeploy.AutoDeployer.run(AutoDeployer.java:401)
at org.glassfish.deployment.autodeploy.AutoDeployService$1.run(AutoDeployService.java:233)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)



 Comments   
Comment by Terry2013 [ 04/Jan/15 ]

Hi, hong
I have confirmed the code.
I think the code for outputing the error message is wrong.
I create the a patch for this bug.I test it and it works fine.
Could you please reviwe it?

Comment by Hong Zhang [ 05/Jan/15 ]

Thanks for submitting a patch for this bug. The WebResourceCollectionNode is owned by the web team, reassign to them for them to review the patch.

Comment by jifeng [ 04/Feb/15 ]

Hi, Shing Wai Chan

I found that the same problem exists in the following classes. In these classes the usage of MessageFormat.format() method is error:

war-util/src/main/java/org/glassfish/web/loader/WebappClassLoader.java
web-core/src/main/java/org/apache/catalina/core/StandardServer.java
web-glue/src/main/java/org/glassfish/web/config/WebSslConfigHandler.java
web-glue/src/main/java/org/glassfish/web/deployment/node/FilterMappingNode.java
web-glue/src/main/java/org/glassfish/web/deployment/node/ServletMappingNode.java
web-naming/src/main/java/org/apache/naming/ContextBindings.java
web-naming/src/main/java/org/apache/naming/resources/WARDirContext.java
web-naming/src/main/java/org/apache/naming/resources/WebDirContext.java

Comment by lzg5039 [ 19/Mar/15 ]

Hi, Shing Wai Chan

I use the following source to fix all problems , can you help me to review it .

Index: war-util/src/main/java/org/glassfish/web/loader/WebappClassLoader.java
===================================================================
--- war-util/src/main/java/org/glassfish/web/loader/WebappClassLoader.java	(revision 62639)
+++ war-util/src/main/java/org/glassfish/web/loader/WebappClassLoader.java	(working copy)
@@ -1258,7 +1258,7 @@
                 } catch(AccessControlException ace) {
                     if (logger.isLoggable(Level.WARNING)) {
                         String msg = MessageFormat.format(
-                                FIND_CLASS_INTERNAL_SECURITY_EXCEPTION,
+                                rb.getString(FIND_CLASS_INTERNAL_SECURITY_EXCEPTION),
                                 new Object[]{name, ace.getMessage()});
                         logger.log(Level.WARNING, msg, ace);
                     }
@@ -1705,7 +1705,7 @@
                 try {
                     securityManager.checkPackageAccess(name.substring(0,i));
                 } catch (SecurityException se) {
-                    String error = MessageFormat.format(SECURITY_EXCEPTION, name);
+                    String error = MessageFormat.format(rb.getString(SECURITY_EXCEPTION), name);
                     if (logger.isLoggable(Level.INFO)) {
                         logger.log(Level.INFO, error, se);
                     }
Index: web-core/src/main/java/org/apache/catalina/core/StandardServer.java
===================================================================
--- web-core/src/main/java/org/apache/catalina/core/StandardServer.java	(revision 62639)
+++ web-core/src/main/java/org/apache/catalina/core/StandardServer.java	(working copy)
@@ -892,7 +892,7 @@
             try {
                 oname=new ObjectName( "Catalina:type=Server");
             } catch (Exception e) {
-                String msg = MessageFormat.format(ERROR_REGISTERING, e.toString());
+                String msg = MessageFormat.format(rb.getString(ERROR_REGISTERING), e.toString());
                 log.log(Level.SEVERE, msg, e);
             }
         }
Index: web-glue/src/main/java/org/glassfish/web/config/WebSslConfigHandler.java
===================================================================
--- web-glue/src/main/java/org/glassfish/web/config/WebSslConfigHandler.java	(revision 62639)
+++ web-glue/src/main/java/org/glassfish/web/config/WebSslConfigHandler.java	(working copy)
@@ -94,9 +94,9 @@
         try {
             if (listener == null) {
                 report.setMessage(
-                        WebContainer.rb.getString(
-                                MessageFormat.format(
-                                        CREATE_SSL_HTTP_NOT_FOUND, command.listenerId)));
+                        MessageFormat.format(
+                                WebContainer.rb.getString(
+                                        CREATE_SSL_HTTP_NOT_FOUND), command.listenerId));
                 httpProtocol = command.findOrCreateProtocol(command.listenerId);
             } else {
                 httpProtocol = listener.findHttpProtocol();
@@ -103,9 +103,9 @@
                 Ssl ssl = httpProtocol.getSsl();
                 if (ssl != null) {
                     report.setMessage(
-                            WebContainer.rb.getString(
-                                    MessageFormat.format(
-                                            CREATE_SSL_HTTP_ALREADY_EXISTS, command.listenerId)));
+                            MessageFormat.format(
+                                    WebContainer.rb.getString(
+                                            CREATE_SSL_HTTP_ALREADY_EXISTS), command.listenerId));
                     report.setActionExitCode(ActionReport.ExitCode.FAILURE);
                     return;
                 }
@@ -134,8 +134,8 @@
 
         if (networkListener == null) {
             report.setMessage(
-                    WebContainer.rb.getString(
-                            MessageFormat.format(DELETE_SSL_HTTP_LISTENER_NOT_FOUND, command.listenerId)));
+                    MessageFormat.format(
+                            WebContainer.rb.getString(DELETE_SSL_HTTP_LISTENER_NOT_FOUND), command.listenerId));
             report.setActionExitCode(ActionReport.ExitCode.FAILURE);
             return;
         }
@@ -143,8 +143,8 @@
         Protocol protocol = networkListener.findHttpProtocol();
         if (protocol.getSsl() == null) {
             report.setMessage(
-                    WebContainer.rb.getString(
-                            MessageFormat.format(DELETE_SSL_ELEMENT_DOES_NOT_EXIST, command.listenerId)));
+                    MessageFormat.format(
+                            WebContainer.rb.getString(DELETE_SSL_ELEMENT_DOES_NOT_EXIST), command.listenerId));
             report.setActionExitCode(ActionReport.ExitCode.FAILURE);
             return;
         }
Index: web-glue/src/main/java/org/glassfish/web/deployment/node/FilterMappingNode.java
===================================================================
--- web-glue/src/main/java/org/glassfish/web/deployment/node/FilterMappingNode.java	(revision 62639)
+++ web-glue/src/main/java/org/glassfish/web/deployment/node/FilterMappingNode.java	(working copy)
@@ -141,9 +141,9 @@
                     value = trimmedUrl;
                 } else {
                     throw new IllegalArgumentException(
-                            WebContainer.rb.getString(
-                                    MessageFormat.format(
-                                            ENTERPRISE_DEPLOYMENT_INVALID_URL_PATTERN, value)));
+                            MessageFormat.format(
+                                    WebContainer.rb.getString(
+                                            ENTERPRISE_DEPLOYMENT_INVALID_URL_PATTERN), value));
                 }
             }
             descriptor.addURLPattern(value);
Index: web-glue/src/main/java/org/glassfish/web/deployment/node/ServletMappingNode.java
===================================================================
--- web-glue/src/main/java/org/glassfish/web/deployment/node/ServletMappingNode.java	(revision 62639)
+++ web-glue/src/main/java/org/glassfish/web/deployment/node/ServletMappingNode.java	(working copy)
@@ -112,9 +112,9 @@
                     value = trimmedUrl;
                 } else {
                     throw new IllegalArgumentException(
-                            WebContainer.rb.getString(
-                                    MessageFormat.format(
-                                            FilterMappingNode.ENTERPRISE_DEPLOYMENT_INVALID_URL_PATTERN, value)));
+                            MessageFormat.format(
+                                    WebContainer.rb.getString(
+                                            FilterMappingNode.ENTERPRISE_DEPLOYMENT_INVALID_URL_PATTERN), value));
                 }
             }
 
Index: web-naming/src/main/java/org/apache/naming/ContextBindings.java
===================================================================
--- web-naming/src/main/java/org/apache/naming/ContextBindings.java	(revision 62639)
+++ web-naming/src/main/java/org/apache/naming/ContextBindings.java	(working copy)
@@ -223,8 +223,8 @@
             Context context = contextNameBindings.get(name);
             if (context == null)
                 throw new NamingException(
-                        rb.getString(
-                                MessageFormat.format(UNKNOWN_CONTEXT, name)));
+                        MessageFormat.format(
+                                rb.getString(UNKNOWN_CONTEXT), name));
             threadBindings.put(Thread.currentThread(), context);
             threadNameBindings.put(Thread.currentThread(), name);
         }
@@ -326,8 +326,8 @@
             Context context = contextNameBindings.get(name);
             if (context == null)
                 throw new NamingException(
-                        rb.getString(
-                                MessageFormat.format(UNKNOWN_CONTEXT, name)));
+                        MessageFormat.format(
+                                rb.getString(UNKNOWN_CONTEXT), name));
             clBindings.put(classLoader, context);
             clNameBindings.put(classLoader, name);
         }
Index: web-naming/src/main/java/org/apache/naming/resources/WARDirContext.java
===================================================================
--- web-naming/src/main/java/org/apache/naming/resources/WARDirContext.java	(revision 62639)
+++ web-naming/src/main/java/org/apache/naming/resources/WARDirContext.java	(working copy)
@@ -215,7 +215,7 @@
             try {
                 base.close();
             } catch (IOException e) {
-                String msg = MessageFormat.format(EXCEPTION_CLOSING_WAR, base.getName());
+                String msg = MessageFormat.format(rb.getString(EXCEPTION_CLOSING_WAR), base.getName());
                 log.log(Level.WARNING, msg, e);
             }
         }
Index: web-naming/src/main/java/org/apache/naming/resources/WebDirContext.java
===================================================================
--- web-naming/src/main/java/org/apache/naming/resources/WebDirContext.java	(revision 62639)
+++ web-naming/src/main/java/org/apache/naming/resources/WebDirContext.java	(working copy)
@@ -165,7 +165,7 @@
             jfEntry = lookupFromJars(name);
             if (jfEntry == null) {
                 throw new NamingException
-                    (rb.getString(MessageFormat.format(RESOURCES_NOT_FOUND, name)));
+                    (MessageFormat.format(rb.getString(RESOURCES_NOT_FOUND), name));
             }
         }
 
@@ -223,7 +223,7 @@
 
         if (file == null && jfeEntries.size() == 0) {
             throw new NamingException
-                    (rb.getString(MessageFormat.format(RESOURCES_NOT_FOUND, name)));
+                    (MessageFormat.format(rb.getString(RESOURCES_NOT_FOUND), name));
         }
         return new NamingContextEnumeration(namingEntries.iterator());
     }
@@ -263,7 +263,7 @@
 
         if (file == null && jfeEntries.size() == 0) {
             throw new NamingException
-                    (rb.getString(MessageFormat.format(RESOURCES_NOT_FOUND, name)));
+                    (MessageFormat.format(rb.getString(RESOURCES_NOT_FOUND), name));
         }
 
         return new NamingContextBindingsEnumeration(namingEntries.iterator(),
@@ -298,7 +298,7 @@
             JarFileEntry jfEntry = lookupFromJars(name);
             if (jfEntry == null) {
                 throw new NamingException
-                    (rb.getString(MessageFormat.format(RESOURCES_NOT_FOUND, name)));
+                    (MessageFormat.format(rb.getString(RESOURCES_NOT_FOUND), name));
             } else {
                 return new JarResourceAttributes(jfEntry.getJarEntry());
             }

Index: web-glue/src/main/java/org/glassfish/web/deployment/node/WebResourceCollectionNode.java
===================================================================
--- web-glue/src/main/java/org/glassfish/web/deployment/node/WebResourceCollectionNode.java	(revision 63724)
+++ web-glue/src/main/java/org/glassfish/web/deployment/node/WebResourceCollectionNode.java	(working copy)
@@ -134,9 +134,9 @@
                     value = trimmedUrl;
                 } else {
                     throw new IllegalArgumentException(
-                            WebContainer.rb.getString(
-                                    MessageFormat.format(
-                                            FilterMappingNode.ENTERPRISE_DEPLOYMENT_INVALID_URL_PATTERN, value)));
+                            MessageFormat.format(
+                                    WebContainer.rb.getString(FilterMappingNode.ENTERPRISE_DEPLOYMENT_INVALID_URL_PATTERN),
+                                    value));
                 }
             }
             descriptor.addUrlPattern(value);




[GLASSFISH-359] NPE when HTTP Mapper isn't able to map a request. Created: 07/Mar/06  Updated: 12/Mar/15  Resolved: 08/Mar/06

Status: Resolved
Project: glassfish
Component/s: web_container
Affects Version/s: 9.0pe
Fix Version/s: 9.0pe

Type: Bug Priority: Major
Reporter: jfarcand Assignee: jfarcand
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issuezilla Id: 359

 Description   

Sometimes there is an NPE thrown when a Context isn't mapped properly.

[#|2006-03-07T20:09:57.832-0500|SEVERE|sun-appserver-pe9.0|org.apache.coyote.tomcat5.CoyoteAdapter|_ThreadID=40;_ThreadName=httpWorkerThread-8080-1;_RequestID=67de54df-1d84-41c0-bf11-8c7d203da1ef;|An
exception or error occurred in the container during the request processing
java.lang.NullPointerException
at
com.sun.enterprise.web.connector.coyote.PwcCoyoteRequest.setContext(PwcCoyoteRequest.java:70)
at
org.apache.coyote.tomcat5.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:345)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:199)
at
com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:667)
at
com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(ProcessorTask.java:574)
at
com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:844)
at
com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:287)
at
com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
at
com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75)

#]

The server must return an 500 status code instead of miserability failling like
that.



 Comments   
Comment by jfarcand [ 07/Mar/06 ]

I can see the problem when running the amx test...

Comment by jfarcand [ 08/Mar/06 ]

Fixed by not interupting the request processing

Checking in PwcCoyoteRequest.java;
/cvs/glassfish/webtier-extensions/src/java/com/sun/enterprise/web/connector/coyote/PwcCoyoteRequest.java,v
<-- PwcCoyoteRequest.java
new revision: 1.5; previous revision: 1.4
done





[GLASSFISH-18601] cluster can't be started when not ending with % in the specification of the key word of the HTTP access log format.(GLASSFISH V4) Created: 06/Apr/12  Updated: 12/Mar/15  Resolved: 11/Apr/12

Status: Resolved
Project: glassfish
Component/s: web_container
Affects Version/s: 9.0pe, 9.0peur1_dev, 9.0peur1, 9.1pe_dev, 9.1pe, 9.1peur1_dev, 9.1peur1, 9.1peur2_b03, 9.1peur2, 9.1.1_dev, 9.1.1, v2.1, v2.1.1_dev, v2.1.1, V3, v3.0.1, 3.1_b02, 3.1_ms01, 3.1_b03, 3.1_b05, 3.1_b06, 3.1_ms02, 3.1_b07, 3.1_b08, 3.1_b10, 3.1_ms03, 3.1_b12, 3.1_b13, 3.1_b14, 3.1_b15, 3.1_b16, 3.1_ms04, 3.1_b17, 3.1_b18, 3.1_b19, 3.1_b20, 3.1_ms05, 3.1_b21, 3.1_b22, 3.1_b23, 3.1_b24, 3.1_b25, 3.1_b26, 3.1_ms06, 3.1_b27, 3.1_b28, 3.1_b29, 3.1_b30, 3.1_b31, 3.1_b32, 3.1_ms07, 3.1_b33, 3.1_b34, 3.1_b35, 3.1_b36, 3.1_b37, 3.1_b38, 3.1_b39, 3.1_b40, 3.1_b41 , 3.1_b42, 3.1_b43, 3.1_ms08, 3.1, 3.1.1_b01, 3.1.1_b02, 3.1.1_b03 , 3.1.1_b04 , 3.1.1_b05, 3.1.1_b06 , 3.1.1_b07 , 3.1.1_b08, 3.1.1_b09, 3.1.1_b10, 3.1.1_b11, 3.1.1_b12, 3.1.1, 3.1.2_b01, 3.1.2_b02, 3.1.2_b03, 3.1.2_b04, 3.1.2_b05, 3.1.2_b06, 3.1.2_b07, 3.1.2_b09, 3.1.2_b10, 3.1.2_b11, 3.1.2_b12, 3.1.2_b13, 3.1.2_b14, 3.1.2_b15, 3.1.2_b16, 3.1.2_b17, 3.1.2_b18, 3.1.2_b19, 3.1.2_b20, 3.1.2_b21, 3.1.2_b22, 3.1.2_b23, 3.1.2, 4.0_b01, 4.0_b02, 4.0_b03, 4.0_b04, 4.0_b05, 4.0_b06, 4.0_b08, 4.0_b09, 4.0_b10, 4.0_b11, 4.0_b12, 4.0_b13, 4.0_b14, 4.0_b15, 4.0_b16, 4.0_b17, 4.0_b18, 4.0_b19, 4.0_b20, 4.0_b21, 4.0_b22, 4.0_b23, 4.0_b24, 4.0_b25, 4.0_b26, 4.0_b27, 4.0_b28, 4.0_b29, 4.0_b30
Fix Version/s: 4.0_b33

Type: Bug Priority: Major
Reporter: Jeremy_Lv Assignee: Amy Roh
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

all


Attachments: Java Source File DefaultAccessLogFormatterImpl.java     Text File DefaultAccessLogFormatterImpl.patch     JPEG File screenshot-1.jpg     JPEG File screenshot-2.jpg     Text File server.log    

 Description   

1、change the format in http-service like "%client.name% %datetime %status%", where the key word of "%" is deleted.
2、fail in starting the cluster.



 Comments   
Comment by Jeremy_Lv [ 06/Apr/12 ]

Reappear step
1. Create a cluster and instance related to this cluster.

2. Open cluster config related to the created cluster.

3. Access the Http-service and changed the format like " %client.name% %datetime %status% " where the datetime is not end with %.

4. start the related cluster but the cluster can't be start. Then check the serverlog but there's no obvious information about this phenomenon.

Comment by Jeremy_Lv [ 06/Apr/12 ]

Because I can't commit the code, so I have uploaded my revised file in this trac.

Comment by Jeremy_Lv [ 06/Apr/12 ]

the information in serverlog when start the cluster:

[#|2012-03-29T20:31:19.312+0800|INFO|44.0|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=44;_ThreadName=Thread-2;|Starting Cluster...|#]

[#|2012-03-29T20:31:19.312+0800|INFO|44.0|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=44;_ThreadName=Thread-2;|http://localhost:4848/management/domain/clusters/cluster/cluster008/start-cluster|#]

[#|2012-03-29T20:31:19.328+0800|INFO|44.0|ShoalLogger|_ThreadID=22;_ThreadName=Thread-2;|GMS1098: GMS:Announcing GroupStartup[INITIATED] for group: cluster008 members: instance008,|#]

[#|2012-03-29T20:31:19.328+0800|INFO|44.0|ShoalLogger|_ThreadID=22;_ThreadName=Thread-2;|GMS1062: GroupStart for group: cluster008 State: INITIATED Starting Members: instance008,|#]

[#|2012-03-29T20:31:19.328+0800|INFO|44.0|javax.enterprise.system.tools.admin.com.sun.enterprise.v3.admin.cluster|_ThreadID=22;_ThreadName=Thread-2;|Starting cluster cluster008|#]

[#|2012-03-29T20:31:19.328+0800|INFO|44.0|javax.enterprise.system.tools.admin.com.sun.enterprise.v3.admin.cluster|_ThreadID=22;_ThreadName=Thread-2;|Executing start-instance on 1 instances using a thread pool of size 1: localhost-domain1:instance008|#]

[#|2012-03-29T20:31:19.328+0800|INFO|44.0|javax.enterprise.system.tools.admin.com.sun.enterprise.v3.admin.cluster|_ThreadID=22;_ThreadName=Thread-2;|start-instance instance008|#]

[#|2012-03-29T20:31:59.156+0800|INFO|44.0|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=45;_ThreadName=Thread-2;|Attempting to start instance008.... Please look at the server log for more details.....|#]

[#|2012-03-29T20:32:49.109+0800|WARNING|44.0|javax.enterprise.system.tools.admin.com.sun.enterprise.v3.admin.cluster|_ThreadID=46;_ThreadName=Thread-2;|Could not start instance instance008 on node localhost-domain1 (localhost).: Command ' E:\glassfish3\glassfish\lib\nadmin.bat --_auxinput - --interactive=false start-local-instance --node localhost-domain1 --sync normal instance008' failed on node localhost-domain1 (localhost): Attempting to start instance008.... Please look at the server log for more details.....: To complete this operation run the following command locally on host localhost from the GlassFish install location E:\glassfish3:

lib/nadmin start-local-instance --node localhost-domain1 --sync normal instance008|#]

[#|2012-03-29T20:32:49.109+0800|SEVERE|44.0|javax.enterprise.system.tools.admin.com.sun.enterprise.v3.admin.cluster|_ThreadID=22;_ThreadName=Thread-2;|instance008: Could not start instance instance008 on node localhost-domain1 (localhost).

Command failed on node localhost-domain1 (localhost): Attempting to start instance008.... Please look at the server log for more details.....

To complete this operation run the following command locally on host localhost from the GlassFish install location E:\glassfish3:

lib/nadmin start-local-instance --node localhost-domain1 --sync normal instance008|#]

[#|2012-03-29T20:32:49.140+0800|SEVERE|44.0|org.glassfish.admingui|_ThreadID=44;_ThreadName=Thread-2;|RestResponse.getResponse() gives FAILURE. endpoint = 'http://localhost:4848/management/domain/clusters/cluster/cluster008/start-cluster'; attrs = '{}'|#]

Comment by Shing Wai Chan [ 06/Apr/12 ]

Please check the current behavior of incorrect log format pattern.

Comment by Amy Roh [ 06/Apr/12 ]

Incorrect access logging pattern "%client.name% %auth-user-name% %datetime %request% %status% %response.length%" fails to start a cluster with appropriate logging message "WEB0325: Invalid component: datetime in access log pattern: %client.name% %auth-user-name% %datetime %request% %status% %response.length%" for me.

Can you start the cluster if you correct the access log pattern?

[#|2012-04-06T13:26:41.082-0700|INFO|44.0|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=10;_ThreadName=main;|WEB0169: Created HTTP listener [http-listener-1] on host/port [0.0.0.0:28080]|#]

[#|2012-04-06T13:26:41.091-0700|INFO|44.0|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=10;_ThreadName=main;|WEB0169: Created HTTP listener [http-listener-2] on host/port [0.0.0.0:28181]|#]

[#|2012-04-06T13:26:41.098-0700|INFO|44.0|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=10;_ThreadName=main;|WEB0169: Created HTTP listener [admin-listener] on host/port [0.0.0.0:24848]|#]

[#|2012-04-06T13:26:41.134-0700|SEVERE|44.0|javax.enterprise.system.container.web.com.sun.enterprise.web.accesslog|_ThreadID=10;_ThreadName=main;|WEB0325: Invalid component: datetime in access log pattern: %client.name% %auth-user-name% %datetime %request% %status% %response.length%|#]

[#|2012-04-06T13:26:41.135-0700|SEVERE|44.0|javax.enterprise.system.container.web.com.sun.enterprise.web.accesslog|_ThreadID=10;_ThreadName=main;|WEB0325: Invalid component: in access log pattern: %client.name% %auth-user-name% %datetime %request% %status% %response.length%|#]

[#|2012-04-06T13:26:41.135-0700|SEVERE|44.0|javax.enterprise.system.container.web.com.sun.enterprise.web.accesslog|_ThreadID=10;_ThreadName=main;|WEB0325: Invalid component: in access log pattern: %client.name% %auth-user-name% %datetime %request% %status% %response.length%|#]

[#|2012-04-06T13:26:41.135-0700|SEVERE|44.0|javax.enterprise.system.container.web.com.sun.enterprise.web.accesslog|_ThreadID=10;_ThreadName=main;|WEB0324: Missing end delimiter in access log pattern: %client.name% %auth-user-name% %datetime %request% %status% %response.length%|#]

[#|2012-04-06T13:26:41.135-0700|SEVERE|44.0|com.sun.enterprise.v3.server.RunLevelBridge|_ThreadID=10;_ThreadName=main;|problem starting LazyInhabitant-22926625(org.glassfish.kernel.javaee.WebContainerStarter, active: SingletonInhabitant-22257291(names=[],typeName=org.glassfish.kernel.javaee.WebContainerStarter,qualifiers=[],contracts=[],metadata=

{class: [org.glassfish.kernel.javaee.WebContainerStarter] index: [org.glassfish.api.Startup] }

)
): null|#]

[#|2012-04-06T13:26:41.136-0700|SEVERE|44.0|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=10;_ThreadName=main;|Startup service failed to start com.sun.enterprise.v3.server.StartupRunLevelBridge due to null|#]

[#|2012-04-06T13:26:41.176-0700|INFO|44.0|javax.enterprise.system.tools.admin.com.sun.enterprise.v3.admin.cluster|_ThreadID=11;_ThreadName=Thread-7;|Server shutdown initiated|#]

[#|2012-04-06T13:26:41.184-0700|INFO|44.0|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=10;_ThreadName=main;|WEB0169: Created HTTP listener [http-listener-1] on host/port [0.0.0.0:28080]|#]

[#|2012-04-06T13:26:41.188-0700|INFO|44.0|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=10;_ThreadName=main;|WEB0169: Created HTTP listener [http-listener-2] on host/port [0.0.0.0:28181]|#]

[#|2012-04-06T13:26:41.196-0700|INFO|44.0|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=10;_ThreadName=main;|WEB0169: Created HTTP listener [admin-listener] on host/port [0.0.0.0:24848]|#]

[#|2012-04-06T13:26:41.209-0700|SEVERE|44.0|javax.enterprise.system.container.web.com.sun.enterprise.web.accesslog|_ThreadID=10;_ThreadName=main;|WEB0325: Invalid component: datetime in access log pattern: %client.name% %auth-user-name% %datetime %request% %status% %response.length%|#]

[#|2012-04-06T13:26:41.210-0700|SEVERE|44.0|javax.enterprise.system.container.web.com.sun.enterprise.web.accesslog|_ThreadID=10;_ThreadName=main;|WEB0325: Invalid component: in access log pattern: %client.name% %auth-user-name% %datetime %request% %status% %response.length%|#]

[#|2012-04-06T13:26:41.210-0700|SEVERE|44.0|javax.enterprise.system.container.web.com.sun.enterprise.web.accesslog|_ThreadID=10;_ThreadName=main;|WEB0325: Invalid component: in access log pattern: %client.name% %auth-user-name% %datetime %request% %status% %response.length%|#]

[#|2012-04-06T13:26:41.210-0700|SEVERE|44.0|javax.enterprise.system.container.web.com.sun.enterprise.web.accesslog|_ThreadID=10;_ThreadName=main;|WEB0324: Missing end delimiter in access log pattern: %client.name% %auth-user-name% %datetime %request% %status% %response.length%|#]

[#|2012-04-06T13:26:41.210-0700|SEVERE|44.0|com.sun.enterprise.v3.server.RunLevelBridge|_ThreadID=10;_ThreadName=main;|problem starting LazyInhabitant-22926625(org.glassfish.kernel.javaee.WebContainerStarter, active: SingletonInhabitant-22257291(names=[],typeName=org.glassfish.kernel.javaee.WebContainerStarter,qualifiers=[],contracts=[],metadata=

{class: [org.glassfish.kernel.javaee.WebContainerStarter] index: [org.glassfish.api.Startup] }

)
): String index out of range: -78|#]

Comment by Amy Roh [ 06/Apr/12 ]

Full server.log displaying the correct error message - "WEB0325: Invalid component: datetime in access log pattern: %client.name% %auth-user-name% %datetime %request% %status% %response.length%"

Comment by Amy Roh [ 11/Apr/12 ]

Fixed in svn 53475. The fix will be available in b33.





[GLASSFISH-646] Grizzly Header Index out of bounds Created: 07/May/06  Updated: 12/Mar/15  Resolved: 08/Jun/06

Status: Resolved
Project: glassfish
Component/s: web_container
Affects Version/s: 9.0pe
Fix Version/s: 9.0pe

Type: Bug Priority: Major
Reporter: jhook Assignee: jfarcand
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: Windows XP
Platform: PC


Issuezilla Id: 646

 Description   

[#|2006-05-07T22:25:29.203-0500|WARNING|sun-appserver-pe9.0|javax.enterprise.system.stream.err|_ThreadID=11;_ThreadName=httpWorkerThread-8080-0;_RequestID=651f1f61-7d04-4b64-9720-5277035edd5e;|
java.lang.ArrayIndexOutOfBoundsException: 4096
at
org.apache.coyote.http11.InternalOutputBuffer.write(InternalOutputBuffer.java:740)
at
org.apache.coyote.http11.InternalOutputBuffer.write(InternalOutputBuffer.java:631)
at
org.apache.coyote.http11.InternalOutputBuffer.sendHeader(InternalOutputBuffer.java:510)
at
com.sun.enterprise.web.connector.grizzly.ProcessorTask.prepareResponse(ProcessorTask.java:1424)
at
com.sun.enterprise.web.connector.grizzly.ProcessorTask.action(ProcessorTask.java:877)
at org.apache.coyote.Response.action(Response.java:197)
at org.apache.coyote.Response.sendHeaders(Response.java:392)
at org.apache.coyote.tomcat5.OutputBuffer.doFlush(OutputBuffer.java:362)
at org.apache.coyote.tomcat5.OutputBuffer.close(OutputBuffer.java:323)
at
org.apache.coyote.tomcat5.CoyoteResponse.finishResponse(CoyoteResponse.java:529)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:235)
at
com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:667)
at
com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(ProcessorTask.java:574)
at
com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:844)
at
com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:287)
at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
at
com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75)

#]

[#|2006-05-07T22:25:29.203-0500|SEVERE|sun-appserver-pe9.0|javax.enterprise.system.container.web|_ThreadID=11;_ThreadName=httpWorkerThread-8080-0;_RequestID=651f1f61-7d04-4b64-9720-5277035edd5e;|WEB0782:
Error finishing response
java.lang.ArrayIndexOutOfBoundsException: 4097
at
org.apache.coyote.http11.InternalOutputBuffer.write(InternalOutputBuffer.java:740)
at
org.apache.coyote.http11.InternalOutputBuffer.sendStatus(InternalOutputBuffer.java:442)
at
com.sun.enterprise.web.connector.grizzly.ProcessorTask.prepareResponse(ProcessorTask.java:1420)
at
com.sun.enterprise.web.connector.grizzly.ProcessorTask.action(ProcessorTask.java:877)
at org.apache.coyote.Response.action(Response.java:195)
at
org.apache.coyote.http11.InternalOutputBuffer.endRequest(InternalOutputBuffer.java:402)
at
com.sun.enterprise.web.connector.grizzly.ProcessorTask.postResponse(ProcessorTask.java:632)
at
com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(ProcessorTask.java:575)
at
com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:844)
at
com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:287)
at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
at
com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75)

#]

I've been experimenting with using Response Headers for handling multiple AJAX
responses at once. This means that a whole slew of content could be written to
a specific header.

I think what's happening is in the InternalOutputBuffer, the write(String)
doesn't handle Strings greater than the buffer size. I don't have this problem
with Tomcat 5.5.



 Comments   
Comment by jluehe [ 08/May/06 ]

Reassigning

Comment by jfarcand [ 08/May/06 ]

If you increase the header file, it will works. Just edit:

glassfish.home/domains/domain/config/domain.xml

<request-processing header-buffer-length-in-bytes="4096"

set the value to 8192 (like Tomcat 5.5) and you will not get this exception. I
will try to catch such configuration problem and report it better. If you have a
chance, can you attach your test case?

Comment by jhook [ 08/May/06 ]

shouldn't it dynamically grow?

i guess in your opinion, is using the response headers to transport this much
data a bad idea?

Comment by jfarcand [ 09/May/06 ]

No, because growing the buffer will make it a good candidate for DoS. I will
investigate to see if I can flush it when it is full.

I don't think that a good idea to transport so much information using the header
(but Grizzly shoudn't fail miserably like that), but I don't know exactly what
your application is doing. I think you restrict yourself to the header buffer
size and your app may not behave exactly the same way in other container (see
http://issues.apache.org/bugzilla/show_bug.cgi?id=36741 which is a similar
problem in Tomcat).

Comment by jfarcand [ 08/Jun/06 ]

Exploring a possible solution by flushing the header buffer when it's full.
Still need to make sure it is compliant with the HTTP spec.

Comment by jfarcand [ 08/Jun/06 ]

Fixed by flushing the header buffer when it becomes full.

/cvs/glassfish/appserv-webtier/src/java/org/apache/coyote/http11/InternalOutputBuffer.java,v
<-- InternalOutputBuffer.java
new revision: 1.3; previous revision: 1.2
done





[GLASSFISH-1916] BufferUnderflowException when GlassFish is fronted with lbplugin Created: 05/Jan/07  Updated: 12/Mar/15  Resolved: 16/Jan/07

Status: Resolved
Project: glassfish
Component/s: web_container
Affects Version/s: 9.1pe
Fix Version/s: 9.0pe

Type: Bug Priority: Major
Reporter: jfarcand Assignee: jfarcand
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issuezilla Id: 1,916

 Description   

Reported by Jothir Ganesan:

I was executing a list of tests for testing the high availability and session
failover features of appserver. Our tests typically does the following:

  • start the cluster
  • send a(or 2-3) request(s) throught the lbplugin to the instance in a cluster.
    The instance listed first in Loadbalancer.xml serves the request. (In our case,
    it is instance1)
  • stop and start the instance(say instance1) that handled the request
  • send the next (remaining) request(s) to check for session availability.
  • Undeploy the app.

For the first few tests, instance1 handled the requests and was working fine.
After ~10 tests, instance 1 threw the exception given below:

[#|2007-01-04T17:19:06.173+0530|WARNING|sun-appserver-ee9.1|GRIZZLY|_ThreadID=13;_ThreadName=httpSSLWorkerThread-1111-0;_RequestID=31671a9f-7684-44b2-af0e-4bd7eb981122;|PortUnification
exception
java.nio.BufferUnderflowException
at java.nio.HeapByteBuffer.get(HeapByteBuffer.java:127)
at java.nio.ByteBuffer.get(ByteBuffer.java:674)
at
com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTask.cancel(PortUnificationPipeline.java:386)
at
com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTask.doTask(PortUnificationPipeline.java:344)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
at
com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:93)

#]

[#|2007-01-04T17:19:11.184+0530|WARNING|sun-appserver-ee9.1|GRIZZLY|_ThreadID=14;_ThreadName=httpSSLWorkerThread-1111-1;_RequestID=4df046c1-87c0-4def-90d0-0e429cafa0ea;|PortUnification
exception
java.nio.BufferUnderflowException
at java.nio.HeapByteBuffer.get(HeapByteBuffer.java:127)
at java.nio.ByteBuffer.get(ByteBuffer.java:674)
at
com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTask.cancel(PortUnificationPipeline.java:386)
at
com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTask.doTask(PortUnificationPipeline.java:344)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
at
com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:93)

#]

[#|2007-01-04T17:19:15.859+0530|INFO|sun-appserver-ee9.1|javax.ee.enterprise.system.tools.synchronization|_ThreadID=15;_ThreadName=RMI
TCP Connection(37)-10.12.163.192;|SYNC062: Synchronization for SimpleSession is
complete. Total time spent 711 milli second(s).|#]

[#|2007-01-04T17:19:15.926+0530|INFO|sun-appserver-ee9.1|javax.enterprise.system.stream.out|_ThreadID=15;_ThreadName=RMI
TCP Connection(37)-10.12.163.192;|
IN HaWebmethodSessionStrategyBuilder NEW|#]

[#|2007-01-04T17:19:15.928+0530|INFO|sun-appserver-ee9.1|javax.enterprise.system.container.web|_ThreadID=15;_ThreadName=RMI
TCP Connection(37)-10.12.163.192;/SimpleSession;ha;web-method;session;|WEB0130:
Enabling ha-based persistence for web module [/SimpleSession]'s sessions:
persistence-type = [ha] / persistenceFrequency = [web-method] / persistenceScope
= [session]|#]

[#|2007-01-04T17:19:16.194+0530|WARNING|sun-appserver-ee9.1|GRIZZLY|_ThreadID=13;_ThreadName=httpSSLWorkerThread-1111-0;_RequestID=31671a9f-7684-44b2-af0e-4bd7eb981122;|PortUnification
exception
java.nio.BufferUnderflowException
at java.nio.HeapByteBuffer.get(HeapByteBuffer.java:127)
at java.nio.ByteBuffer.get(ByteBuffer.java:674)
at
com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTask.cancel(PortUnificationPipeline.java:386)
at
com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTask.doTask(PortUnificationPipeline.java:344)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
at
com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:93)

#]

[#|2007-01-04T17:19:21.206+0530|WARNING|sun-appserver-ee9.1|GRIZZLY|_ThreadID=14;_ThreadName=httpSSLWorkerThread-1111-1;_RequestID=4df046c1-87c0-4def-90d0-0e429cafa0ea;|PortUnification
exception
java.nio.BufferUnderflowException
at java.nio.HeapByteBuffer.get(HeapByteBuffer.java:127)
at java.nio.ByteBuffer.get(ByteBuffer.java:674)
at
com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTask.cancel(PortUnificationPipeline.java:386)
at
com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTask.doTask(PortUnificationPipeline.java:344)
at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
at
com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:93)

#]

and instance1 was not serving requests any more. instance1 was unhealthy, so
lbplugin routed the requests to instance2. But after a few number of tests,
instance2 became not reachable because of the same exception. Finally, instance
3 is handling the requests and is throwing the same exception.......



 Comments   
Comment by jfarcand [ 05/Jan/07 ]

...

Comment by gfbugbridge [ 05/Jan/07 ]

<BT6510143>

Comment by jfarcand [ 05/Jan/07 ]

The exception is caused because of a wrong logic when logging an exception.
Fixed the logging part. Now we need to find what kind of bytes packet the
lbplugin is sending, making the port unification mechanism unable to determine
the protocol.

Checking in PortUnificationPipeline.java;
/cvs/glassfish/appserv-http-engine/src/java/com/sun/enterprise/web/portunif/PortUnificationPipeline.java,v
<-- PortUnificationPipeline.java
new revision: 1.12; previous revision: 1.11
done

Comment by jfarcand [ 05/Jan/07 ]

The workaround is to remove

<property name="proxiedProtocols" value="..."/>

Comment by jfarcand [ 16/Jan/07 ]

Make sure no tentative to sent bytes when the connection has been closed.

Checking in PortUnificationPipeline.java;
/cvs/glassfish/appserv-http-engine/src/java/com/sun/enterprise/web/portunif/PortUnificationPipeline.java,v
<-- PortUnificationPipeline.java
new revision: 1.13; previous revision: 1.12
done





[GLASSFISH-132] NSEE when using JSF selectItems with Collection Created: 09/Jan/06  Updated: 12/Mar/15  Resolved: 13/Jan/06

Status: Resolved
Project: glassfish
Component/s: web_container
Affects Version/s: 9.0pe
Fix Version/s: 9.0pe

Type: Bug Priority: Critical
Reporter: martinadamek Assignee: Ryan Lubke
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: Linux


Attachments: Text File changebundle.txt    
Issuezilla Id: 132

 Description   

It is not possible to use h:selectOneMenu/f:selectItems combination with
Collection passed as f:selectItems value parameter. It is probably caused by
commit from 2005-11-02 11:47:25 to /jsf-ri/src/com/sun/faces/util/Util.java
(version 1.176). next() method of iterator is called twice in one hasNext() loop.
This particular code is self-explaining:
--%<--
while (elements.hasNext()) {
Object element = elements.next();
if (SelectItem.class.isInstance(element)) {
list.add((SelectItem) elements.next());
...
--%<--
I am assigning it to the author of mentioned commit and adding also commit
reviewer, I am not sure this is right category.



 Comments   
Comment by Ryan Lubke [ 09/Jan/06 ]

Created an attachment (id=24)
Proposed fix for 132

Comment by rogerk [ 09/Jan/06 ]

r=rogerk

Comment by Ryan Lubke [ 09/Jan/06 ]

Fix committed to javaserverfaces-sources.
Begin planning next binary integration.

Comment by Ryan Lubke [ 10/Jan/06 ]

Targeting to be available in b34 of GlassFish.

Comment by Ryan Lubke [ 13/Jan/06 ]
      • Issue 151 has been marked as a duplicate of this issue. ***
Comment by Ryan Lubke [ 13/Jan/06 ]

Workaround: Return an Array of SelectItems instead of a Collection.





[GLASSFISH-818] Call to HttpServletResponse.flushBuffer() has no effect on GFv2 B08 Created: 11/Jul/06  Updated: 12/Mar/15  Resolved: 04/Jan/07

Status: Resolved
Project: glassfish
Component/s: web_container
Affects Version/s: 9.1pe
Fix Version/s: 9.0pe

Type: Bug Priority: Major
Reporter: hewagn00 Assignee: jfarcand
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Attachments: Zip Archive ServletTest.zip    
Issuezilla Id: 818

 Description   

See: http://forums.java.net/jive/thread.jspa?threadID=16641&tstart=0



 Comments   
Comment by hewagn00 [ 11/Jul/06 ]

Created an attachment (id=304)
File containing a simple test code to illustrate the problem

Comment by hewagn00 [ 11/Jul/06 ]

Excerpt from the Servlet 2.5 Spec

"
flushBuffer

Forces any content in the buffer to be written to the client. A call to this
method automatically commits the response, meaning the status code and headers
will be written.
"

Comment by jfarcand [ 11/Jul/06 ]

Thanks!

Comment by jfarcand [ 29/Aug/06 ]

Hum....I did try your unit test and the flush happens properly. I've also
verufies with the TCK team we have test for it:

TCK does have a few tests cover flushBuffer method:

verifying content, header after calling flushBuffer;
verifying IllegalArgumentException thrown calling
sendError or send Indirect after flushBuffer called

I did test your web-app with Jetty and Tomcat, and got the same result

Closing as invalid.

Comment by hewagn00 [ 17/Oct/06 ]

Sorry, for the long delay. I'll reopen the issue as discussed with
Jeanfrancois. Hope I can find some time to attach a new test code very soon.


Hi Heiko,

Ok go ahead and re-open the bug (I will investigate more), but what I
read here make sense. Now I don't understand why Jetty and Tomcat gives
the same result. I need to take a closer look at the Spec

Thanks

– Jeanfrancois

Heiko Wagner wrote:
> Hi,
>
> I have been debugging the flushBuffer() method. I according to my findings
there is a problem with the filtering subsystem, that causes the buffer content
not to be written upon call to flushBuffer(). The data is sent when the service
method is left. The Servlet 2.5 spec imposes two requirements:
>
> "
> flushBuffer
>
> Forces any content in the buffer to be written to the client. A call to this
> method automatically commits the response, meaning the status code and
headers
> will be written.
> "
>
> 1) If the request has not been committed, it must be committed, thus writing
the header.
> This is working. The flushBuffer() causes the header to be written to the
internal buffer and isCommitted() returns true.
> (This might make the TCK believe that anything is working properly)
>
> 2) The method must ensure that all data, that has been buffered, must
be "written to the client". So it is also required that the actual data is sent
over the wire.
> This is not working. The data send is triggered by the exit from the service
method, but not from the flushBuffer().
>
> I hope this clears up the problems I encountered. I modified my test code a
bit and set the content length of the response object, since this is a
requirement of the http spec. So my suggestion would be to reopen the issue and
add my fixed test code. I also could add a war for convenience. Can you agree
with that?
>
> Regards
> Heiko

Comment by jfarcand [ 24/Oct/06 ]

Try to enable it in build 23.

Comment by jfarcand [ 24/Oct/06 ]

Updated the wrong issue Still marking it as started.

Comment by gfbugbridge [ 10/Nov/06 ]

<BT6492476>

Comment by gfbugbridge [ 11/Nov/06 ]

<BT6492711>

Comment by jfarcand [ 04/Jan/07 ]

Fixed. Thanks for the unit test.

Checking in DefaultProcessorTask.java;
/cvs/glassfish/appserv-http-engine/src/java/com/sun/enterprise/web/connector/grizzly/DefaultProcessorTask.java,v
<-- DefaultProcessorTask.java
new revision: 1.9; previous revision: 1.8
done





[GLASSFISH-284] Grizzly's File cache not honoring keep-alive for small file (< 1024) Created: 21/Feb/06  Updated: 12/Mar/15  Resolved: 22/Feb/06

Status: Resolved
Project: glassfish
Component/s: web_container
Affects Version/s: 9.0pe
Fix Version/s: 9.0pe

Type: Bug Priority: Major
Reporter: jfarcand Assignee: jfarcand
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issuezilla Id: 284

 Description   

Currently the FileCache isn't honoring keep-alive header value when a small file
is cached. The connection will hangs until keepAliveInSeconds expires if Grizzly
sent a connection: close to the client but internally register the connection
for keep-alive.



 Comments   
Comment by jfarcand [ 21/Feb/06 ]

...

Comment by jfarcand [ 21/Feb/06 ]

...

Comment by jfarcand [ 21/Feb/06 ]

Fixed by making sure the proper header value is used:

Checking in FileCache.java;
/cvs/glassfish/appserv-http-engine/src/java/com/sun/enterprise/web/connector/grizzly/FileCache.java,v
<-- FileCache.java
new revision: 1.14; previous revision: 1.13
done

Comment by jfarcand [ 22/Feb/06 ]

Fixed in b38





[GLASSFISH-314] acceptor-thread attribute doesn't work Created: 27/Feb/06  Updated: 12/Mar/15  Resolved: 14/Mar/06

Status: Resolved
Project: glassfish
Component/s: web_container
Affects Version/s: 9.0pe
Fix Version/s: 9.0pe

Type: Bug Priority: Major
Reporter: jfarcand Assignee: jfarcand
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issuezilla Id: 314

 Description   

The current

<virtual-server ...acceptor-thread="XXX"

doesn't work as it should. The only way to increase the number of selector is to
use

<property name="reader-selectors" value="XXX"/>



 Comments   
Comment by jfarcand [ 27/Feb/06 ]

..

Comment by jfarcand [ 27/Feb/06 ]

...

Comment by jfarcand [ 27/Feb/06 ]

Correction, the attribute is configurable via http-listener, not virtual-server.

Comment by jfarcand [ 27/Feb/06 ]

Fixed by calling the proper API:

Checking in PEWebContainer.java;
/cvs/glassfish/appserv-core/src/java/com/sun/enterprise/web/PEWebContainer.java,v
<-- PEWebContainer.java
new revision: 1.38; previous revision: 1.37
done

Comment by jfarcand [ 27/Feb/06 ]

Fixed in build 39

Comment by jfarcand [ 28/Feb/06 ]

Added additional check:

Checking in SelectorThread.java;
/cvs/glassfish/appserv-http-engine/src/java/com/sun/enterprise/web/connector/grizzly/SelectorThread.java,v
<-- SelectorThread.java
new revision: 1.54; previous revision: 1.53
done

Comment by jfarcand [ 14/Mar/06 ]

More fix. Avoid spawning a Selector thread if the value is equal to 1.

Checking in SelectorThread.java;
/cvs/glassfish/appserv-http-engine/src/java/com/sun/enterprise/web/connector/grizzly/SelectorThread.java,v
<-- SelectorThread.java
new revision: 1.57; previous revision: 1.56
done





[GLASSFISH-3191] The Port Unification Location header creation not thread safe Created: 14/Jun/07  Updated: 12/Mar/15  Resolved: 19/Jun/07

Status: Resolved
Project: glassfish
Component/s: web_container
Affects Version/s: 9.1pe
Fix Version/s: 9.0pe

Type: Bug Priority: Major
Reporter: jfarcand Assignee: jfarcand
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issuezilla Id: 3,191

 Description   

The current Redirector used to redirect http(s) to http(s) might suffer
concurrent issues if two simultaneous requests from two different hosts. The
Redirector must be stateless and host name creation must be created for every
request.



 Comments   
Comment by gfbugbridge [ 14/Jun/07 ]

<BT6569983>

Comment by jfarcand [ 18/Jun/07 ]

Make sure the class is stateless as it can be used by several threads.

Checking in util/Redirector.java;
/cvs/glassfish/appserv-http-engine/src/java/com/sun/enterprise/web/portunif/util/Redirector.java,v
<-- Redirector.java
new revision: 1.9; previous revision: 1.8
done

Comment by jfarcand [ 18/Jun/07 ]

Rolling back the fix as there is a platform dependent problem with the NIO code.

Checking in Redirector.java;
/cvs/glassfish/appserv-http-engine/src/java/com/sun/enterprise/web/portunif/util/Redirector.java,v
<-- Redirector.java
new revision: 1.10; previous revision: 1.9
done

Comment by jfarcand [ 19/Jun/07 ]

Fix the threading issues

Checking in Redirector.java;
/cvs/glassfish/appserv-http-engine/src/java/com/sun/enterprise/web/portunif/util/Redirector.java,v
<-- Redirector.java
new revision: 1.11; previous revision: 1.10
done





[GLASSFISH-559] Virtual HTTP server created while glassfish is running needs restart Created: 09/Apr/06  Updated: 12/Mar/15  Resolved: 06/Jul/06

Status: Resolved
Project: glassfish
Component/s: web_container
Affects Version/s: 9.0pe
Fix Version/s: 9.0pe

Type: Bug Priority: Major
Reporter: alxs Assignee: jfarcand
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: Windows XP
Platform: All


Issuezilla Id: 559
Status Whiteboard:

fixed-9.0peur1


 Description   

While playing around I've created a new virtual HTTP Server (named testserver)
using the web admin console. I used the same values as the default "server" that
comes with the domain1 installation (b43).

I then added a new http listener (named testlistener) for port 9090 also with
same values as for http-listener-1 (except the port). I tied theses two together
setting default virtual server on the listener and http listeners on the server.
When I then try to access my new virtual server on port 9090 I get an empty
page. The log only tells me that my new server (9090) was started.
After shutting down the domain and restarting I can access the server as expected.

I'm not quite sure if this is a defect but since I get no "Restart required" in
the admin console I assume that the new server should be available without a
restart.



 Comments   
Comment by jfarcand [ 10/Apr/06 ]

I suspect it will work if you don't set the default-web module. Looks like this
bug is simialr to issue:

https://glassfish.dev.java.net/issues/show_bug.cgi?id=141

will investigate.

Comment by jfarcand [ 10/Apr/06 ]

The workaround consist of:

+ set the default-web module to something else than " "

or

+ set it to __asadmin, save, and then set it to " ", and save again.

This is a regression introduced by fixing:

https://glassfish.dev.java.net/issues/show_bug.cgi?id=463

will be fixed in b44.

Comment by jfarcand [ 10/Apr/06 ]

Fixed the regression:

hecking in PEWebContainer.java;
/cvs/glassfish/appserv-core/src/java/com/sun/enterprise/web/PEWebContainer.java,v
<-- PEWebContainer.java
new revision: 1.44; previous revision: 1.43
done

Thanks for reporting this.

Comment by jfarcand [ 12/Apr/06 ]
      • Issue 573 has been marked as a duplicate of this issue. ***
Comment by jfarcand [ 12/Apr/06 ]

Change fixed in build.

Comment by dochez [ 13/Jun/06 ]

Need to be fixed in UR1

Comment by km105526 [ 13/Jun/06 ]

...

Comment by jfarcand [ 06/Jul/06 ]

Backported to 9.0 ur1

Checking in PEWebContainer.java;
/cvs/glassfish/appserv-core/src/java/com/sun/enterprise/web/PEWebContainer.java,v
<-- PEWebContainer.java
new revision: 1.42.2.2; previous revision: 1.42.2.1
done





[GLASSFISH-988] Http-Listener Property Compression is not working Created: 23/Aug/06  Updated: 12/Mar/15  Resolved: 19/Oct/06

Status: Resolved
Project: glassfish
Component/s: web_container
Affects Version/s: 9.0pe
Fix Version/s: 9.0pe

Type: Bug Priority: Major
Reporter: lukemauldin Assignee: jfarcand
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issuezilla Id: 988

 Description   

I am configuring Glassfish to enable compression. I placed the following in my
domain.xml:
<http-listener acceptor-threads="1" address="0.0.0.0" blocking-enabled="false"
default-virtual-server="server" enabled="true" family="inet"
id="http-listener-1" port="8080" security-enabled="false" server-name=""
xpowered-by="true">
<property name="compression" value="on"/>
</http-listener>
After I restart the application server I get the following error in the logs:
Unsupported http-listener property (compression) is being ignored



 Comments   
Comment by jfarcand [ 23/Aug/06 ]

Hum....I've downloaded the current nightly and compression is working. Which
build are you using? I did:

<http-listener acceptor-threads="1" address="0.0.0.0" blocking-enabled="false"
default-virtual-server="server" enabled="true" family="inet"
id="http-listener-1" port="8080" security-enabled="false" server-name=""
xpowered-by="true">
<property name="compression" value="on"/>
</http-listener>

and didn't see any warning.

Closing as not a bug. Feel free to re-open if you have a way to reproduce the
problem.

Comment by lukemauldin [ 23/Aug/06 ]

I am able to reproduce it on the 9.0 release. I have not tried to reproduce it
on the 9.1 branch or the 9.0ur1 branch. If it is fixed in the 9.1 branch do
you know if the fix has been backported to the 9.0ur1 branch? If you need any
more information from me to reproduce it on 9.0 I will be glad to assist in any
way possible.

Comment by jfarcand [ 23/Aug/06 ]

I see. This wasn't ported back to the 9.0 branch, so only available in 9.1. Is
it a problem? I can evaluate how risky is to backport it if you can't update to
9.1.

Thanks

Comment by lukemauldin [ 23/Aug/06 ]

I would like to see it backported to at least the 9.0ur1 branch because we are
using the server to support multiple applications that display large amount of
data to users. Enabling compression on our Tomcat web servers has speeded up
similar applications significantly so we would like to enable it on our Sun
Application server as well.

Comment by lukemauldin [ 23/Aug/06 ]

One more thing, we will be unable to update to 9.1 until it is marked as stable
and it is my understanding that will not be until the middle of next year.

Comment by jluehe [ 24/Aug/06 ]

-> JF

Comment by jfarcand [ 19/Oct/06 ]

Ok closing this bug as invalid because It was too dangerous to port it back to
9.0. Sorry you will have to wait for 9.1

Thanks

– Jeanfrancois





[GLASSFISH-2507] NPE When stressing GlassFish and the Pipeline Queue is full. Created: 27/Feb/07  Updated: 12/Mar/15  Resolved: 01/Mar/07

Status: Resolved
Project: glassfish
Component/s: web_container
Affects Version/s: 9.0pe
Fix Version/s: 9.0pe

Type: Bug Priority: Major
Reporter: jfarcand Assignee: jfarcand
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issuezilla Id: 2,507

 Description   

Thanks to Filip Hanik from the Tomcat community:

getting tons of these

[#|2007-02-27T08:39:17.848-0800|SEVERE|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=12;_ThreadName=SelectorThread-8086;_RequestID=851f69a7-f5da-4d08-a748-18f95dde9e8e;|WEB0756:
Caught exception during HTTP processing.
java.lang.NullPointerException
at
com.sun.enterprise.web.connector.grizzly.TaskBase.getChannel(TaskBase.java:292)
at
com.sun.enterprise.web.connector.grizzly.TaskBase.cancelTask(TaskBase.java:306)
at
com.sun.enterprise.web.connector.grizzly.LinkedListPipeline.addTask(LinkedListPipeline.java:249)
at
com.sun.enterprise.web.portunif.PortUnificationPipeline.addTask(PortUnificationPipeline.java:217)
at
com.sun.enterprise.web.connector.grizzly.TaskBase.execute(TaskBase.java:171)
at
com.sun.enterprise.web.connector.grizzly.SelectorThread.handleConnection(SelectorThread.java:1362)
at
com.sun.enterprise.web.connector.grizzly.SelectorThread.doSelect(SelectorThread.java:1266)
at
com.sun.enterprise.web.connector.grizzly.SelectorThread.startListener(SelectorThread.java:1200)
at
com.sun.enterprise.web.connector.grizzly.SelectorThread.startEndpoint(SelectorThread.java:1163)
at
com.sun.enterprise.web.connector.grizzly.SelectorThread.run(SelectorThread.java:1139)

#]

when running the command:
./ab -n 10000 -c 8000 -k http://localhost:8086/load/bd?size=256

note: I had to modify ab to not exit when getting a apr_socket_recv error,
instead it just increments the error counter. The worksaround is to disable the
proxied protocols.



 Comments   
Comment by jfarcand [ 27/Feb/07 ]

Improve the title....

Comment by jfarcand [ 01/Mar/07 ]

Fixed by properly configuring the proxied protocols Task.

Checking in PortUnificationPipeline.java;
/cvs/glassfish/appserv-http-engine/src/java/com/sun/enterprise/web/portunif/PortUnificationPipeline.java,v
<-- PortUnificationPipeline.java
new revision: 1.18; previous revision: 1.17
done

Comment by jfarcand [ 01/Mar/07 ]

200 -> 503 status code changes

/cvs/glassfish/appserv-http-engine/src/java/com/sun/enterprise/web/connector/grizzly/LinkedListPipeline.java,v
<-- LinkedListPipeline.java
new revision: 1.23; previous revision: 1.22
done





[GLASSFISH-463] Unable to reset default-web module without a restart Created: 22/Mar/06  Updated: 12/Mar/15  Resolved: 22/Mar/06

Status: Resolved
Project: glassfish
Component/s: web_container
Affects Version/s: 9.0pe
Fix Version/s: 9.0pe

Type: Bug Priority: Minor
Reporter: jfarcand Assignee: jfarcand
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issuezilla Id: 463

 Description   

The default web module "/" associated with virtual-server "server" (located
under domains/domain1/docroot) cannot be set back to the default web module
without a restart:

1: Set the default web module to glassfish-test. This means glassfish-test is
now the default web-module. Save configuration.
2: Set he default web module back to " " [blanck selection in admin-gui].
3: Query http://localhost:8080/ -> the glassfish-test context root will be
serviced instead of the GlassFish welcome pages.



 Comments   
Comment by jfarcand [ 22/Mar/06 ]

.

Comment by jfarcand [ 22/Mar/06 ]

Fixed this strange but possible scenario.

Checking in PEWebContainer.java;
/cvs/glassfish/appserv-core/src/java/com/sun/enterprise/web/PEWebContainer.java,v
<-- PEWebContainer.java
new revision: 1.42; previous revision: 1.41
done





[GLASSFISH-21312] java.io.IOException: java.util.concurrent.TimeoutException comes up from time to time Created: 23/Feb/15  Updated: 25/Feb/15

Status: Open
Project: glassfish
Component/s: web_container
Affects Version/s: 4.1
Fix Version/s: None

Type: Bug Priority: Major
Reporter: nabizamani Assignee: oleksiys
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Ubuntu 14.04 LTS Server x64, java 1.8.0_31 + JCE Unlimited Strength, GlassFish Server Open Source Edition 4.1 (build 13)



 Description   

Fo a client I migrated from Glassfish 3.1.2.2 to the latest Glassfish 4.1 and now suddenly I can see java.util.concurrent.TimeoutException (see logs below). I can't tell where this comes from. I checked all the log files from GF 3.1.2.2 and there I can't find even a single entry...

[2015-02-23T11:06:43.377+0100] [glassfish 4.1] [WARNING] [] [javax.enterprise.web] [tid: _ThreadID=27 _ThreadName=http-listener-1(2)] [timeMillis: 1424686003377] [levelValue: 900] [[
StandardWrapperValve[default]: Servlet.service() for servlet default threw exception
java.io.IOException: java.util.concurrent.TimeoutException
at org.glassfish.grizzly.http.io.OutputBuffer.blockAfterWriteIfNeeded(OutputBuffer.java:973)
at org.glassfish.grizzly.http.io.OutputBuffer.write(OutputBuffer.java:686)
at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:355)
at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:342)
at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:161)
at org.apache.catalina.servlets.DefaultServlet.copy(DefaultServlet.java:2199)
at org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.java:1085)
at org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:568)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:344)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:96)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:316)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:415)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:282)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.util.concurrent.TimeoutException
at org.glassfish.grizzly.impl.SafeFutureImpl$Sync.innerGet(SafeFutureImpl.java:357)
at org.glassfish.grizzly.impl.SafeFutureImpl.get(SafeFutureImpl.java:264)
at org.glassfish.grizzly.http.io.OutputBuffer.blockAfterWriteIfNeeded(OutputBuffer.java:962)
... 42 more
]]



 Comments   
Comment by oleksiys [ 23/Feb/15 ]

This Exception appears when the server can't write the data to a client. Most probably client or network can't keep up with the server's pace.
You're right, in 3.1.2 we throw different Exception, but logic is the same.

Do you see a particular problem related to this Exception?

Comment by nabizamani [ 23/Feb/15 ]

As of now I don't see any real problem other than annoying amount of logs.
I have also some other new log entries which we never had in Glassfish 3.1.2.2:

  • java.lang.IllegalStateException: getOutputStream() has already been called for this response
  • java.lang.IllegalStateException: Unknown JCDI-enabled managed bean org.apache.struts2.views.jsp.TextTag@ee5597c of class class org.apache.struts2.views.jsp.TextTag

I believe that latter one occurs during restart oder the server or when underlying, maybe deploying.
I will monitor this the next days and let you know about my findings.

Comment by oleksiys [ 23/Feb/15 ]

Well, I think we can reduce the logging level for this exception.
Regarding:

java.lang.IllegalStateException: getOutputStream() has already been called for this response

looks like you call response.getWriter() after response.getOutputStream() was called, you can't combine byte- and character-based writes, that's why you see the exception.

Comment by nabizamani [ 23/Feb/15 ]

Yes, I figured that. However, we did not change anything in the jsp that seems to produce this exception. Like I said, I will monitor and analyze things and post my findings here...

Comment by nabizamani [ 24/Feb/15 ]

I think I got some fIndings:

I get somehow java.io.IOException: java.util.concurrent.TimeoutException
I cannot really reproduce it, it just happens from time to time...
Because of the exception my error page defined in web.xml gets called:

web.xml (just the relevant part):

<!-- catch all errors -->
<error-page>
    <location>/WEB-INF/jsp/error/error.jsp</location>
</error-page>

/WEB-INF/jsp/error/error.jsp :

<%@page isErrorPage="true" session="false"
%><%@ page import="org.apache.log4j.Logger"
%><%@ page trimDirectiveWhitespaces="true" 
%><%
response.setStatus(response.getStatus());   //or some other code
%><html>
    <head>
        <title>Error <%= response.getStatus() %></title>
    </head>
    <body>
        <h2 style="color:red;">Error <%= response.getStatus() %></h2>
    </body>
</html>
<%
Logger log = Logger.getLogger("error");
String uri = (String) request.getAttribute("javax.servlet.error.request_uri");
String info = "(ip='"+request.getRemoteAddr()+"' x-forwarded-for='"+request.getHeader("x-forwarded-for")+"')";
String qs = request.getQueryString();
if (qs != null)
    log.error("HTTP Status "+response.getStatus() +" for request '"+uri+"?"+qs+"' "+info);
else
    log.error("HTTP Status "+response.getStatus() +" for request '"+uri+"' "+info);
%>

So the error.jsp is called, and right after that I get this error in the log file:
java.lang.IllegalStateException: getOutputStream() has already been called for this response

I guess that is because Glassfish has either already sent "some" response or because the connection is closed (i.e. by peer?). What does timeout exactly mean? What kind of timeout are we talking about?

However, I still get the log entries I have in the error.jsp. This is an example log entry:
2015-02-24 17:27:44,985 ERROR error._jspService:76 - HTTP Status 200 for request '/assets/plugins/bootstrap/css/bootstrap.css' (ip='41.216.47.46' x-forwarded-for='null')]]

As you can see the HTTP Status code is 200 (and that is correct, because the file is on the server). Although an error was thrown by the runtime, I guess because the connection was closed or something... I believe that throwing TimeoutException because maybe a connection has closed for some reason and passing it all the way up is the issue here. Do you know if there is some change in the code somewhere here between 3.1.2.2 and 4.1? I can also see some "java.io.IOException: Broken pipe" exceptions in the logs (I believe this is related somehow).

A log file with some relevant parts is attached.

Comment by nabizamani [ 24/Feb/15 ]

Sorry, I can't attach files... So here some logs:

[2015-02-24T17:27:44.984+0100] [glassfish 4.1] [WARNING] [] [javax.enterprise.web] [tid: _ThreadID=36 _ThreadName=http-listener-2(2)] [timeMillis: 1424795264984] [levelValue: 900] [[
StandardWrapperValve[default]: Servlet.service() for servlet default threw exception
java.io.IOException: java.util.concurrent.TimeoutException
at org.glassfish.grizzly.http.io.OutputBuffer.blockAfterWriteIfNeeded(OutputBuffer.java:973)
at org.glassfish.grizzly.http.io.OutputBuffer.write(OutputBuffer.java:686)
at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:355)
at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:342)
at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:161)
at org.apache.catalina.servlets.DefaultServlet.copy(DefaultServlet.java:2199)
at org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.java:1085)
at org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:568)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:344)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
at com.web.filter.ForceHttpsFilter.doFilter(ForceHttpsFilter.java:51)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:316)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:415)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:282)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.util.concurrent.TimeoutException
at org.glassfish.grizzly.impl.SafeFutureImpl$Sync.innerGet(SafeFutureImpl.java:357)
at org.glassfish.grizzly.impl.SafeFutureImpl.get(SafeFutureImpl.java:264)
at org.glassfish.grizzly.http.io.OutputBuffer.blockAfterWriteIfNeeded(OutputBuffer.java:962)
... 45 more
]]

[2015-02-24T17:27:44.986+0100] [glassfish 4.1] [INFO] [] [] [tid: _ThreadID=36 _ThreadName=Thread-8] [timeMillis: 1424795264986] [levelValue: 800] [[
2015-02-24 17:27:44,985 ERROR error._jspService:76 - HTTP Status 200 for request '/assets/plugins/bootstrap/css/bootstrap.css' (ip='41.216.47.46' x-forwarded-for='null')]]

[2015-02-24T17:27:44.986+0100] [glassfish 4.1] [WARNING] [] [javax.enterprise.web.core] [tid: _ThreadID=36 _ThreadName=http-listener-2(2)] [timeMillis: 1424795264986] [levelValue: 900] [[
Servlet.service() for servlet jsp threw exception
java.lang.IllegalStateException: getOutputStream() has already been called for this response
at org.apache.catalina.connector.Response.getWriter(Response.java:777)
at org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:224)
at javax.servlet.ServletResponseWrapper.getWriter(ServletResponseWrapper.java:152)
at org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java:195)
at org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:188)
at org.apache.jasper.runtime.PageContextImpl.release(PageContextImpl.java:240)
at org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext(JspFactoryImpl.java:185)
at org.apache.jasper.runtime.JspFactoryImpl.releasePageContext(JspFactoryImpl.java:137)
at org.apache.jsp.WEB_002dINF.jsp.error.error_jsp._jspService(error_jsp.java:88)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:411)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:473)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:377)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:875)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:739)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:695)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:626)
at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:500)
at org.apache.catalina.core.StandardHostValve.dispatchToErrorPage(StandardHostValve.java:699)
at org.apache.catalina.core.StandardHostValve.throwable(StandardHostValve.java:309)
at org.apache.catalina.core.StandardHostValve.postInvoke(StandardHostValve.java:232)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:417)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:282)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
at java.lang.Thread.run(Thread.java:745)
]]

[2015-02-24T17:27:44.987+0100] [glassfish 4.1] [WARNING] [] [javax.enterprise.web] [tid: _ThreadID=36 _ThreadName=http-listener-2(2)] [timeMillis: 1424795264987] [levelValue: 900] [[
org.apache.catalina.core.StandardHostValve@6d45b284: Exception Processing ErrorPage[errorCode=0, location=/WEB-INF/jsp/error/error.jsp]
java.lang.IllegalStateException: getOutputStream() has already been called for this response
at org.apache.catalina.connector.Response.getWriter(Response.java:777)
at org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:224)
at javax.servlet.ServletResponseWrapper.getWriter(ServletResponseWrapper.java:152)
at org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java:195)
at org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:188)
at org.apache.jasper.runtime.PageContextImpl.release(PageContextImpl.java:240)
at org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext(JspFactoryImpl.java:185)
at org.apache.jasper.runtime.JspFactoryImpl.releasePageContext(JspFactoryImpl.java:137)
at org.apache.jsp.WEB_002dINF.jsp.error.error_jsp._jspService(error_jsp.java:88)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:411)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:473)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:377)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:875)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:739)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:695)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:626)
at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:500)
at org.apache.catalina.core.StandardHostValve.dispatchToErrorPage(StandardHostValve.java:699)
at org.apache.catalina.core.StandardHostValve.throwable(StandardHostValve.java:309)
at org.apache.catalina.core.StandardHostValve.postInvoke(StandardHostValve.java:232)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:417)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:282)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
at java.lang.Thread.run(Thread.java:745)
]]

[2015-02-24T18:03:01.398+0100] [glassfish 4.1] [INFO] [] [] [tid: _ThreadID=38 _ThreadName=Thread-8] [timeMillis: 1424797381398] [levelValue: 800] [[
2015-02-24 18:03:01,397 ERROR error._jspService:76 - HTTP Status 404 for request '/robots.txt' (ip='77.66.121.243' x-forwarded-for='null')]]

[2015-02-24T18:12:38.665+0100] [glassfish 4.1] [WARNING] [] [javax.enterprise.web] [tid: _ThreadID=39 _ThreadName=http-listener-2(5)] [timeMillis: 1424797958665] [levelValue: 900] [[
StandardWrapperValve[default]: Servlet.service() for servlet default threw exception
java.io.IOException: Broken pipe
at sun.nio.ch.FileDispatcherImpl.write0(Native Method)
at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47)
at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93)
at sun.nio.ch.IOUtil.write(IOUtil.java:51)
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:470)
at org.glassfish.grizzly.nio.transport.TCPNIOUtils.flushByteBuffer(TCPNIOUtils.java:149)
at org.glassfish.grizzly.nio.transport.TCPNIOUtils.writeSimpleBuffer(TCPNIOUtils.java:133)
at org.glassfish.grizzly.nio.transport.TCPNIOAsyncQueueWriter.write0(TCPNIOAsyncQueueWriter.java:109)
at org.glassfish.grizzly.nio.transport.TCPNIOAsyncQueueWriter.write0(TCPNIOAsyncQueueWriter.java:91)
at org.glassfish.grizzly.nio.AbstractNIOAsyncQueueWriter.write(AbstractNIOAsyncQueueWriter.java:261)
at org.glassfish.grizzly.nio.AbstractNIOAsyncQueueWriter.write(AbstractNIOAsyncQueueWriter.java:170)
at org.glassfish.grizzly.nio.AbstractNIOAsyncQueueWriter.write(AbstractNIOAsyncQueueWriter.java:70)
at org.glassfish.grizzly.nio.transport.TCPNIOTransportFilter.handleWrite(TCPNIOTransportFilter.java:126)
at org.glassfish.grizzly.filterchain.TransportFilter.handleWrite(TransportFilter.java:191)
at org.glassfish.grizzly.ssl.SSLBaseFilter$SSLTransportFilterWrapper.handleWrite(SSLBaseFilter.java:1004)
at org.glassfish.grizzly.filterchain.ExecutorResolver$8.execute(ExecutorResolver.java:111)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.filterchain.FilterChainContext.write(FilterChainContext.java:848)
at org.glassfish.grizzly.ssl.SSLBaseFilter.handleWrite(SSLBaseFilter.java:332)
at org.glassfish.grizzly.filterchain.ExecutorResolver$8.execute(ExecutorResolver.java:111)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.filterchain.FilterChainContext.write(FilterChainContext.java:848)
at org.glassfish.grizzly.filterchain.FilterChainContext.write(FilterChainContext.java:817)
at org.glassfish.grizzly.http.io.OutputBuffer.flushBuffer(OutputBuffer.java:1024)
at org.glassfish.grizzly.http.io.OutputBuffer.write(OutputBuffer.java:680)
at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:355)
at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:342)
at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:161)
at org.apache.catalina.servlets.DefaultServlet.copyRange(DefaultServlet.java:2477)
at org.apache.catalina.servlets.DefaultServlet.copy(DefaultServlet.java:2212)
at org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.java:1085)
at org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:568)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:344)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
at com.web.filter.ForceHttpsFilter.doFilter(ForceHttpsFilter.java:51)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:316)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:415)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:282)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
at java.lang.Thread.run(Thread.java:745)
]]

[2015-02-24T18:12:38.666+0100] [glassfish 4.1] [INFO] [] [] [tid: _ThreadID=39 _ThreadName=Thread-8] [timeMillis: 1424797958666] [levelValue: 800] [[
2015-02-24 18:12:38,666 ERROR error._jspService:76 - HTTP Status 200 for request '/download/img/prifile.jpg‚ (ip='23.229.97.36' x-forwarded-for='null')]]

[2015-02-24T18:12:38.666+0100] [glassfish 4.1] [WARNING] [] [javax.enterprise.web.core] [tid: _ThreadID=39 _ThreadName=http-listener-2(5)] [timeMillis: 1424797958666] [levelValue: 900] [[
Servlet.service() for servlet jsp threw exception
java.lang.IllegalStateException: getOutputStream() has already been called for this response
at org.apache.catalina.connector.Response.getWriter(Response.java:777)
at org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:224)
at javax.servlet.ServletResponseWrapper.getWriter(ServletResponseWrapper.java:152)
at org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java:195)
at org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:188)
at org.apache.jasper.runtime.PageContextImpl.release(PageContextImpl.java:240)
at org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext(JspFactoryImpl.java:185)
at org.apache.jasper.runtime.JspFactoryImpl.releasePageContext(JspFactoryImpl.java:137)
at org.apache.jsp.WEB_002dINF.jsp.error.error_jsp._jspService(error_jsp.java:88)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:411)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:473)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:377)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:875)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:739)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:695)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:626)
at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:500)
at org.apache.catalina.core.StandardHostValve.dispatchToErrorPage(StandardHostValve.java:699)
at org.apache.catalina.core.StandardHostValve.throwable(StandardHostValve.java:309)
at org.apache.catalina.core.StandardHostValve.postInvoke(StandardHostValve.java:232)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:417)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:282)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
at java.lang.Thread.run(Thread.java:745)
]]

[2015-02-24T18:12:38.667+0100] [glassfish 4.1] [WARNING] [] [javax.enterprise.web] [tid: _ThreadID=39 _ThreadName=http-listener-2(5)] [timeMillis: 1424797958667] [levelValue: 900] [[
org.apache.catalina.core.StandardHostValve@6d45b284: Exception Processing ErrorPage[errorCode=0, location=/WEB-INF/jsp/error/error.jsp]
java.lang.IllegalStateException: getOutputStream() has already been called for this response
at org.apache.catalina.connector.Response.getWriter(Response.java:777)
at org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:224)
at javax.servlet.ServletResponseWrapper.getWriter(ServletResponseWrapper.java:152)
at org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java:195)
at org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:188)
at org.apache.jasper.runtime.PageContextImpl.release(PageContextImpl.java:240)
at org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext(JspFactoryImpl.java:185)
at org.apache.jasper.runtime.JspFactoryImpl.releasePageContext(JspFactoryImpl.java:137)
at org.apache.jsp.WEB_002dINF.jsp.error.error_jsp._jspService(error_jsp.java:88)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:411)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:473)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:377)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:875)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:739)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:695)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:626)
at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:500)
at org.apache.catalina.core.StandardHostValve.dispatchToErrorPage(StandardHostValve.java:699)
at org.apache.catalina.core.StandardHostValve.throwable(StandardHostValve.java:309)
at org.apache.catalina.core.StandardHostValve.postInvoke(StandardHostValve.java:232)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:417)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:282)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
at java.lang.Thread.run(Thread.java:745)
]]

[2015-02-24T18:49:08.494+0100] [glassfish 4.1] [INFO] [] [] [tid: _ThreadID=30 _ThreadName=Thread-8] [timeMillis: 1424800148494] [levelValue: 800] [[
2015-02-24 18:49:08,493 ERROR error._jspService:76 - HTTP Status 404 for request '/WEB-INF/tiles.xml' (ip='202.46.62.153' x-forwarded-for='null')]]

Comment by nabizamani [ 24/Feb/15 ]

I can confirm the assumptions I made above and I can reproduce it now:

1. I assume you have access to a remote glassfish server - NOT ON YOUR OWN MACHINE!
2. Deploy some large file onto that server which you download via browser in the next step - large enough so that you have enough time to disable the network connection (i.e. wifi) on you local machine abruptly
3. Use your browser to download that large file after you have deployed it
4. Once the download has started make sure to a abruptly disable your network connection (on your local machine) before the download finishes - that will simulate a lost network connection...
5. Now check the log files, they will be pretty close to what you can see in my logs

That means:
1. It seems from time to time people accessing our machine simply loose their connection while requesting/downloading some content (that ist not unusual)
2. In GF 4.1 these events are raised/logged as exceptions, it was not like this in GF 3.1.2.2
3. This can cause unwanted behavior, see my explanations in the previous comments. Was there some related change in the Java EE 7 specs???

I don't think that calling the error-page defined in the web.xml is a good decision in case some client has lost network connectivity (caused because the exception is thrown). I am not even sure if it's worth logging it, is it? Others might have different opinions...

Can you reproduce the issue? What do you think?
I think the caller of the Grizzly API should swallow the exceptions, unless there was a change in the Java EE specs...

Comment by oleksiys [ 25/Feb/15 ]

I changed the error message in Grizzly to be more understandable, TimeoutException will be hidden and user will see IOException only with better description.
Otherwise I'll redirect this issue to webcontainer, since it's webcontainer logging the exception and tries to serve the error page.





[GLASSFISH-21311] In the Java EE6,when the version of web2.3 is used,compile JSP pages by the command of jspc exception is happened Created: 23/Feb/15  Updated: 23/Feb/15

Status: Open
Project: glassfish
Component/s: web_container
Affects Version/s: V3
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Cai_Ming Assignee: kchung
Resolution: Unresolved Votes: 0
Labels: PWC6117, web2.3
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Java EE6


Issuezilla Id: 21,311

 Description   

In my application's JSP page, the taglib directive is used to define tag library,
--------------------------
<%@ taglib uri="abc-taglib" prefix="abc" %>
--------------------------
and the web.xml(2.3) is as following with the element 'taglib':
--------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>

<taglib>
<taglib-uri>abc-taglib</taglib-uri>
<taglib-location>/WEB-INF/abcall.tld</taglib-location>
</taglib>

</web-app>
--------------------------

But,In the Java EE6,when I run the command as following:
--------------------------
"jspc -webapp C:\myapp\ContextRoot -v -compile -d C:\myapp\ContextRoot\WEB-INF\classes"
--------------------------
I've got such error message:
--------------------------
"org.apache.jasper.JasperException: file:C:/myapp/ContextRoot/main.jsp(8,41)
PWC6117: File "/abc-taglib" not found".
--------------------------
By the way,In the Java EE5,the exception doesn't happen.

The following is the coding of the org.apache.jasper.compiler.TagLibraryInfoImpl.
--------------------------
public TagLibraryInfoImpl(JspCompilationContext ctxt,
ParserController pc,
String prefix,
String uriIn,
String[] location,▲1
ErrorDispatcher err) throws JasperException {
super(prefix, uriIn);

this.ctxt = ctxt;
this.parserController = pc;
this.pageInfo = pc.getCompiler().getPageInfo();
this.err = err;
InputStream in = null;
JarFile jarFile = null;

if (location == null)

{ // The URI points to the TLD itself or to a JAR file in which the // TLD is stored location = generateTLDLocation(uri, ctxt);▲2 }

try {
if (!location[0].endsWith("jar")) {
// Location points to TLD file
try {
in = getResourceAsStream(location[0]);
if (in == null)

{ throw new FileNotFoundException(location[0]); }

} catch (FileNotFoundException ex)

{ err.jspError("jsp.error.file.not.found", location[0]); ▲3 }

--------------------------
The direct reason is the parameter of the location▲1 is null.
after ▲2,because the resource was not found,exception happened at ▲3.

By the following coding,
the reason why the parameter of the location is null is that the element 'jsp-config' is not found in web.xml(2.3).
--------------------------
org.apache.jasper.servlet.JspCServletContext
private void parseWebDotXml() {

TreeNode jspConfig = web.findChild("jsp-config");   
if (jspConfig == null)

{ return;                      ★1 }

 ...

jspConfigDescriptor =
new JspConfigDescriptorImpl(taglibs, jspPropertyGroups);  
}

org.apache.jasper.runtime.TldScanner
private void processWebDotXml() throws Exception {

JspConfigDescriptor jspConfig = ctxt.getJspConfigDescriptor();   
if (jspConfig == null)

{ return;                             ★2 }

for (TaglibDescriptor taglib: jspConfig.getTaglibs()) {

if (taglib == null)

{ continue; }

String tagUri = taglib.getTaglibURI();      
String tagLoc = taglib.getTaglibLocation();   
...
mappings.put(tagUri, new String[]

{ tagLoc, tagLoc2 }

);      
}
}
--------------------------

as we know,in web 2.3 <taglib> doesn't need to be inside <jsp-config>.
so,web 2.3 is not supported by Java EE6?
or, the phenomenon is a glassfish internal bug?






[GLASSFISH-21306] FileUpload doesn't in webFragment application. Created: 05/Feb/15  Updated: 20/Feb/15

Status: Open
Project: glassfish
Component/s: web_container
Affects Version/s: 4.0_b89_RC5
Fix Version/s: None

Type: Bug Priority: Major
Reporter: MikhailChibel Assignee: kchung
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Mojarra 2.2.9
Java 8
All browsers


Attachments: File FileUploadWar-1.0-SNAPSHOT.war     Zip Archive jsffileuploadissue.zip    

 Description   

The file upload component does not work when web-fragment application(Project1) is put inside web application(Project2). The file is not uploaded and ,there are no javascript or server side exceptions thrown.

The projects structure:
Project1:
\src\main\java\com\torqueits\fileupload\Bean.java
\src\main\resources\META-INF\resources\single.xhtml
\src\main\resources\META-INF\web-fragment.xml

Project2: (has dependency to Project 1)
\src\main\webapp\WEB-INF\web.xml



 Comments   
Comment by MikhailChibel [ 05/Feb/15 ]

I added a test projects to reproduce the issue.
https://bitbucket.org/mchibel/jsffileuploadissue/src

Comment by Manfred Riem [ 05/Feb/15 ]

On which container did you test this?

Comment by MikhailChibel [ 08/Feb/15 ]

Hi.we test it in Glassfish 4.0 build 89 with mojarra 2.2.9

Comment by Manfred Riem [ 11/Feb/15 ]

Can you please send the reproducer (with sources) to issues@javaserverfaces.java.net Thanks!

Comment by MikhailChibel [ 12/Feb/15 ]

The war file and sources sent to the email provided.

Comment by Manfred Riem [ 20/Feb/15 ]

Unfortunately web-fragment processing is a container level concern. Moved it to the Glassfish tracker as it belongs there. Thanks!





[GLASSFISH-21303] A class annotated with both WebService and WebServlet causes deployment failure. Created: 09/Feb/15  Updated: 09/Feb/15

Status: Open
Project: glassfish
Component/s: web_container, web_services
Affects Version/s: 4.1
Fix Version/s: None

Type: Bug Priority: Major
Reporter: jjsnyder83 Assignee: Shing Wai Chan
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

A class in a war with the following annotations causes this exception upon deployment.
Caused by: java.io.IOException: Server returned HTTP response code: 405 for URL: http://localhost:8080/RequestContext/translator?wsdl

If I make the class extend HttpServlet I get a different exception:

Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,1]
Message: Premature end of file.
at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.next(XMLStreamReaderImpl.java:601)

Here is the class:

@WebServlet(loadOnStartup = 1, name = "Translator", urlPatterns = "/translator")
@WebService(endpointInterface = "org.jboss.cdi.tck.tests.context.request.ws.Translator", serviceName = "Translator")
public class TranslatorEndpoint implements Translator {}

I will attach a sample war shortly.






[GLASSFISH-20778] EL 3.0 doesn't behave in Glassfish 4 the same way as in the standalone API Created: 23/Aug/13  Updated: 29/Jan/15  Resolved: 26/Aug/13

Status: Resolved
Project: glassfish
Component/s: web_container
Affects Version/s: 4.0
Fix Version/s: None

Type: Bug Priority: Major
Reporter: marcelocenerine Assignee: kchung
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

windows 7, Dell Inspiron


Tags: EL, jsp

 Description   

While writing some examples using the new features of Expression Language 3.0 (both in JSP and using the standalone API) I noticed that some of the new stuff are not behaving the same way in both places:

1- According to item 1.22 of EL spec, "A static field or static method of a Javaclass can be referenced with the syntax classname.field, such as Boolean.TRUE".
Doing so in the standalone API, it works as expected:

ELProcessor elp = new ELProcessor();
Object ret = elp.eval("Boolean.TRUE");
System.out.println("Output Value: " + ret);

Resulting: "Output Value: true"

or...

ELProcessor elp = new ELProcessor();
Object ret = elp.eval("(x -> Math.sqrt)(9)");
System.out.println("Output Value: " + ret);

prints: 9.0

However, when doing the same thing in JSP, nothing is printed:

$

{Boolean.TRUE}

$

{Integer.MAX_VALUE}

$

{Boolean.TRUE == true}

// prints 'false'
$

{(x -> Math.sqrt(x))(9)}

2 - According to item 1.22.3 of EL spec, "A class name reference, followed by arguments in parenthesis, such as Boolean(true) denotes the invocation of the constructor of the class with the supplied arguments."
Doing so using the standalone API:

ELProcessor elp = new ELProcessor();
Object ret = elp.eval("StringBuilder('Java EE rocks')");
System.out.println("Output Value: " + ret);

Prints: Output Value: Java EE rocks

But, in JSP:

$

{StringBuilder('Java EE rocks')}

Results:

exception
org.apache.jasper.JasperException: javax.el.ELException: Expression uses
functions, but no FunctionMapper was provided root cause

*javax.el.ELException: Expression uses functions, but no FunctionMapper was
provided*

These expressions I have mentioned above wouldn't be supposed to work the same way in JSP and in the standalone API?



 Comments   
Comment by kchung [ 26/Aug/13 ]

Hmm... Looks like the java.lang language is properly imported in stand-alone EL, but not in EL used by JSP container. Will take a look.

Comment by kchung [ 26/Aug/13 ]

The JSP api was fixed.

The maven artifact (javax.servlet.jsp: javax.servlet.jsp-api version 2.3.2-b01) to be published and integrated to glassfish v4.

The fix is also available from the source in svn repo https://svn.java.net/svn/jsp~svn/trunk/api (revision 1459). The jar file can be built with a "mvn install", and the resultant jar file can be integrated with glassfish v4 by copying it to <gf>/modules directory, renaming (and replacing) javax.servlet.jsp-api.jar

Comment by balusc [ 26/Aug/13 ]

Great work.

Please don't forget to implement this on Facelets as well and to update https://java.net/projects/el-spec/pages/StaticField on the subject. This confused a lot of users about the correct syntax of referencing constants in EL. It was mentioned in EL 3.0 EDR, however it was modified in EL 3.0 FR.

Comment by kchung [ 27/Aug/13 ]

I've updated JSP source with a simpler fix.

The call to the constructor of an imported class fail due to a bug in EL. This is also fixed. a new EL jar will be published and integrated into glassfish v4.

Comment by kchung [ 27/Aug/13 ]

For the benefit of other container using EL 3.0, here's a description of the cause for the problem, and how it is fixed in JSP.

In a JSP container, the method ScopedAttributeELResolver.getValue(Object base, Object property) always sets the field ELResolver.propertyResolver to true if the base is null. This is a problem for EL, because only checks that a name is actually an imported class if the name is not resolved by a ELResolver. The fix is to check if the name is an imported class in ScopedAttributeELResolver.

Here's the method in JSP:


package javax.servlet.jsp.el;

public class ScopedAttributeELResolver extends ELResolver {
    ...
    public Object getValue(ELContext context,
                           Object base,
                           Object property) {

        if (context == null) {
            throw new NullPointerException();
        }

        if (base == null) {
            context.setPropertyResolved(true);
            if (property instanceof String) {
                String attribute = (String) property;
                PageContext ctxt = (PageContext)
                                       context.getContext(JspContext.class);
                Object value = ctxt.findAttribute(attribute);
                // To support reference of static fields for imported class in
                // EL 3.0, if a scoped attribute returns null, this attribute
                // is further checked to see if it is the name of an imported
                // class.  If so, an ELClass instance is returned.
                // Note: the JSP spec needs to be updated for this behavior. Note
                // also that this behavior is not backward compatible with JSP 2.2
                // and a runtime switch may be needed to force backward
                // compatility.
                if (value == null) {
                    // check to see if the property is an imported class
                    if (context.getImportHandler() != null) {
                        Class<?> c = context.getImportHandler().resolveClass(attribute);
                        if (c != null) {
                            value = new ELClass(c);
                            // A possible optimization is to set the ELClass
                            // instance in an attribute map.
                        }
                    }
                }
                return value;
            }
        }
        return null;
    }
...
}

Comment by marcelocenerine [ 03/Sep/13 ]

I've built and installed a new version of javax.servlet.jsp-api-2.3.2-b01-SNAPSHOT.jar (based on revision 1460) as explained by kchung. The issues related to accessing static members have been solved. However, constructor invocation doesn't seem to be working. I got the same error:

 
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Expression Language 3.0: Miscelaneous</title>
    </head>
    <body>
        ${Boolean(false)}
    </body>
</html>

ERROR PAGE:

type Exception report
messageInternal Server Error
descriptionThe server encountered an internal error that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: javax.el.ELException: Expression uses functions, but no FunctionMapper was provided
root cause
javax.el.ELException: Expression uses functions, but no FunctionMapper was provided

GLASSFISH LOG:

WARNING: StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
javax.el.ELException: Expression uses functions, but no FunctionMapper was provided
at com.sun.el.parser.AstFunction.getValue(AstFunction.java:161)
at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:226)
at org.jboss.weld.el.WeldValueExpression.getValue(WeldValueExpression.java:50)
at org.apache.jasper.runtime.PageContextImpl.evaluateExpression(PageContextImpl.java:1016)
at org.apache.jsp.newFeatures.miscelaneous_jsp._jspService(miscelaneous_jsp.java:56)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:111)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:411)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:473)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:377)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:357)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:260)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:188)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
at java.lang.Thread.run(Thread.java:722)

Should I update/install any other jar?

Thanks

Comment by kchung [ 03/Sep/13 ]

The failure to invoke the constructor of an import class was fixed in the EL. You'll need to build it from the repository https://svn.java.net/svn/uel~svn/trunk, copy javax.el-3.0.1-b01-SNAPSHOT.jar to <gf>/modules, and renaming (and replacing) javax.el.jar.

Comment by sartoris [ 29/Jan/15 ]

Hello, I realize this issue has been resolved. I see that the JSP API fix is in the JSP 2.3.2-b01 Beta version. Are there any plans to move this from a Beta version to a normal update version?





[GLASSFISH-16937] Having REST services in separate WARs in a single EAR prints classloading warnings Created: 01/Jul/11  Updated: 21/Dec/14

Status: Open
Project: glassfish
Component/s: web_container
Affects Version/s: 3.1
Fix Version/s: 4.1

Type: Bug Priority: Minor
Reporter: mmuller Assignee: Daniel
Resolution: Unresolved Votes: 11
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows Server 2008


Attachments: File ear-1.0.ear     GZip Archive jaxrs_multimodule_test.tar.gz    
Tags: classloader, glassfish-3-1, jax-rs

 Description   

Warnings show up when an EAR is deployed, containing more than one WAR archove with REST web services. Looks like GlassFish/Jersey tries to load all the REST service classes for each of the WARs being deployed, and then shows classloader warnings:

WEB9052: Unable to load class <classname>, reason: java.lang.ClassNotFoundException: <classname>

I did a minimal project which produces an EAR with this structure:

ear-1.0.ear

  • META-INF/
`- application.xml
  • war-1-1.0.war
 
  • classes/
  `- test/war1/Service1.class
`- WEB-INF/
`- web.xml
`- war-2-1.0.war
  • classes/
`- test/war2/Service2.class
`- WEB-INF/
`- web.xml

(See the attached maven project).

test.war1.Service1 and test.war2.Service2 are POJOs with class-level @Path annotation and method-level @GET or @POST annotations.
The application.xml DD is generated by maven-ear-plugin and only contains the two webmodules and their contextroots.
Both web.xml only contain a display name and the Jersey ServletContainer loaded on startup.

When deploying to GlassFish 3.1 on Windows Server 2008, the log contains the following entries:

[#|2011-07-01T10:45:59.159+0200|WARNING|glassfish3.1|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=183;_ThreadName=Thread-1;|WEB9052: Unable to load class test.war2.Service2, reason: java.lang.ClassNotFoundException: test.war2.Service2|#]

[#|2011-07-01T10:45:59.187+0200|INFO|glassfish3.1|com.sun.jersey.api.core.WebAppResourceConfig|_ThreadID=23;_ThreadName=Thread-1;|Scanning for root resource and provider classes in the Web app resource paths:
/WEB-INF/lib
/WEB-INF/classes|#]

[#|2011-07-01T10:45:59.187+0200|INFO|glassfish3.1|com.sun.jersey.api.core.ScanningResourceConfig|_ThreadID=23;_ThreadName=Thread-1;|Root resource classes found:
class test.war1.Service1|#]

[#|2011-07-01T10:45:59.187+0200|INFO|glassfish3.1|com.sun.jersey.api.core.ScanningResourceConfig|_ThreadID=23;_ThreadName=Thread-1;|No provider classes found.|#]

[#|2011-07-01T10:45:59.187+0200|INFO|glassfish3.1|com.sun.jersey.server.impl.application.WebApplicationImpl|_ThreadID=23;_ThreadName=Thread-1;|Initiating Jersey application, version 'Jersey: 1.5 01/14/2011 12:36 PM'|#]

[#|2011-07-01T10:45:59.354+0200|INFO|glassfish3.1|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=183;_ThreadName=Thread-1;|WEB0671: Loading application ear-1.0#war-1-1.0.war at [/war1]|#]

[#|2011-07-01T10:45:59.368+0200|WARNING|glassfish3.1|javax.enterprise.system.container.web.org.glassfish.web.loader|_ThreadID=183;_ThreadName=Thread-1;|WEB9052: Unable to load class test.war1.Service1, reason: java.lang.ClassNotFoundException: test.war1.Service1|#]

[#|2011-07-01T10:45:59.382+0200|INFO|glassfish3.1|com.sun.jersey.api.core.WebAppResourceConfig|_ThreadID=23;_ThreadName=Thread-1;|Scanning for root resource and provider classes in the Web app resource paths:
/WEB-INF/lib
/WEB-INF/classes|#]

[#|2011-07-01T10:45:59.382+0200|INFO|glassfish3.1|com.sun.jersey.api.core.ScanningResourceConfig|_ThreadID=23;_ThreadName=Thread-1;|Root resource classes found:
class test.war2.Service2|#]

[#|2011-07-01T10:45:59.382+0200|INFO|glassfish3.1|com.sun.jersey.api.core.ScanningResourceConfig|_ThreadID=23;_ThreadName=Thread-1;|No provider classes found.|#]

[#|2011-07-01T10:45:59.382+0200|INFO|glassfish3.1|com.sun.jersey.server.impl.application.WebApplicationImpl|_ThreadID=23;_ThreadName=Thread-1;|Initiating Jersey application, version 'Jersey: 1.5 01/14/2011 12:36 PM'|#]

[#|2011-07-01T10:45:59.521+0200|INFO|glassfish3.1|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=183;_ThreadName=Thread-1;|WEB0671: Loading application ear-1.0#war-2-1.0.war at [/war2]|#]

[#|2011-07-01T10:45:59.535+0200|INFO|glassfish3.1|javax.enterprise.system.tools.admin.org.glassfish.deployment.admin|_ThreadID=183;_ThreadName=Thread-1;|ear-1.0 was successfully deployed in 543 milliseconds.|#]

So this looks like Glassfish tries to load both services for each WAR module. When loading war-1, it cannot load test.war2.Service2, and while loading war-2, it cannot load test.war1.Service1...
Although, the application is correctly deployed and all the services do work !!

I guess this is a tiny bug, and could be fixed within a handful of lines. I could try to fix it, if someone could point me to the right module producing this warning.



 Comments   
Comment by mmuller [ 01/Jul/11 ]

Oops, looks like Jira didn't like my folder-tree syntax.

So, the EAR structure is

ear-1.0.ear
  META-INF/
    application.xml
  war-1-1.0.war
    classes/
      test/war1/Service1.class
    WEB-INF/
      web.xml
  war-2-1.0.war
    classes/
      test/war2/Service2.class
    WEB-INF/
      web.xml
Comment by Shing Wai Chan [ 01/Jul/11 ]

The calling stack is as follows:
StandardContext#callServletContainerInitializer
--> ServletContainerInitializerUtil#getInitializerList
--> ServletContainerInitializerUtil#checkAgainstInterestList

and the warning is coming from calling the checkAgainstInterestList method

The issue is from argument of calling the last method as follows:
1. Types classInfo contains the classes information for the ear
which is from WebModule#getTypes
wmInfo.getDeploymentContext().getTransientAppMetaData(
Types.class.getName(), Types.class);
2. WebappClassLoader cl, for war1, say, then it cannot load classes for war2

Even though the returned value of the method is correct, there is unnecessary call for loading other classes.

Comment by geturnerlmco [ 13/Oct/11 ]

This happens if there are multiple WARs, period. I have an application with 5 WARs, two are SOAP service endpoints and 3 are REST. If I remove 2 of the 3 REST WARS, I still get the WARNINGS. If I remove the 2 SOAP WARs, the WARNINGS are gone. I have searched every forum for an answer to this annoying problem, but this is the first one that is the closest to my problem. If anyone has a workaround other than destroying my EAR structure (which doesn't work well for fielding, ha ha) I would really appreciate knowing it.

Comment by geturnerlmco [ 14/Oct/11 ]

One additional comment that I thought would be helpful. I commented out all of the additional WARs from my application.xml but still built the EAR normally. The WARNINGS occured, just because the modules existed in the EAR directory structure, but the module definitions were commented out! Is the class scanner looking for ANY .class file in the EAR directory, whether it was defined to be part of the application or not???

Comment by Dan.Daneasa [ 23/Oct/11 ]

I have more comments on this.
I have 2 wars deployed in the same ear. One is a Jersey simple west app, the other one is an empty war.
I can see the ClassNotFoundExceptions.

There may be more to this problem. If i have an ear with 2 wars, one is a simple Jersey rest app, the other a simple Mojarra faces app. I see that the ClassNotFoundException is still present, also there are Mojarra-impl ClassNotFoundException warnings.
The same happens if i try to integrate MyFaces instead of Mojarra in the faces webapp.
Mojarra/Myfaces tries to load in the Jersey app as well, and vice-versa, Jersey tries to load in the Mojarra/MyFaces app.

If I have only one of the wars in the ear in any of the above combinations then the warnings are not present.

Comment by hpgisler [ 14/Nov/11 ]

Just for the record: Same problem here.

Two WAR's in an EAR
1. WAR JSF frontend
2. WAR REST frontend

If packaging only one of them into EAR, no problem; if packaging both inside EAR, Problem.

Comment by pettymt [ 10/Apr/12 ]

Confirmed on v3.1.1 (build 12)

30 WARs(each containing a REST service) in an EAR is a lot of warnings.

Comment by phealy [ 27/Mar/13 ]

I am getting a warning for every PimesFaces class every time I deploy (because I also have a Jersey app in my EAR). This does not reflect well on Glassfish.

Comment by nabizamani [ 13/Apr/13 ]

I have the same issue with GlassFish 3.1.2.2 (build 5) when deploying an EAR containing 2 wars and 1 ejb module (one of the wars contains restful web services).

Example:
WARNING: WEB9052: Unable to load class com.demo.service.exception.RestExceptionCatcher, reason: java.lang.ClassNotFoundException: com.demo.service.exception.RestExceptionCatcher
WARNING: WEB9052: Unable to load class com.demo.service.Order, reason: java.lang.ClassNotFoundException: com.demo.service.Order

RestExceptionCatcher is a @Provider and implements ExceptionMapper<Throwable>.
Order is a very simple REST service.

These warnings are very frustrating and I really want to get rid of them! But that would means I cannot use my EAR

Comment by yonatan [ 01/May/13 ]

If everything works properly, until the issue is resolved you can raise the logging level of that specific logger by adding javax.enterprise.system.container.web.org.glassfish.web.loader.level=SEVERE to the DOMAIN_HOME/config/logging.properties file.

Comment by andrey.v.markelov [ 07/May/13 ]

I have got the same trouble. Are you going to fix that?

Comment by Shing Wai Chan [ 25/Jun/13 ]

The given test case may need to update for GlassFish 4.

Comment by Daniel [ 25/Jun/13 ]

The web.xml for GF4 should use org.glassfish.jersey.servlet.ServletContainer API instead.

Comment by obfischer [ 17/Mar/14 ]

Is there a chance to get this fixed in the near future? Our monitoring reports all log messages with a log level above INFO. It is very annoying to warnings for a non-existent problem.

Comment by Philipp91 [ 21/Dec/14 ]

This issue should be prioritized higher. It may be a minor problem for people who's logs get flooded by these messages, but it is a major problem for people who can't use the REST services, which they deployed. The classes are not available, NoClassDefFound exceptions occur as follow-ups and the REST service is not available.

I use a simple JAR included in WEB-INF/lib.





[GLASSFISH-21107] When uploading a large file using an async servlet, after 30 seconds it throws an InterruptedByTimeoutException Created: 26/Jun/14  Updated: 10/Dec/14

Status: Open
Project: glassfish
Component/s: configuration, grizzly-kernel, web_container
Affects Version/s: 4.1_b07
Fix Version/s: None

Type: Bug Priority: Major
Reporter: raulgd Assignee: Masoud Kalali
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows 7 64 bit, Java JDK 1.7.0u60 64 bit Glassfish 4.0.1b7 nightly build downloaded on 2014-06-25



 Description   

I created an async servlet for users to upload files, that way the inputstream is buffered without having to load the whole file in memory, as there can be very big files uploaded.

When trying out to upload a 4.6GB file, after 30 seconds, the servlet enters the onError(Throwable t) method with the exception:

Severe:   java.nio.channels.InterruptedByTimeoutException
	at org.apache.catalina.connector.InputBuffer.disableReadHandler(InputBuffer.java:324)
	at org.apache.catalina.connector.Request.asyncTimeout(Request.java:4418)
	at org.apache.catalina.connector.Request.processTimeout(Request.java:4469)
	at org.apache.catalina.connector.Request.access$000(Request.java:156)
	at org.apache.catalina.connector.Request$6.onTimeout(Request.java:4300)
	at org.glassfish.grizzly.http.server.Response$SuspendTimeout.onTimeout(Response.java:2131)
	at org.glassfish.grizzly.http.server.Response$DelayQueueWorker.doWork(Response.java:2180)
	at org.glassfish.grizzly.http.server.Response$DelayQueueWorker.doWork(Response.java:2175)
	at org.glassfish.grizzly.utils.DelayedExecutor$DelayedRunnable.run(DelayedExecutor.java:158)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)

Warning:   Context path from ServletContext:  differs from path from bundle: /
WARN:   WELD-000715: HttpContextLifecycle guard not set. The Servlet container is not fully compliant.

Now, I already configured Glassfish for longer timeouts on both Configurations-> server-config -> Network Config -> Network Listeners -> http-listener-1 -> HTTP So that timeout: -1, Connection upload timeout: 3600000 (1 hour), Request Timeout: -1, Max Post Size: -1

And on Configurations-> server-config -> Network Config -> Transports -> tcp so that Read Timeout: 3600000 (1 hour), Write Timeout: 3600000 (1 hour)

Now, AFAIK, because it's an NIO timeout exception, just by changing the tcp read and write timeout to 1 hour should avoid the issue, but still, the exception happens exactly 30 seconds later, as if the timeout configurations are being ignored.

I saw previous issues on grizzly ignoring the read and write timeouts, but they where closed as fixed in mid. 2013 so it shouldn't be an issue now.

For reference, here's my domain.xml:

<domain log-root="${com.sun.aas.instanceRoot}/logs" application-root="${com.sun.aas.instanceRoot}/applications" version="7">
  <security-configurations>
    <authentication-service default="true" name="adminAuth" use-password-credential="true">
      <security-provider name="spcrealm" type="LoginModule" provider-name="adminSpc">
        <login-module-config name="adminSpecialLM" control-flag="sufficient" module-class="com.sun.enterprise.admin.util.AdminLoginModule">
          <property name="config" value="server-config"></property>
          <property name="auth-realm" value="admin-realm"></property>
        </login-module-config>
      </security-provider>
      <security-provider name="filerealm" type="LoginModule" provider-name="adminFile">
        <login-module-config name="adminFileLM" control-flag="sufficient" module-class="com.sun.enterprise.security.auth.login.FileLoginModule">
          <property name="config" value="server-config"></property>
          <property name="auth-realm" value="admin-realm"></property>
        </login-module-config>
      </security-provider>
    </authentication-service>
    <authorization-service default="true" name="authorizationService">
      <security-provider name="simpleAuthorization" type="Simple" provider-name="simpleAuthorizationProvider">
        <authorization-provider-config support-policy-deploy="false" name="simpleAuthorizationProviderConfig"></authorization-provider-config>
      </security-provider>
    </authorization-service>
  </security-configurations>
  <managed-job-config></managed-job-config>
  <system-applications>
    <application context-root="" location="${com.sun.aas.installRootURI}/lib/install/applications/__admingui" directory-deployed="true" name="__admingui" object-type="system-admin">
      <module name="__admingui">
        <engine sniffer="web"></engine>
        <engine sniffer="security"></engine>
      </module>
    </application>
  </system-applications>
  <resources>
    <jdbc-resource pool-name="SamplePool" jndi-name="jdbc/sample"></jdbc-resource>
    <jdbc-resource pool-name="__TimerPool" jndi-name="jdbc/__TimerPool" object-type="system-admin"></jdbc-resource>
    <jdbc-resource pool-name="DerbyPool" jndi-name="jdbc/__default" object-type="system-all"></jdbc-resource>
    <jdbc-connection-pool datasource-classname="org.apache.derby.jdbc.EmbeddedXADataSource" res-type="javax.sql.XADataSource" name="__TimerPool">
      <property name="databaseName" value="${com.sun.aas.instanceRoot}/lib/databases/ejbtimer"></property>
      <property name="connectionAttributes" value=";create=true"></property>
    </jdbc-connection-pool>
    <jdbc-connection-pool datasource-classname="org.apache.derby.jdbc.ClientDataSource" is-isolation-level-guaranteed="false" res-type="javax.sql.DataSource" name="DerbyPool">
      <property name="PortNumber" value="1527"></property>
      <property name="Password" value="APP"></property>
      <property name="User" value="APP"></property>
      <property name="serverName" value="localhost"></property>
      <property name="DatabaseName" value="sun-appserv-samples"></property>
      <property name="connectionAttributes" value=";create=true"></property>
    </jdbc-connection-pool>
    <connector-connection-pool max-pool-size="250" steady-pool-size="1" name="jms/__defaultConnectionFactory-Connection-Pool" resource-adapter-name="jmsra" connection-definition-name="javax.jms.ConnectionFactory"></connector-connection-pool>
    <connector-resource pool-name="jms/__defaultConnectionFactory-Connection-Pool" jndi-name="jms/__defaultConnectionFactory" object-type="system-all-req"></connector-resource>
    <context-service jndi-name="concurrent/__defaultContextService" object-type="system-all"></context-service>
    <managed-executor-service jndi-name="concurrent/__defaultManagedExecutorService" object-type="system-all"></managed-executor-service>
    <managed-scheduled-executor-service jndi-name="concurrent/__defaultManagedScheduledExecutorService" object-type="system-all"></managed-scheduled-executor-service>
    <managed-thread-factory jndi-name="concurrent/__defaultManagedThreadFactory" object-type="system-all"></managed-thread-factory>
    <jdbc-connection-pool datasource-classname="org.apache.derby.jdbc.ClientDataSource" res-type="javax.sql.DataSource" name="SamplePool">
      <property name="DatabaseName" value="sample"></property>
      <property name="User" value="app"></property>
      <property name="Password" value="app"></property>
      <property name="URL" value="jdbc:derby://localhost:1527/sample"></property>
      <property name="PortNumber" value="1527"></property>
      <property name="serverName" value="localhost"></property>
    </jdbc-connection-pool>
  </resources>
  <servers>
    <server name="server" config-ref="server-config">
      <application-ref ref="__admingui" virtual-servers="__asadmin"></application-ref>
      <application-ref ref="VegosPortal" virtual-servers="server"></application-ref>
      <resource-ref ref="jdbc/__TimerPool"></resource-ref>
      <resource-ref ref="jdbc/__default"></resource-ref>
      <resource-ref ref="jms/__defaultConnectionFactory"></resource-ref>
      <resource-ref ref="concurrent/__defaultContextService"></resource-ref>
      <resource-ref ref="concurrent/__defaultManagedExecutorService"></resource-ref>
      <resource-ref ref="concurrent/__defaultManagedScheduledExecutorService"></resource-ref>
      <resource-ref ref="concurrent/__defaultManagedThreadFactory"></resource-ref>
      <resource-ref ref="jdbc/sample"></resource-ref>
    </server>
  </servers>
  <nodes>
    <node node-host="localhost" name="localhost-domain1" type="CONFIG" install-dir="${com.sun.aas.productRoot}"></node>
  </nodes>
  <configs>
    <config name="server-config">
      <system-property description="Port Number that JMS Service will listen for remote clients connection." name="JMS_PROVIDER_PORT" value="7676"></system-property>
      <http-service>
        <access-log></access-log>
        <virtual-server id="server" network-listeners="http-listener-1,http-listener-2"></virtual-server>
        <virtual-server id="__asadmin" network-listeners="admin-listener"></virtual-server>
      </http-service>
      <iiop-service>
        <orb use-thread-pool-ids="thread-pool-1"></orb>
        <iiop-listener id="orb-listener-1" port="3700" address="0.0.0.0" lazy-init="true"></iiop-listener>
        <iiop-listener id="SSL" port="3820" address="0.0.0.0" security-enabled="true">
          <ssl classname="com.sun.enterprise.security.ssl.GlassfishSSLImpl" cert-nickname="s1as"></ssl>
        </iiop-listener>
        <iiop-listener id="SSL_MUTUALAUTH" port="3920" address="0.0.0.0" security-enabled="true">
          <ssl classname="com.sun.enterprise.security.ssl.GlassfishSSLImpl" cert-nickname="s1as" client-auth-enabled="true"></ssl>
        </iiop-listener>
      </iiop-service>
      <admin-service system-jmx-connector-name="system" type="das-and-server">
        <jmx-connector port="8686" address="0.0.0.0" auth-realm-name="admin-realm" name="system">
          <ssl client-auth="want" classname="com.sun.enterprise.security.ssl.GlassfishSSLImpl" cert-nickname="s1as"></ssl>
        </jmx-connector>
        <property name="adminConsoleContextRoot" value="/admin"></property>
        <property name="adminConsoleDownloadLocation" value="${com.sun.aas.installRoot}/lib/install/applications/admingui.war"></property>
        <property name="ipsRoot" value="${com.sun.aas.installRoot}/.."></property>
        <das-config></das-config>
      </admin-service>
      <connector-service></connector-service>
      <transaction-service tx-log-dir="${com.sun.aas.instanceRoot}/logs"></transaction-service>
      <batch-runtime-configuration></batch-runtime-configuration>
      <jms-service default-jms-host="default_JMS_host" type="EMBEDDED">
        <jms-host port="${JMS_PROVIDER_PORT}" host="localhost" name="default_JMS_host"></jms-host>
      </jms-service>
      <ejb-container>
        <ejb-timer-service></ejb-timer-service>
      </ejb-container>
      <web-container>
        <session-config>
          <session-manager>
            <manager-properties></manager-properties>
            <store-properties></store-properties>
          </session-manager>
          <session-properties></session-properties>
        </session-config>
      </web-container>
      <rest-config></rest-config>
      <cdi-service></cdi-service>
      <diagnostic-service></diagnostic-service>
      <security-service>
        <auth-realm classname="com.sun.enterprise.security.auth.realm.file.FileRealm" name="admin-realm">
          <property name="file" value="${com.sun.aas.instanceRoot}/config/admin-keyfile"></property>
          <property name="jaas-context" value="fileRealm"></property>
        </auth-realm>
        <auth-realm classname="com.sun.enterprise.security.auth.realm.file.FileRealm" name="file">
          <property name="file" value="${com.sun.aas.instanceRoot}/config/keyfile"></property>
          <property name="jaas-context" value="fileRealm"></property>
        </auth-realm>
        <auth-realm classname="com.sun.enterprise.security.auth.realm.certificate.CertificateRealm" name="certificate"></auth-realm>
        <jacc-provider policy-provider="com.sun.enterprise.security.provider.PolicyWrapper" name="default" policy-configuration-factory-provider="com.sun.enterprise.security.provider.PolicyConfigurationFactoryImpl">
          <property name="repository" value="${com.sun.aas.instanceRoot}/generated/policy"></property>
        </jacc-provider>
        <jacc-provider policy-provider="com.sun.enterprise.security.jacc.provider.SimplePolicyProvider" name="simple" policy-configuration-factory-provider="com.sun.enterprise.security.jacc.provider.SimplePolicyConfigurationFactory"></jacc-provider>
        <audit-module classname="com.sun.enterprise.security.ee.Audit" name="default">
          <property name="auditOn" value="false"></property>
        </audit-module>
        <message-security-config auth-layer="SOAP">
          <provider-config provider-type="client" provider-id="XWS_ClientProvider" class-name="com.sun.xml.wss.provider.ClientSecurityAuthModule">
            <request-policy auth-source="content"></request-policy>
            <response-policy auth-source="content"></response-policy>
            <property name="encryption.key.alias" value="s1as"></property>
            <property name="signature.key.alias" value="s1as"></property>
            <property name="dynamic.username.password" value="false"></property>
            <property name="debug" value="false"></property>
          </provider-config>
          <provider-config provider-type="client" provider-id="ClientProvider" class-name="com.sun.xml.wss.provider.ClientSecurityAuthModule">
            <request-policy auth-source="content"></request-policy>
            <response-policy auth-source="content"></response-policy>
            <property name="encryption.key.alias" value="s1as"></property>
            <property name="signature.key.alias" value="s1as"></property>
            <property name="dynamic.username.password" value="false"></property>
            <property name="debug" value="false"></property>
            <property name="security.config" value="${com.sun.aas.instanceRoot}/config/wss-server-config-1.0.xml"></property>
          </provider-config>
          <provider-config provider-type="server" provider-id="XWS_ServerProvider" class-name="com.sun.xml.wss.provider.ServerSecurityAuthModule">
            <request-policy auth-source="content"></request-policy>
            <response-policy auth-source="content"></response-policy>
            <property name="encryption.key.alias" value="s1as"></property>
            <property name="signature.key.alias" value="s1as"></property>
            <property name="debug" value="false"></property>
          </provider-config>
          <provider-config provider-type="server" provider-id="ServerProvider" class-name="com.sun.xml.wss.provider.ServerSecurityAuthModule">
            <request-policy auth-source="content"></request-policy>
            <response-policy auth-source="content"></response-policy>
            <property name="encryption.key.alias" value="s1as"></property>
            <property name="signature.key.alias" value="s1as"></property>
            <property name="debug" value="false"></property>
            <property name="security.config" value="${com.sun.aas.instanceRoot}/config/wss-server-config-1.0.xml"></property>
          </provider-config>
        </message-security-config>
        <message-security-config auth-layer="HttpServlet">
          <provider-config provider-type="server" provider-id="GFConsoleAuthModule" class-name="org.glassfish.admingui.common.security.AdminConsoleAuthModule">
            <request-policy auth-source="sender"></request-policy>
            <response-policy></response-policy>
            <property name="loginPage" value="/login.jsf"></property>
            <property name="loginErrorPage" value="/loginError.jsf"></property>
          </provider-config>
        </message-security-config>
        <property name="default-digest-algorithm" value="SHA-256"></property>
      </security-service>
      <java-config debug-options="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=9009" system-classpath="" classpath-suffix="">
        <jvm-options>-XX:MaxPermSize=256m</jvm-options>
        <jvm-options>-client</jvm-options>
        <jvm-options>-Djava.awt.headless=true</jvm-options>
        <jvm-options>-Djdk.corba.allowOutputStreamSubclass=true</jvm-options>
        <jvm-options>-Djavax.management.builder.initial=com.sun.enterprise.v3.admin.AppServerMBeanServerBuilder</jvm-options>
        <jvm-options>-XX:+UnlockDiagnosticVMOptions</jvm-options>
        <jvm-options>-Djava.endorsed.dirs=${com.sun.aas.installRoot}/modules/endorsed${path.separator}${com.sun.aas.installRoot}/lib/endorsed</jvm-options>
        <jvm-options>-Djava.security.policy=${com.sun.aas.instanceRoot}/config/server.policy</jvm-options>
        <jvm-options>-Djava.security.auth.login.config=${com.sun.aas.instanceRoot}/config/login.conf</jvm-options>
        <jvm-options>-Dcom.sun.enterprise.security.httpsOutboundKeyAlias=s1as</jvm-options>
        <jvm-options>-Xmx1024m</jvm-options>
        <jvm-options>-Djavax.net.ssl.keyStore=${com.sun.aas.instanceRoot}/config/keystore.jks</jvm-options>
        <jvm-options>-Djavax.net.ssl.trustStore=${com.sun.aas.instanceRoot}/config/cacerts.jks</jvm-options>
        <jvm-options>-Djava.ext.dirs=${com.sun.aas.javaRoot}/lib/ext${path.separator}${com.sun.aas.javaRoot}/jre/lib/ext${path.separator}${com.sun.aas.instanceRoot}/lib/ext</jvm-options>
        <jvm-options>-Djdbc.drivers=org.apache.derby.jdbc.ClientDriver</jvm-options>
        <jvm-options>-DANTLR_USE_DIRECT_CLASS_LOADING=true</jvm-options>
        <jvm-options>-Dcom.sun.enterprise.config.config_environment_factory_class=com.sun.enterprise.config.serverbeans.AppserverConfigEnvironmentFactory</jvm-options>
        <jvm-options>-Dorg.glassfish.additionalOSGiBundlesToStart=org.apache.felix.shell,org.apache.felix.gogo.runtime,org.apache.felix.gogo.shell,org.apache.felix.gogo.command,org.apache.felix.shell.remote,org.apache.felix.fileinstall</jvm-options>
        <jvm-options>-Dosgi.shell.telnet.port=6666</jvm-options>
        <jvm-options>-Dosgi.shell.telnet.maxconn=1</jvm-options>
        <jvm-options>-Dosgi.shell.telnet.ip=127.0.0.1</jvm-options>
        <jvm-options>-Dgosh.args=--nointeractive</jvm-options>
        <jvm-options>-Dfelix.fileinstall.dir=${com.sun.aas.installRoot}/modules/autostart/</jvm-options>
        <jvm-options>-Dfelix.fileinstall.poll=5000</jvm-options>
        <jvm-options>-Dfelix.fileinstall.log.level=2</jvm-options>
        <jvm-options>-Dfelix.fileinstall.bundles.new.start=true</jvm-options>
        <jvm-options>-Dfelix.fileinstall.bundles.startTransient=true</jvm-options>
        <jvm-options>-Dfelix.fileinstall.disableConfigSave=false</jvm-options>
        <jvm-options>-XX:NewRatio=2</jvm-options>
      </java-config>
      <network-config>
        <protocols>
          <protocol name="http-listener-1">
            <http request-timeout-seconds="-1" timeout-seconds="-1" connection-upload-timeout-millis="3600000" default-virtual-server="server" max-connections="1500">
              <file-cache></file-cache>
            </http>
          </protocol>
          <protocol security-enabled="true" name="http-listener-2">
            <http default-virtual-server="server" max-connections="250">
              <file-cache></file-cache>
            </http>
            <ssl classname="com.sun.enterprise.security.ssl.GlassfishSSLImpl" ssl3-enabled="false" cert-nickname="s1as"></ssl>
          </protocol>
          <protocol name="admin-listener">
            <http default-virtual-server="__asadmin" max-connections="250" encoded-slash-enabled="true">
              <file-cache></file-cache>
            </http>
          </protocol>
          <protocol security-enabled="true" name="sec-admin-listener">
            <http default-virtual-server="__asadmin" encoded-slash-enabled="true">
              <file-cache></file-cache>
            </http>
            <ssl client-auth="want" classname="com.sun.enterprise.security.ssl.GlassfishSSLImpl" cert-nickname="s1as"></ssl>
          </protocol>
          <protocol name="admin-http-redirect">
            <http-redirect secure="true"></http-redirect>
          </protocol>
          <protocol name="pu-protocol">
            <port-unification>
              <protocol-finder protocol="sec-admin-listener" name="http-finder" classname="org.glassfish.grizzly.config.portunif.HttpProtocolFinder"></protocol-finder>
              <protocol-finder protocol="admin-http-redirect" name="admin-http-redirect" classname="org.glassfish.grizzly.config.portunif.HttpProtocolFinder"></protocol-finder>
            </port-unification>
          </protocol>
        </protocols>
        <network-listeners>
          <network-listener port="80" protocol="http-listener-1" transport="tcp" name="http-listener-1" thread-pool="http-thread-pool"></network-listener>
          <network-listener port="8181" protocol="http-listener-2" transport="tcp" name="http-listener-2" thread-pool="http-thread-pool"></network-listener>
          <network-listener port="4848" protocol="pu-protocol" transport="tcp" name="admin-listener" thread-pool="admin-thread-pool"></network-listener>
        </network-listeners>
        <transports>
          <transport write-timeout-millis="3600000" byte-buffer-type="HEAP" read-timeout-millis="3600000" display-configuration="true" name="tcp"></transport>
        </transports>
      </network-config>
      <thread-pools>
        <thread-pool max-thread-pool-size="50" name="admin-thread-pool" max-queue-size="256"></thread-pool>
        <thread-pool name="http-thread-pool"></thread-pool>
        <thread-pool max-thread-pool-size="200" name="thread-pool-1"></thread-pool>
      </thread-pools>
      <monitoring-service>
        <module-monitoring-levels></module-monitoring-levels>
      </monitoring-service>
      <group-management-service>
        <failure-detection></failure-detection>
      </group-management-service>
      <availability-service></availability-service>
    </config>
    <config name="default-config">
      <http-service>
        <access-log></access-log>
        <virtual-server id="server" network-listeners="http-listener-1, http-listener-2">
          <property name="default-web-xml" value="${com.sun.aas.instanceRoot}/config/default-web.xml"></property>
        </virtual-server>
        <virtual-server id="__asadmin" network-listeners="admin-listener"></virtual-server>
      </http-service>
      <iiop-service>
        <orb use-thread-pool-ids="thread-pool-1"></orb>
        <iiop-listener id="orb-listener-1" port="${IIOP_LISTENER_PORT}" address="0.0.0.0"></iiop-listener>
        <iiop-listener id="SSL" port="${IIOP_SSL_LISTENER_PORT}" address="0.0.0.0" security-enabled="true">
          <ssl classname="com.sun.enterprise.security.ssl.GlassfishSSLImpl" cert-nickname="s1as"></ssl>
        </iiop-listener>
        <iiop-listener id="SSL_MUTUALAUTH" port="${IIOP_SSL_MUTUALAUTH_PORT}" address="0.0.0.0" security-enabled="true">
          <ssl classname="com.sun.enterprise.security.ssl.GlassfishSSLImpl" cert-nickname="s1as" client-auth-enabled="true"></ssl>
        </iiop-listener>
      </iiop-service>
      <admin-service system-jmx-connector-name="system">
        <jmx-connector port="${JMX_SYSTEM_CONNECTOR_PORT}" address="0.0.0.0" auth-realm-name="admin-realm" name="system">
          <ssl client-auth="want" classname="com.sun.enterprise.security.ssl.GlassfishSSLImpl" cert-nickname="glassfish-instance"></ssl>
        </jmx-connector>
        <property name="adminConsoleDownloadLocation" value="${com.sun.aas.installRoot}/lib/install/applications/admingui.war"></property>
        <das-config></das-config>
      </admin-service>
      <web-container>
        <session-config>
          <session-manager>
            <manager-properties></manager-properties>
            <store-properties></store-properties>
          </session-manager>
          <session-properties></session-properties>
        </session-config>
      </web-container>
      <ejb-container>
        <ejb-timer-service></ejb-timer-service>
      </ejb-container>
      <mdb-container></mdb-container>
      <jms-service addresslist-behavior="priority" default-jms-host="default_JMS_host" type="EMBEDDED">
        <jms-host port="${JMS_PROVIDER_PORT}" host="localhost" name="default_JMS_host"></jms-host>
      </jms-service>
      <log-service log-rotation-limit-in-bytes="2000000" file="${com.sun.aas.instanceRoot}/logs/server.log">
        <module-log-levels></module-log-levels>
      </log-service>
      <security-service>
        <auth-realm classname="com.sun.enterprise.security.auth.realm.file.FileRealm" name="admin-realm">
          <property name="file" value="${com.sun.aas.instanceRoot}/config/admin-keyfile"></property>
          <property name="jaas-context" value="fileRealm"></property>
        </auth-realm>
        <auth-realm classname="com.sun.enterprise.security.auth.realm.file.FileRealm" name="file">
          <property name="file" value="${com.sun.aas.instanceRoot}/config/keyfile"></property>
          <property name="jaas-context" value="fileRealm"></property>
        </auth-realm>
        <auth-realm classname="com.sun.enterprise.security.auth.realm.certificate.CertificateRealm" name="certificate"></auth-realm>
        <jacc-provider policy-provider="com.sun.enterprise.security.provider.PolicyWrapper" name="default" policy-configuration-factory-provider="com.sun.enterprise.security.provider.PolicyConfigurationFactoryImpl">
          <property name="repository" value="${com.sun.aas.instanceRoot}/generated/policy"></property>
        </jacc-provider>
        <jacc-provider policy-provider="com.sun.enterprise.security.jacc.provider.SimplePolicyProvider" name="simple" policy-configuration-factory-provider="com.sun.enterprise.security.jacc.provider.SimplePolicyConfigurationFactory"></jacc-provider>
        <audit-module classname="com.sun.enterprise.security.ee.Audit" name="default">
          <property name="auditOn" value="false"></property>
        </audit-module>
        <message-security-config auth-layer="SOAP">
          <provider-config provider-type="client" provider-id="XWS_ClientProvider" class-name="com.sun.xml.wss.provider.ClientSecurityAuthModule">
            <request-policy auth-source="content"></request-policy>
            <response-policy auth-source="content"></response-policy>
            <property name="encryption.key.alias" value="s1as"></property>
            <property name="signature.key.alias" value="s1as"></property>
            <property name="dynamic.username.password" value="false"></property>
            <property name="debug" value="false"></property>
          </provider-config>
          <provider-config provider-type="client" provider-id="ClientProvider" class-name="com.sun.xml.wss.provider.ClientSecurityAuthModule">
            <request-policy auth-source="content"></request-policy>
            <response-policy auth-source="content"></response-policy>
            <property name="encryption.key.alias" value="s1as"></property>
            <property name="signature.key.alias" value="s1as"></property>
            <property name="dynamic.username.password" value="false"></property>
            <property name="debug" value="false"></property>
            <property name="security.config" value="${com.sun.aas.instanceRoot}/config/wss-server-config-1.0.xml"></property>
          </provider-config>
          <provider-config provider-type="server" provider-id="XWS_ServerProvider" class-name="com.sun.xml.wss.provider.ServerSecurityAuthModule">
            <request-policy auth-source="content"></request-policy>
            <response-policy auth-source="content"></response-policy>
            <property name="encryption.key.alias" value="s1as"></property>
            <property name="signature.key.alias" value="s1as"></property>
            <property name="debug" value="false"></property>
          </provider-config>
          <provider-config provider-type="server" provider-id="ServerProvider" class-name="com.sun.xml.wss.provider.ServerSecurityAuthModule">
            <request-policy auth-source="content"></request-policy>
            <response-policy auth-source="content"></response-policy>
            <property name="encryption.key.alias" value="s1as"></property>
            <property name="signature.key.alias" value="s1as"></property>
            <property name="debug" value="false"></property>
            <property name="security.config" value="${com.sun.aas.instanceRoot}/config/wss-server-config-1.0.xml"></property>
          </provider-config>
        </message-security-config>
      </security-service>
      <transaction-service tx-log-dir="${com.sun.aas.instanceRoot}/logs" automatic-recovery="true"></transaction-service>
      <diagnostic-service></diagnostic-service>
      <java-config debug-options="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=${JAVA_DEBUGGER_PORT}" system-classpath="" classpath-suffix="">
        <jvm-options>-XX:MaxPermSize=256m</jvm-options>
        <jvm-options>-server</jvm-options>
        <jvm-options>-Djava.awt.headless=true</jvm-options>
        <jvm-options>-Djdk.corba.allowOutputStreamSubclass=true</jvm-options>
        <jvm-options>-XX:+UnlockDiagnosticVMOptions</jvm-options>
        <jvm-options>-Djava.endorsed.dirs=${com.sun.aas.installRoot}/modules/endorsed${path.separator}${com.sun.aas.installRoot}/lib/endorsed</jvm-options>
        <jvm-options>-Djava.security.policy=${com.sun.aas.instanceRoot}/config/server.policy</jvm-options>
        <jvm-options>-Djava.security.auth.login.config=${com.sun.aas.instanceRoot}/config/login.conf</jvm-options>
        <jvm-options>-Dcom.sun.enterprise.security.httpsOutboundKeyAlias=s1as</jvm-options>
        <jvm-options>-Djavax.net.ssl.keyStore=${com.sun.aas.instanceRoot}/config/keystore.jks</jvm-options>
        <jvm-options>-Djavax.net.ssl.trustStore=${com.sun.aas.instanceRoot}/config/cacerts.jks</jvm-options>
        <jvm-options>-Djava.ext.dirs=${com.sun.aas.javaRoot}/lib/ext${path.separator}${com.sun.aas.javaRoot}/jre/lib/ext${path.separator}${com.sun.aas.instanceRoot}/lib/ext</jvm-options>
        <jvm-options>-Djdbc.drivers=org.apache.derby.jdbc.ClientDriver</jvm-options>
        <jvm-options>-DANTLR_USE_DIRECT_CLASS_LOADING=true</jvm-options>
        <jvm-options>-Dcom.sun.enterprise.config.config_environment_factory_class=com.sun.enterprise.config.serverbeans.AppserverConfigEnvironmentFactory</jvm-options>
        <jvm-options>-XX:NewRatio=2</jvm-options>
        <jvm-options>-Xmx1024m</jvm-options>
        <jvm-options>-Dorg.glassfish.additionalOSGiBundlesToStart=org.apache.felix.shell,org.apache.felix.gogo.runtime,org.apache.felix.gogo.shell,org.apache.felix.gogo.command,org.apache.felix.fileinstall</jvm-options>
        <jvm-options>-Dosgi.shell.telnet.port=${OSGI_SHELL_TELNET_PORT}</jvm-options>
        <jvm-options>-Dosgi.shell.telnet.maxconn=1</jvm-options>
        <jvm-options>-Dosgi.shell.telnet.ip=127.0.0.1</jvm-options>
        <jvm-options>-Dgosh.args=--noshutdown -c noop=true</jvm-options>
        <jvm-options>-Dfelix.fileinstall.dir=${com.sun.aas.installRoot}/modules/autostart/</jvm-options>
        <jvm-options>-Dfelix.fileinstall.poll=5000</jvm-options>
        <jvm-options>-Dfelix.fileinstall.log.level=3</jvm-options>
        <jvm-options>-Dfelix.fileinstall.bundles.new.start=true</jvm-options>
        <jvm-options>-Dfelix.fileinstall.bundles.startTransient=true</jvm-options>
        <jvm-options>-Dfelix.fileinstall.disableConfigSave=false</jvm-options>
      </java-config>
      <availability-service>
        <web-container-availability></web-container-availability>
        <ejb-container-availability sfsb-store-pool-name="jdbc/hastore"></ejb-container-availability>
        <jms-availability></jms-availability>
      </availability-service>
      <network-config>
        <protocols>
          <protocol name="http-listener-1">
            <http default-virtual-server="server">
              <file-cache></file-cache>
            </http>
          </protocol>
          <protocol security-enabled="true" name="http-listener-2">
            <http default-virtual-server="server">
              <file-cache></file-cache>
            </http>
            <ssl classname="com.sun.enterprise.security.ssl.GlassfishSSLImpl" ssl3-enabled="false" cert-nickname="s1as"></ssl>
          </protocol>
          <protocol name="admin-listener">
            <http default-virtual-server="__asadmin" max-connections="250">
              <file-cache></file-cache>
            </http>
          </protocol>
          <protocol security-enabled="true" name="sec-admin-listener">
            <http default-virtual-server="__asadmin" encoded-slash-enabled="true">
              <file-cache></file-cache>
            </http>
            <ssl client-auth="want" classname="com.sun.enterprise.security.ssl.GlassfishSSLImpl" cert-nickname="glassfish-instance"></ssl>
          </protocol>
          <protocol name="admin-http-redirect">
            <http-redirect secure="true"></http-redirect>
          </protocol>
          <protocol name="pu-protocol">
            <port-unification>
              <protocol-finder protocol="sec-admin-listener" classname="org.glassfish.grizzly.config.portunif.HttpProtocolFinder" name="http-finder"></protocol-finder>
              <protocol-finder protocol="admin-http-redirect" classname="org.glassfish.grizzly.config.portunif.HttpProtocolFinder" name="admin-http-redirect"></protocol-finder>
            </port-unification>
          </protocol>
        </protocols>
        <network-listeners>
          <network-listener port="${HTTP_LISTENER_PORT}" protocol="http-listener-1" transport="tcp" name="http-listener-1" thread-pool="http-thread-pool"></network-listener>
          <network-listener port="${HTTP_SSL_LISTENER_PORT}" protocol="http-listener-2" transport="tcp" name="http-listener-2" thread-pool="http-thread-pool"></network-listener>
          <network-listener port="${ASADMIN_LISTENER_PORT}" protocol="pu-protocol" transport="tcp" name="admin-listener" thread-pool="http-thread-pool"></network-listener>
        </network-listeners>
        <transports>
          <transport name="tcp"></transport>
        </transports>
      </network-config>
      <thread-pools>
        <thread-pool name="http-thread-pool"></thread-pool>
        <thread-pool max-thread-pool-size="200" name="thread-pool-1"></thread-pool>
        <thread-pool max-thread-pool-size="50" name="admin-thread-pool" max-queue-size="256"></thread-pool>
      </thread-pools>
      <group-management-service>
        <failure-detection></failure-detection>
      </group-management-service>
      <system-property description="Port Number that JMS Service will listen for remote clients connection." name="JMS_PROVIDER_PORT" value="27676"></system-property>
      <system-property name="ASADMIN_LISTENER_PORT" value="24848"></system-property>
      <system-property name="HTTP_LISTENER_PORT" value="28080"></system-property>
      <system-property name="HTTP_SSL_LISTENER_PORT" value="28181"></system-property>
      <system-property name="IIOP_LISTENER_PORT" value="23700"></system-property>
      <system-property name="IIOP_SSL_LISTENER_PORT" value="23820"></system-property>
      <system-property name="IIOP_SSL_MUTUALAUTH_PORT" value="23920"></system-property>
      <system-property name="JMX_SYSTEM_CONNECTOR_PORT" value="28686"></system-property>
      <system-property name="OSGI_SHELL_TELNET_PORT" value="26666"></system-property>
      <system-property name="JAVA_DEBUGGER_PORT" value="29009"></system-property>
      <monitoring-service>
        <module-monitoring-levels></module-monitoring-levels>
      </monitoring-service>
    </config>
  </configs>
  <property name="administrative.domain.name" value="domain1"></property>
  <secure-admin enabled="true" special-admin-indicator="8666d952-1f41-4ba9-a0c0-ec7396d974b7">
    <secure-admin-principal dn="CN=localhost,OU=GlassFish,O=Oracle Corporation,L=Santa Clara,ST=California,C=US"></secure-admin-principal>
    <secure-admin-principal dn="CN=localhost-instance,OU=GlassFish,O=Oracle Corporation,L=Santa Clara,ST=California,C=US"></secure-admin-principal>
  </secure-admin>
  <clusters></clusters>
  <applications>
    <application context-root="/vegos" location="file:/D:/NetbeansProjects/VegosPortal/target/VegosPortal-1.0/" name="VegosPortal" directory-deployed="true" object-type="user">
      <property name="archiveType" value="war"></property>
      <property name="appLocation" value="file:/D:/NetbeansProjects/VegosPortal/target/VegosPortal-1.0/"></property>
      <property name="org.glassfish.ejb.container.application_unique_id" value="91995825334714368"></property>
      <property name="defaultAppName" value="VegosPortal-1.0"></property>
      <module name="VegosPortal">
        <engine sniffer="ejb"></engine>
        <engine sniffer="security"></engine>
        <engine sniffer="weld"></engine>
        <engine sniffer="web"></engine>
      </module>
    </application>
  </applications>
</domain>

I tried the exact same code in WildFly 8.1.0 and works perfectly, so I know it's grizzly's NIO configuration.



 Comments   
Comment by raulgd [ 10/Dec/14 ]

This problem doesn't happen in Glassfish 4.1b13 with JDK 8u25 anymore.

Only there are 2 things to specify, first, the http-thread-pool timeout also has to be set to the same timeout as the tcp read timeout and connection upload timeout.

The other one, on the async servlet, right after initiating the async context with:

AsyncContext context = request.startAsync(); 

You have to set the timeout for the context with:

context.setTimeout(3600000);

Just replace the 3600000 with whatever timeout you set.

It would be ideal to just have the servlet get the timeout specified from the domain configuration, but at least is working now setting it by hand.





[GLASSFISH-21148] User is logged out on SSO cluster Created: 30/Jul/14  Updated: 07/Nov/14  Resolved: 07/Nov/14

Status: Resolved
Project: glassfish
Component/s: web_container
Affects Version/s: 4.0, 4.1_b10
Fix Version/s: None

Type: Bug Priority: Critical
Reporter: dmatej Assignee: Shing Wai Chan
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 1 hour
Time Spent: Not Specified
Original Estimate: 1 hour

Tags: cluster, sso

 Description   

Application:
EAR with many WAR and some EJB modules, sharing same custom realm.
Domain:
Cluster with two instances, both with the EAR enabled.
HA can be disabled or enabled, it has no effect on the issue.

Scenario:
1) User logs in on the instance1
2) User works on instance1 without problems
3) User switches to instance2
4) User works on instance2 without problems
5) User switches to instance1 - and sometimes is logged out.

I have found the source of the problem, I will attach a patch(es) today.



 Comments   
Comment by dmatej [ 30/Jul/14 ]

This is current patch fixing the bug. The problem was that the entry metadata instance is created with null in constructor parameter as principal, which is set later - but bytes are not updated and the null bytes is later synced to another instances. That causes the user is logged out and also nullpointers on another instances if you enable lower levels of logging.
I can provide even better refactored patch, because this is what could be called a little "constructor hell".

EDIT: patch removed

Comment by dmatej [ 30/Jul/14 ]

This is still not perfect, but I think this patch would be better instead of previous. Bugfix is the same, but it has less code in constructors and I think it is more readable ...
EDIT: patch removed

Comment by dmatej [ 30/Jul/14 ]

This issue caused also NPE reported in GLASSFISH-21146

Comment by dmatej [ 14/Oct/14 ]

Because there is no development from your side, I created a GitHub repository and I patch Glassfish there, since creating patches in JIRA is a bit problematic.
https://github.com/dmatej/Glassfish. This issue is fixed in two commits together with a little refactoring in this class.
Commit 1:

commit 245b7346b06783c352cda3348396f6f8eb040018
Author: David Matejcek <david.matejcek@i.cz>
Date:   Mon Sep 29 15:53:21 2014 +0200

    GLASSFISH-21148 Fixed parsing principal from metadata
    
    - prinicpal was parsed, but metadata were not updated

diff --git a/main/appserver/web/web-ha/src/main/java/org/glassfish/web/ha/authenticator/HASingleSignOnEntry.java b/main/appserver/web/web-ha/src/main/java/org/glassfish/web/ha/authenticator/HASingleSignOnEntry.java
index b9909b1..56e6f58 100644
--- a/main/appserver/web/web-ha/src/main/java/org/glassfish/web/ha/authenticator/HASingleSignOnEntry.java
+++ b/main/appserver/web/web-ha/src/main/java/org/glassfish/web/ha/authenticator/HASingleSignOnEntry.java
@@ -41,20 +41,25 @@
 package org.glassfish.web.ha.authenticator;
 
 import com.sun.enterprise.container.common.spi.util.JavaEEIOUtils;
+
 import org.apache.catalina.Container;
 import org.apache.catalina.core.StandardContext;
-
 import org.apache.catalina.Session;
 import org.apache.catalina.authenticator.SingleSignOn;
 import org.apache.catalina.authenticator.SingleSignOnEntry;
+import org.glassfish.web.ha.session.management.HAStoreBase;
 
 import java.io.*;
 import java.security.Principal;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
 /**
  * @author Shing Wai Chan
  */
 public class HASingleSignOnEntry extends SingleSignOnEntry {
+    private static final Logger logger = HAStoreBase._logger;
+
     protected long maxIdleTime;
 
     protected JavaEEIOUtils ioUtils;
@@ -73,36 +78,9 @@ public class HASingleSignOnEntry extends SingleSignOnEntry {
                 m.getLastAccessTime(), m.getMaxIdleTime(), m.getVersion(),
                 ioUtils);
 
-        ByteArrayInputStream bais = null;
-        BufferedInputStream bis = null;
-        ObjectInputStream ois = null;
-        try {
-            bais = new ByteArrayInputStream(m.getPrincipalBytes());
-            bis = new BufferedInputStream(bais);
-            ois = ioUtils.createObjectInputStream(bis, true, this.getClass().getClassLoader());
-            this.principal = (Principal)ois.readObject();
-        } catch(Exception ex) {
-            throw new IllegalStateException(ex);
-        } finally {
-            if (bais != null) {
-                try {
-                    bais.close();
-                } catch(IOException ex) {
-                }
-            }
-            if (bis != null) {
-                try {
-                    bis.close();
-                } catch(IOException ex) {
-                }
-            }
-            if (ois != null) {
-                try {
-                    ois.close();
-                } catch(IOException ex) {
-                }
-            }
-        }
+        // GLASSFISH-21148: constructor called with null - don't forget to update metadata!
+        this.principal = parsePrincipal(m);
+        this.metadata.principalBytes = m.getPrincipalBytes() == null ? null : m.getPrincipalBytes().clone();
 
         for (HASessionData data: m.getHASessionDataSet()) {
             StandardContext context = (StandardContext)container.findChild(data.getContextPath());
@@ -112,24 +90,29 @@ public class HASingleSignOnEntry extends SingleSignOnEntry {
             } catch(IOException ex) {
                 throw new IllegalStateException(ex);
             }
-            sessions.add(session);
+            if (session != null) {
+              sessions.add(session);
+            }
         }
+        logger.log(Level.FINER, "Loaded HA SSO entry from metadata. Principal: {}", this.principal);
     }
 
+    // TODO: javadoc: difference between principal.getName and userName?
     public HASingleSignOnEntry(String id, Principal principal, String authType,
             String username, String realmName,
             long lastAccessTime, long maxIdleTime, long version,
             JavaEEIOUtils ioUtils) {
-        
+
         super(id, version, principal, authType, username, realmName);
         this.lastAccessTime = lastAccessTime;
         this.maxIdleTime = maxIdleTime;
         this.ioUtils = ioUtils;
 
-        metadata = new HASingleSignOnEntryMetadata(
+        this.metadata = new HASingleSignOnEntryMetadata(
                 id, version, convertToByteArray(principal), authType,
                 username, realmName,
                 lastAccessTime, maxIdleTime);
+        logger.log(Level.FINER, "Created HA SSO entry. Principal: {}", this.principal);
     }
 
     public HASingleSignOnEntryMetadata getMetadata() {
@@ -171,39 +154,53 @@ public class HASingleSignOnEntry extends SingleSignOnEntry {
         return ver;
     }
 
-    // convert a Serializable object into byte array
-    private byte[] convertToByteArray(Object obj) {
-        ByteArrayOutputStream baos = null;
+    /** convert a principal into byte array */
+    private byte[] convertToByteArray(Principal obj) {
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
         BufferedOutputStream bos = null;
         ObjectOutputStream oos = null;
         try {
-            baos = new ByteArrayOutputStream();
             bos = new BufferedOutputStream(baos);
             oos = ioUtils.createObjectOutputStream(bos, true);
             oos.writeObject(obj);
+            oos.flush();
+            return baos.toByteArray();
         } catch(Exception ex) {
             throw new IllegalStateException(ex);
         } finally {
-            if (baos != null) {
-                try {
-                    baos.close();
-                } catch(Exception ex) {
-                }
-            }
-            if (bos != null) {
-                try {
-                    bos.close();
-                } catch(Exception ex) {
-                }
-            }
-            if (oos != null) {
-                try {
-                    oos.close();
-                } catch(Exception ex) {
-                }
-            }
+          closeSilently(baos);
+          closeSilently(bos);
+          closeSilently(oos);
         }
+    }
+
+    /** Parse a principal from metadata */
+    private Principal parsePrincipal(HASingleSignOnEntryMetadata m) {
+      ByteArrayInputStream bais = null;
+      BufferedInputStream bis = null;
+      ObjectInputStream ois = null;
+      try {
+          bais = new ByteArrayInputStream(m.getPrincipalBytes());
+          bis = new BufferedInputStream(bais);
+          ois = ioUtils.createObjectInputStream(bis, true, this.getClass().getClassLoader());
+          return (Principal) ois.readObject();
+      } catch (Exception ex) {
+          throw new IllegalStateException(ex);
+      } finally {
+        closeSilently(bais);
+        closeSilently(bis);
+        closeSilently(ois);
+      }
+    }
 
-        return baos.toByteArray();
+    private void closeSilently(Closeable closeable) {
+      if (closeable == null) {
+        return;
+      }
+      try {
+        closeable.close();
+      } catch(Exception ex) {
+        // nothing
+      }
     }
 }

Commit 2:

commit ec5f162a648ad3e3be94028567127aeefd741a45
Author: David Matejcek <david.matejcek@i.cz>
Date:   Mon Sep 29 16:06:46 2014 +0200

    GLASSFISH-21148 More descriptive exception messages

diff --git a/main/appserver/web/web-ha/src/main/java/org/glassfish/web/ha/authenticator/HASingleSignOnEntry.java b/main/appserver/web/web-ha/src/main/java/org/glassfish/web/ha/authenticator/HASingleSignOnEntry.java
index 56e6f58..c9a7025 100644
--- a/main/appserver/web/web-ha/src/main/java/org/glassfish/web/ha/authenticator/HASingleSignOnEntry.java
+++ b/main/appserver/web/web-ha/src/main/java/org/glassfish/web/ha/authenticator/HASingleSignOnEntry.java
@@ -88,7 +88,7 @@ public class HASingleSignOnEntry extends SingleSignOnEntry {
             try {
                 session = context.getManager().findSession(data.getSessionId());
             } catch(IOException ex) {
-                throw new IllegalStateException(ex);
+                throw new IllegalStateException("Cannot find the session: " + data.getSessionId(), ex);
             }
             if (session != null) {
               sessions.add(session);
@@ -166,7 +166,7 @@ public class HASingleSignOnEntry extends SingleSignOnEntry {
             oos.flush();
             return baos.toByteArray();
         } catch(Exception ex) {
-            throw new IllegalStateException(ex);
+            throw new IllegalStateException("Could not convert principal to byte array", ex);
         } finally {
           closeSilently(baos);
           closeSilently(bos);
@@ -185,7 +185,7 @@ public class HASingleSignOnEntry extends SingleSignOnEntry {
           ois = ioUtils.createObjectInputStream(bis, true, this.getClass().getClassLoader());
           return (Principal) ois.readObject();
       } catch (Exception ex) {
-          throw new IllegalStateException(ex);
+          throw new IllegalStateException("Could not parse principal from HA-SSO Metadata", ex);
       } finally {
         closeSilently(bais);
         closeSilently(bis);

I have finally configured the Apache loadbalancer and there are no problems with this any more (except bad Apache configuration).
Could you apply those two patches to your SVN, please?

Comment by dmatej [ 06/Nov/14 ]

Patches applied in Payara: https://github.com/payara/Payara/commit/3ff228aab2b78bbda4b9eea8ee3c6c68df39e291

Comment by Shing Wai Chan [ 07/Nov/14 ]

A slightly different fix is checkin as follows:

Sending src/main/java/org/glassfish/web/ha/authenticator/HASingleSignOn.java
Sending src/main/java/org/glassfish/web/ha/authenticator/HASingleSignOnEntry.java
Transmitting file data ..
Committed revision 63712.





[GLASSFISH-21146] GlassFishSingleSignOn logging does not log values and throws NPE Created: 28/Jul/14  Updated: 06/Nov/14  Resolved: 06/Nov/14

Status: Resolved
Project: glassfish
Component/s: web_container
Affects Version/s: 4.1_b09
Fix Version/s: None

Type: Bug Priority: Major
Reporter: dmatej Assignee: Shing Wai Chan
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 1 hour
Time Spent: Not Specified
Original Estimate: 1 hour

Attachments: Zip Archive GLASSFISH-21166.zip    
Tags: cluster, logging, sso

 Description   

1) All GlassFishSingleSignOn logs look like this:
Found cached principal

{0}

with auth type

{1}

in realm

{2}
  • that makes them unusable.

2) Also getPrincipal().getName() causes NPE, because sometimes the principal is null (don't know why at this time, it occurs on cluster instances with SSO, many webapp modules with the same realm and one web application module without any realm - I will create another issue if I will get it).

You can remove getName() method call, because the getPrincipal() should write the same and in fact, in the message you already write that the value is principal.
Old:
logger.log(Level.FINE, FOUND_CACHED_PRINCIPAL, new Object[]

{entry.getPrincipal().getName(), entry.getAuthType(), entry.getRealmName()}

);
Better:
logger.log(Level.FINE, FOUND_CACHED_PRINCIPAL, new Object[]

{entry.getPrincipal(), entry.getAuthType(), entry.getRealmName()}

);

3) And finally, I think the first log in invoke should not be PRINCIPAL_ALREADY_AUTHENTICATED but REQUEST_PROCESSED - only swap these two constants. Now it logs nosense



 Comments   
Comment by dmatej [ 28/Jul/14 ]

Environment:
java version "1.8.0"
Java(TM) SE Runtime Environment (build 1.8.0-b132)
Java HotSpot(TM) 64-Bit Server VM (build 25.0-b70, mixed mode)

Comment by Shing Wai Chan [ 28/Jul/14 ]

There are other logs in GlassFishSingleSignOn other than (1).
For (2), there is a different issue here as we should not have a null principal for SSO. We may like to understand why there is a null principal there. Any test cases? Note that principal.toString() and principal.getName() may be different in some implementations.
(3) is a regression from v3 to v4.

Comment by Shing Wai Chan [ 28/Jul/14 ]

a fix for (3):
Sending src/main/java/com/sun/enterprise/security/web/GlassFishSingleSignOn.java
Transmitting file data .
Committed revision 63544.

Comment by dmatej [ 30/Jul/14 ]

(1) Many of these logs does not contain values, only those curly braces, but some does. It is not the only place where this issue exists, but I could not find why:

....
[2014-07-30T15:39:12.396+0200] [glassfish 4.0] [FINE] [AS-WEB-GLUE-00031] [javax.enterprise.web] [tid: _ThreadID=58 _ThreadName=http-listener-1(1)] [timeMillis: 1406727552396] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.web.GlassFishSingleSignOn] [METHODNAME: invoke] [[
  Process request for {0}]]
[2014-07-30T15:39:12.396+0200] [glassfish 4.0] [FINE] [AS-WEB-GLUE-00033] [javax.enterprise.web] [tid: _ThreadID=58 _ThreadName=http-listener-1(1)] [timeMillis: 1406727552396] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.web.GlassFishSingleSignOn] [METHODNAME: invoke] [[
  Checking for SSO cookie]]
[2014-07-30T15:39:12.397+0200] [glassfish 4.0] [FINE] [AS-WEB-GLUE-00037] [javax.enterprise.web] [tid: _ThreadID=58 _ThreadName=http-listener-1(1)] [timeMillis: 1406727552397] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.web.GlassFishSingleSignOn] [METHODNAME: invoke] [[
  Checking for cached principal for {0}]]
[2014-07-30T15:39:12.398+0200] [glassfish 4.0] [FINE] [AS-WEB-GLUE-00038] [javax.enterprise.web] [tid: _ThreadID=58 _ThreadName=http-listener-1(1)] [timeMillis: 1406727552398] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.web.GlassFishSingleSignOn] [METHODNAME: invoke] [[
  Found cached principal {0} with auth type {1} in realm {2}]]
....
[2014-07-30T15:42:32.487+0200] [glassfish 4.0] [FINE] [AS-WEB-GLUE-00042] [javax.enterprise.web] [tid: _ThreadID=96 _ThreadName=SingleSignOnExpiration] [timeMillis: 1406727752487] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.web.GlassFishSingleSignOn] [METHODNAME: processExpires] [[
  SSO expiration started. Current entries: 1]]
[2014-07-30T15:42:32.487+0200] [glassfish 4.0] [FINE] [AS-WEB-GLUE-00043] [javax.enterprise.web] [tid: _ThreadID=96 _ThreadName=SingleSignOnExpiration] [timeMillis: 1406727752487] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.web.GlassFishSingleSignOn] [METHODNAME: processExpires] [[
  SSO cache will expire 0 entries]]
[2014-07-30T15:42:32.533+0200] [glassfish 4.0] [FINE] [AS-WEB-GLUE-00042] [javax.enterprise.web] [tid: _ThreadID=97 _ThreadName=SingleSignOnExpiration] [timeMillis: 1406727752533] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.web.GlassFishSingleSignOn] [METHODNAME: processExpires] [[
  SSO expiration started. Current entries: 0]]
[2014-07-30T15:42:32.533+0200] [glassfish 4.0] [FINE] [AS-WEB-GLUE-00043] [javax.enterprise.web] [tid: _ThreadID=97 _ThreadName=SingleSignOnExpiration] [timeMillis: 1406727752533] [levelValue: 500] [CLASSNAME: com.sun.enterprise.security.web.GlassFishSingleSignOn] [METHODNAME: processExpires] [[
  SSO cache will expire 0 entries]]

(2) Yes, and I fixed it (I will create another issue and attach a patch), but the code should be more robust.
The log message says it is a principal, not principal's name. And - it can be null, even if it is caused by some bug. Logging must not crash funcionality, it should be passive as it is possible. Note that Principal implementation must implement toString(), so it should be alright.
(3) Thank you and thank you for really fast response
(4) One of parameters is userName, I'm not sure about difference between principal's name and userName - the class should be also better documented.

Comment by dmatej [ 30/Jul/14 ]

Relates to GLASSFISH-21148 - that issue caused (2)

Comment by dmatej [ 20/Aug/14 ]

GLASSFISH-21148 is one of causes, but not only one - on standalone instance even with the fixed web-ha library I got NPE again.
(2) Exception in server.log after setting log level to FINE - can be resolved simply by applying my patch (Principal should implement toString(), so it is much better than calling getName() which sometimes throws NPE and complicates searching for another bugs!):

[2014-08-20T18:43:28.249+0200] [glassfish 4.1] [SEVERE] [AS-WEB-CORE-00037] [javax.enterprise.web.core] [tid: _ThreadID=34 _ThreadName=http-listener-1(5)] [timeMillis: 1408553008249] [levelValue: 1000] [[
  An exception or error occurred in the container during the request processing
java.lang.NullPointerException
        at com.sun.enterprise.security.web.GlassFishSingleSignOn.invoke(GlassFishSingleSignOn.java:487)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:702)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
        at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:412)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:282)
        at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)

I have signed the OCA, but still cannot commit to SVN and it seems there is noone interested in fixing bugs ...
I have to compile and replace several libraries to write a single test for another bug ... those bugs are interacting, some are clear, some are not ... it would be nice to fix those clear at least.
Possibly related bugs - NPE in one stops/skips processing in another or it causes the NPEs ...:
GLASSFISH-21166
GLASSFISH-21147
GLASSFISH-21146
GLASSFISH-21148

Comment by reza_rahman [ 22/Aug/14 ]

Reproducible test case from David attached.

Comment by reza_rahman [ 22/Aug/14 ]

Please provide David attach permissions?

Comment by dmatej [ 25/Aug/14 ]

Hi Reza, the test was for GLASSFISH-21166, not GLASSFISH-21146, I am sorry, it was my typo in e-mail subject

This issue state:
3) is fixed
2) still not fixed; this issue is only about logging, the reason why the principal is null should be resolved in some issue from the list I mentioned before.
1) This is something bigger, in some modules of Glassfish logging does not work as expected and values are missing. Logging may need some attention and maybe better conventions (select one of already used). It will need some work.

Comment by dmatej [ 14/Oct/14 ]

Patch for NPE. Please, can you apply it to SVN?

commit 2c94c5fa5f887a0531e42f313459f0bc152bcee5
Author: David Matejcek <david.matejcek@i.cz>
Date:   Tue Oct 14 12:10:50 2014 +0200

    GLASSFISH-21146 Fixed NPE in log
    
    - avoid toString call (implicit)
    - debug replaced with logging level FINE

diff --git a/main/appserver/web/web-ha/src/main/java/org/glassfish/web/ha/authenticator/HASingleSignOn.java b/main/appserver/web/web-ha/src/main/java/org/glassfish/web/ha/authenticator/HASingleSignOn.java
index 2c3cb81..15e3352 100644
--- a/main/appserver/web/web-ha/src/main/java/org/glassfish/web/ha/authenticator/HASingleSignOn.java
+++ b/main/appserver/web/web-ha/src/main/java/org/glassfish/web/ha/authenticator/HASingleSignOn.java
@@ -73,11 +73,11 @@ public class HASingleSignOn extends GlassFishSingleSignOn {
     @Override
     protected void deregister(String ssoId) {
 
-        //S1AS8 6155481 START        
+        //S1AS8 6155481 START
         if (logger.isLoggable(Level.FINE)) {
             logger.fine("Deregistering sso id '" + ssoId + "'");
         }
-        //S1AS8 6155481 END 
+        //S1AS8 6155481 END
         // Look up and remove the corresponding SingleSignOnEntry
         SingleSignOnEntry sso = null;
         synchronized (cache) {
@@ -104,9 +104,10 @@ public class HASingleSignOn extends GlassFishSingleSignOn {
     protected void register(String ssoId, Principal principal, String authType,
                   String username, char[] password, String realmName) {
 
-        if (debug >= 1)
-            log("Registering sso id '" + ssoId + "' for user '" +
-                principal.getName() + "' with auth type '" + authType + "'");
+        if (logger.isLoggable(Level.FINE)) {
+            logger.fine("Registering sso id '" + ssoId+ "' for principal '" + principal + "' and username '" + username
+                    + "' with auth type '" + authType + "' and realmName '" + realmName + "'");
+        }
 
         HASingleSignOnEntry ssoEntry = null;
         synchronized (cache) {
@@ -178,8 +179,7 @@ public class HASingleSignOn extends GlassFishSingleSignOn {
     protected void removeSession(String ssoId, Session session) {
 
         if (logger.isLoggable(Level.FINE)) {
-            logger.fine("Removing session " + session.toString() 
-                        + " from sso id " + ssoId );
+            logger.fine("Removing session " + session + " from sso id " + ssoId );
         }
 
         // Get a reference to the SingleSignOn

Issue can be marked as FIXED.

Comment by dmatej [ 06/Nov/14 ]

Patches applied in Payara: https://github.com/payara/Payara/commit/c6eee9b76dccbd48d2332ff68c6cc4b8a873c3f8

Comment by Shing Wai Chan [ 06/Nov/14 ]

Sending src/main/java/org/glassfish/web/ha/authenticator/HASingleSignOn.java
Transmitting file data .
Committed revision 63710.





[GLASSFISH-21083] CDI and Tag File with Parameter Creates Memory Leak Created: 09/Jun/14  Updated: 07/Oct/14

Status: Open
Project: glassfish
Component/s: web_container
Affects Version/s: 4.0
Fix Version/s: None

Type: Bug Priority: Major
Reporter: slominskir Assignee: kchung
Resolution: Unresolved Votes: 4
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

If you have CDI enabled and a tag file with an object parameter you get a memory leak where the object that is passed in accumulates in memory each time you view the page. Dump memory with jvisualvm or jmap and look for the object you passed in.

Similar to, but not the same as: GLASSFISH-18650. I can confirm that GLASSFISH-18650 is indeed fixed based on the attached test case, but it differs from this bug in that it doesn't use parameters.



 Comments   
Comment by slominskir [ 09/Jun/14 ]

I have a simple test case, but I don't see an option to attach it. I've instead attached it to the forum thread discussing the leak: https://www.java.net/forum/topic/glassfish/glassfish/glassfish-4-memory-leak. Alternatively you can create a simple test case by extending the test case attached to GLASSFISH-18650 to include a parameter of "java.util.List" which contains a bunch of some object that you create with a well known name and can search for when you do a heap dump.

Comment by douglassm [ 17/Jul/14 ]

I have the same problem. If i reload the .war application, in console administration, the memory is collected.

Comment by smillidge-c2b2 [ 03/Aug/14 ]

I've tested with the latest 4.1 builds and the problem still exists.

Comment by smillidge-c2b2 [ 03/Aug/14 ]

Adding the following raw commit to our copy of the glassfish src tree fixes the memory leak but will need reviewing by the GlassFish team

From ce3fb85d642323fa73ba9f3430556fbbb7882e09 Mon Sep 17 00:00:00 2001
From: Steve Millidge <smillidge-AT-c2b2.co.uk>
Date: Sun, 3 Aug 2014 16:16:07 +0100
Subject: [PATCH] Added destroy managed object to fix leak of CDI beans


.../src/main/java/com/sun/enterprise/web/jsp/ResourceInjectorImpl.java | 1 +
1 file changed, 1 insertion

diff --git a/appserver/web/web-glue/src/main/java/com/sun/enterprise/web/jsp/ResourceInjectorImpl.java b/appserver/web/web-glue/src/main/java/com/sun/enterprise/web/jsp/ResourceInjectorImpl.java
index 0ddd30f..c5953db 100644
— a/appserver/web/web-glue/src/main/java/com/sun/enterprise/web/jsp/ResourceInjectorImpl.java
+++ b/appserver/web/web-glue/src/main/java/com/sun/enterprise/web/jsp/ResourceInjectorImpl.java
@@ -116,6 +116,7 @@ public class ResourceInjectorImpl implements ResourceInjector {
if (desc != null) {
try

{ injectionMgr.invokeInstancePreDestroy(handler, desc); + injectionMgr.destroyManagedObject(handler); }

catch (Exception e) {
String msg = _rb.getString(EXCEPTION_DURING_JSP_TAG_HANDLER_PREDESTROY);
msg = MessageFormat.format(msg, handler);

1.8.5.2

Comment by smillidge-c2b2 [ 03/Aug/14 ]

Essentially the TagPoolHandler creates a new TagHandler via the ResourceInjector which creates a new tag handler instance as a managed object;

public <T extends JspTag> T createTagHandlerInstance(Class<T> clazz)
throws Exception

{ return webModule.getWebContainer().createTagHandlerInstance( webModule, clazz); }

However when the TagHandler calls release and then preDestroy on the ResourceInjector it never destroys the ManagedBean (TagHandler) therefore added an explicit call to destroy the managed object after preDestroy methods are called.

public void preDestroy(JspTag handler) {
if (desc != null) {
try

{ injectionMgr.invokeInstancePreDestroy(handler, desc); //line below fixes GLASSFISH-21083 injectionMgr.destroyManagedObject(handler); }

catch (Exception e)

{ String msg = _rb.getString(EXCEPTION_DURING_JSP_TAG_HANDLER_PREDESTROY); msg = MessageFormat.format(msg, handler); _logger.log(Level.WARNING, msg, e); }

}
}

Comment by kchung [ 04/Aug/14 ]

Thanks for the patch. I've committed the patch to the trunk.

Comment by smillidge-c2b2 [ 05/Aug/14 ]

Hi

Reviewing my patch I'm not sure injectionMgr.invokeInstancePreDestroy should be called as well as injectionMgr.destroyManagedObject(handler); as I think destroyManagedObject; calls preDestroy internally. I haven't tested it though.

Steve

Comment by mauritz.lovgren@hotmail.com [ 05/Aug/14 ]

Is there any chance whatsoever that this fix could make it into 4.0.1 final, or is it already too late?

Comment by kchung [ 06/Aug/14 ]

smillidge-cb: I think you are right. If you look at the source in appserver/common/container-common/src/main/java/com/sun/enterprise/container/common/impl/util/InjectionManagerImpl.java, you'll see that in the method destroyManagedObject calls managedBeanMgr.destroyManagedBean() if it is a managed beans, otherwise it calls invokeInstancePreDestroy(). So we need to remove the call to invokePreDestroy, else if it is not a managed bean, invokeInstancePredestroy will be called twice.

Please do more tests and let me know.

mauritz.lovgren, I'm trying to get the fix in 4.0.1, but time is running out.

Comment by smillidge-c2b2 [ 07/Oct/14 ]

This is in the 4.1 source tree so should be closed as resolved.





[GLASSFISH-21166] session.invalidate causes two NPE Created: 18/Aug/14  Updated: 19/Sep/14

Status: Open
Project: glassfish
Component/s: web_container
Affects Version/s: 4.1, future release
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: dmatej Assignee: Shing Wai Chan
Resolution: Unresolved Votes: 4
Labels: None
Remaining Estimate: 2 hours
Time Spent: Not Specified
Original Estimate: 2 hours
Environment:

EAR with many WAR modules, form auth and custom realm and SSO enabled.


Tags: logout, session, weld

 Description   

The session is finally correctly invalidated, even on cluster instances, but there are these exceptions in the server.log.
I think it should throw another exception or do nothing, but it must not throw NPE.

WeldTerminalListener in current trunk is 2.2.2, current version is 2.2.4 - maybe it could be fixed, if it is really weld error.

[2014-08-18T13:42:56.479+0200] [glassfish 4.1] [INFO] [] [javax.enterprise.web.core] [tid: _ThreadID=28 _ThreadName=http-listener-1(2)] [timeMillis: 1408362176479] [levelValue: 800] [[
  Session event listener threw exception
java.lang.NullPointerException
        at org.jboss.weld.servlet.WeldTerminalListener.getSessionContext(WeldTerminalListener.java:65)
        at org.jboss.weld.servlet.WeldTerminalListener.sessionDestroyed(WeldTerminalListener.java:57)
        at org.apache.catalina.session.StandardSession.expire(StandardSession.java:910)
        at org.apache.catalina.session.StandardSession.expire(StandardSession.java:854)
        at org.apache.catalina.session.StandardSession.expire(StandardSession.java:842)
        at org.apache.catalina.session.StandardSession.invalidate(StandardSession.java:1603)
        at org.apache.catalina.session.StandardSessionFacade.invalidate(StandardSessionFacade.java:204)
        at org.apache.jsp.logout_jsp._jspService(logout_jsp.java:58)
...
[2014-08-18T13:42:56.482+0200] [glassfish 4.1] [INFO] [] [javax.enterprise.web.core] [tid: _ThreadID=28 _ThreadName=http-listener-1(2)] [timeMillis: 1408362176482] [levelValue: 800] [[
  Session event listener threw exception
java.lang.NullPointerException
        at org.jboss.weld.servlet.WeldTerminalListener.getSessionContext(WeldTerminalListener.java:65)
        at org.jboss.weld.servlet.WeldTerminalListener.sessionDestroyed(WeldTerminalListener.java:57)
        at org.apache.catalina.session.StandardSession.expire(StandardSession.java:910)
        at org.apache.catalina.session.StandardSession.expire(StandardSession.java:854)
        at org.apache.catalina.session.StandardSession.expire(StandardSession.java:842)
        at org.apache.catalina.authenticator.SingleSignOnEntry.expireSessions(SingleSignOnEntry.java:158)
        at com.sun.enterprise.security.web.GlassFishSingleSignOn.deregister(GlassFishSingleSignOn.java:560)
        at com.sun.enterprise.security.web.GlassFishSingleSignOn.sessionEvent(GlassFishSingleSignOn.java:337)
        at org.apache.catalina.session.StandardSession.fireSessionEvent(StandardSession.java:2318)
        at org.apache.catalina.session.StandardSession.expire(StandardSession.java:984)
        at org.apache.catalina.session.StandardSession.expire(StandardSession.java:854)
        at org.apache.catalina.session.StandardSession.expire(StandardSession.java:842)
        at org.apache.catalina.session.StandardSession.invalidate(StandardSession.java:1603)
        at org.apache.catalina.session.StandardSessionFacade.invalidate(StandardSessionFacade.java:204)
        at org.apache.jsp.logout_jsp._jspService(logout_jsp.java:58)

Line 65 in WeldTerminalListener:

    private HttpSessionContext getSessionContext() {
        return beanManager.instance().select(HttpSessionContext.class).get();
    }


 Comments   
Comment by Shing Wai Chan [ 18/Aug/14 ]

Can you provide a test case to illustrate this?

Comment by dmatej [ 19/Aug/14 ]

I will try to create some. I tried to replace weld-osgi-bundle with the 2.2.4 version, the result is same.

Comment by dmatej [ 20/Aug/14 ]

It seems it is not so simple ...
1) In our 35MB big ear with around 20 modules it is logged after each logout.
2) In unit test I created, with or without SSO enabled and tested on ear containing two simple war modules it works without exceptions.
So I looked inside the Glassfish code ... meanwhile I tried to undeploy our application and same error occured. I suspect this issue is caused by the same thing as GLASSFISH-21147 , but I have to find out how to create some simplier example with the test.

[2014-08-20T17:09:18.952+0200] [glassfish 4.1] [INFO] [] [javax.enterprise.web.core] [tid: _ThreadID=227 _ThreadName=admin-listener(6)] [timeMillis: 1408547358952] [levelValue: 800] [[
  Session event listener threw exception
java.lang.NullPointerException
        at org.jboss.weld.servlet.WeldTerminalListener.getSessionContext(WeldTerminalListener.java:65)
        at org.jboss.weld.servlet.WeldTerminalListener.sessionDestroyed(WeldTerminalListener.java:57)
        at org.apache.catalina.session.StandardSession.expire(StandardSession.java:910)
        at org.apache.catalina.session.StandardSession.expire(StandardSession.java:854)
        at org.apache.catalina.session.StandardSession.expire(StandardSession.java:842)
        at org.apache.catalina.session.StandardManager.stop(StandardManager.java:955)
        at org.apache.catalina.core.StandardContext.stop(StandardContext.java:6133)
        at com.sun.enterprise.web.WebModule.stop(WebModule.java:720)
Comment by dmatej [ 20/Aug/14 ]

I have downloaded weld-core sources from Github and separated that line in three.
It seems the beanManager is not injected - it is null.
Tested with weld-osgi-bundle 2.2.5-SNAPSHOT commit 81c0ee82, 2.2.4 and original 2.2.2.

public class WeldTerminalListener implements HttpSessionListener {
    @Inject
    private BeanManagerImpl beanManager;

Does someone know why and how to fix it?

I have found more messages in logs - this is in server.log file when initializing both the admingui application and our application:

[2014-08-20T23:04:43.273+0200] [glassfish 4.1] [FINE] [] [org.glassfish.naming] [tid: _ThreadID=170 _ThreadName=Thread-32] [timeMillis: 1408568683273] [levelValue: 500] [CLASSNAME: NamedNamingObjectManager] [METHODNAME: tryNamedProxies] [[
  found cached proxy [org.glassfish.weld.BeanManagerNamingProxy@7209773] for [java:comp/BeanManager]]]

[2014-08-20T23:04:43.273+0200] [glassfish 4.1] [FINE] [] [javax.enterprise.resource.webcontainer.jsf.config] [tid: _ThreadID=170 _ThreadName=Thread-32] [timeMillis: 1408568683273] [levelValue: 500] [CLASSNAME: com.sun.faces.config.WebConfiguration] [METHODNAME: processJndiEntries] [[
  javax.naming.NamingException: Lookup failed for 'java:comp/BeanManager' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming} [Root exception is javax.naming.NamingException: Error retrieving java:comp/BeanManager [Root exception is java.lang.IllegalStateException: Cannot resolve bean manager]]]]

[2014-08-20T23:04:43.273+0200] [glassfish 4.1] [FINE] [] [javax.enterprise.resource.webcontainer.jsf.config] [tid: _ThreadID=170 _ThreadName=Thread-32] [timeMillis: 1408568683273] [levelValue: 500] [CLASSNAME: com.sun.faces.config.WebConfiguration] [METHODNAME: processJndiEntries] [[
  javax.naming.NamingException: Lookup failed for 'java:comp/env/BeanManager' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming} [Root exception is javax.naming.NameNotFoundException: No object bound to name java:comp/env/BeanManager]]]

Maybe I got some idea - my test application does not contain any beans and does not need injections ... I will take a look in the morning ... now I'm dead ...
(also catching Throwable in BeanManagerNamingProxy is really ugly )

Comment by dmatej [ 21/Aug/14 ]

I got it - when I add empty beans.xml file to the WEB-INF directory, there are no NPE any more. It seems it is some problem with using SSO, EJB3 and old J2SE war applications in one EAR. CDI then works only partially: it works on EJB modules, but not in war modules which did not declare they want it. WeldTerminalListener is maybe initialized in war module and that is the reason why it's beanManager is null.

I will try to create the test case but I am not authorized to attach files. Can you do something with it?

Comment by dmatej [ 21/Aug/14 ]

The perfectly repeatable test case is prepared, how can I upload it?

Comment by reza_rahman [ 21/Aug/14 ]

Could you kindly send it to me for now?

Comment by dmatej [ 02/Sep/14 ]

Test case uploaded to GLASSFISH-21146 (I did a mistake in e-mail subject). I still cannot upload or change JIRA attachements so I cannot fix it ...

Comment by reza_rahman [ 02/Sep/14 ]

Please email it to me. As I may have explained, we can't enable attachments for now (and perhaps even in the long term) due to security policies.

Comment by dmatej [ 13/Sep/14 ]

Please only move the attachment from GLASSFISH-21146 here.

Comment by Wydrian [ 19/Sep/14 ]

I have the same problem with a simple struts2 based application: every time the HttpSession is invalidated (even manually by calling invalidate() or by the container), a NPE is thrown by WeldTerminalListener. It is since GF 4.1 upgrade, in 4.0 and before it was working fine. Everything seems to work normally: only the log is filled with this exeption.

2014-09-20T00:20:45.571+0200|Info: Session event listener threw exception
java.lang.NullPointerException
at org.jboss.weld.servlet.WeldTerminalListener.getSessionContext(WeldTerminalListener.java:65)
at org.jboss.weld.servlet.WeldTerminalListener.sessionDestroyed(WeldTerminalListener.java:57)
at org.apache.catalina.session.StandardSession.expire(StandardSession.java:910)
at org.apache.catalina.session.StandardSession.expire(StandardSession.java:854)
at org.apache.catalina.session.StandardSession.expire(StandardSession.java:842)
at org.apache.catalina.session.StandardSession.invalidate(StandardSession.java:1603)
at org.apache.catalina.session.StandardSessionFacade.invalidate(StandardSessionFacade.java:204)
at hu.tikkin.action.LogoutAction.execute(LogoutAction.java:64)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:450)
at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:289)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:252)
at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265)
at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:254)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:191)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:91)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:139)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:189)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:193)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54)
at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:562)
at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:99)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:316)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:415)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:282)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
at java.lang.Thread.run(Thread.java:724)





[GLASSFISH-21054] max post size/max swallowing input bytes do not limit the post request Created: 30/Apr/14  Updated: 19/Sep/14  Resolved: 29/May/14

Status: Resolved
Project: glassfish
Component/s: web_container
Affects Version/s: None
Fix Version/s: 4.1

Type: Bug Priority: Major
Reporter: rcaliber Assignee: oleksiys
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 1 day
Time Spent: Not Specified
Original Estimate: 1 day

Tags: glassfish, post, request, size

 Description   

Trying to put a limit on the HTTP POST request content. Tried changing max post size and max swallowing input bytes (as suggested in a previous bug GLASSFISH-17332) to 20KB. Still able to send 40KB and above.
So if max swallowing input bytes is applicable to application/x-www-form-urlencoded then what other attribute can be used to limit json content limit?

Content-Type →application/json
Server →GlassFish Server Open Source Edition 4.0 (Build 89)



 Comments   
Comment by Shing Wai Chan [ 30/Apr/14 ]

Assign to Alexey as this is related to GLASSFISH-17332

Comment by oleksiys [ 29/May/14 ]

should be fixed in Glassfish 4.0.1.
We'll have 2 parameters:
1) max-form-post-size-bytes for application/x-www-form-urlencoded posts
2) max-post-size-bytes for all posts

So application/x-www-form-urlencoded posts have to pass two checks: max-form-post-size-bytes and max-post-size-bytes. All other posts have to pass just max-post-size-bytes check.

Comment by rcaliber [ 02/Jun/14 ]

Thanks for resolving this!





[GLASSFISH-20933] When the session is newly made by asynchronization Servlet, the time-outis not done while locked Created: 18/Dec/13  Updated: 19/Sep/14  Resolved: 24/Jun/14

Status: Resolved
Project: glassfish
Component/s: web_container
Affects Version/s: 4.1
Fix Version/s: 4.1_b08

Type: Bug Priority: Major
Reporter: xianwu Assignee: Shing Wai Chan
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

OS
Windows 7 Enterprise (Service Pack 1)

JDK
java version "1.7.0_11"
Java(TM) SE Runtime Environment (build 1.7.0_11-b21) Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)

GlassFish build: glassfish-4.0.1-b02-07_22_2013



 Description   

We have a web application atest2.war, which contains two servlets: "simple" and "test".
"simple" is a non-async servlet and "test" is an async servlet.
The session time out was set to 1 minute in web.xml

When accessing non-async servlet "/simple", a session was created, then destroyed when time out was reached

However, when accessing async servlet "/test", a session was created but not destroyed time out was reached.

Reproducible operational steps:

1) deploy atest2.war
asadmin deploy c:\tmp\atest2.war
Application deployed with name atest2.
Command deploy executed successfully.

2) access non-async servlet
http://localhost:8080/atest2/simple

The lifecycle of the session can be confirmed in the server.log. The session (2d5e8779e02499f08d42ea52cd0a)was created then destroyed when time out was reached.

[2013-12-18T10:13:29.719+1100] [glassfish 4.0] [INFO] [] [] [tid: _ThreadID=106 _ThreadName=Thread-7] [timeMillis: 1387322009719] [levelValue: 800] [[
SessionCreated: 2d5e8779e02499f08d42ea52cd0a]]

[2013-12-18T10:14:52.990+1100] [glassfish 4.0] [INFO] [] [] [tid: _ThreadID=147 _ThreadName=Thread-7] [timeMillis: 1387322092990] [levelValue: 800] [[
SessionDestroyed: 2d5e8779e02499f08d42ea52cd0a]]

3) access async servlet
http://localhost:8080/atest2/test

The lifecycle of the session can be confirmed in the server.log. The session (2f028ea7bf9fc3aa8c6680ed196e)was created but it was not destroyed when time out (about 1 minute) was reached.

[2013-12-18T10:42:10.154+1100] [glassfish 4.0] [INFO] [] [] [tid: _ThreadID=180 _ThreadName=Thread-7] [timeMillis: 1387323730154] [levelValue: 800] [[
SessionCreated: 2f028ea7bf9fc3aa8c6680ed196e]]

[2013-12-18T10:42:10.154+1100] [glassfish 4.0] [INFO] [] [] [tid: _ThreadID=180 _ThreadName=Thread-7] [timeMillis: 1387323730154] [levelValue: 800] [[
AsyncHandler#onComplete]]

4) stop domain to stop the process of async servlet
asadmin stop-domain domain1
Waiting for the domain to stop .
Command stop-domain executed successfully.

When the server was shutdown, then, the session of async servlet (2f028ea7bf9fc3aa8c6680ed196e) was destroyed.

[2013-12-18T10:47:25.246+1100] [glassfish 4.0] [INFO] [NCLS-CORE-00092] [javax.enterprise.system.core] [tid: _ThreadID=182 _ThreadName=Thread-35] [timeMillis: 1387324045246] [levelValue: 800] [[
Server shutdown initiated]]

[2013-12-18T10:47:25.246+1100] [glassfish 4.0] [INFO] [NCLS-BOOTSTRAP-00028] [javax.enterprise.bootstrap] [tid: _ThreadID=182 _ThreadName=Thread-35] [timeMillis: 1387324045246] [levelValue: 800] [[
Unregistered com.sun.enterprise.glassfish.bootstrap.osgi.EmbeddedOSGiGlassFishImpl@658f8f43 from service registry.]]

[2013-12-18T10:47:25.246+1100] [glassfish 4.0] [INFO] [] [] [tid: _ThreadID=182 _ThreadName=Thread-7] [timeMillis: 1387324045246] [levelValue: 800] [[
FileMonitoring shutdown]]

[2013-12-18T10:47:25.246+1100] [glassfish 4.0] [INFO] [NCLS-JMX-00002] [javax.enterprise.system.jmx] [tid: _ThreadID=182 _ThreadName=Thread-35] [timeMillis: 1387324045246] [levelValue: 800] [[
JMXStartupService: Stopped JMXConnectorServer: null]]

[2013-12-18T10:47:25.246+1100] [glassfish 4.0] [INFO] [NCLS-JMX-00001] [javax.enterprise.system.jmx] [tid: _ThreadID=182 _ThreadName=Thread-35] [timeMillis: 1387324045246] [levelValue: 800] [[
JMXStartupService and JMXConnectors have been shut down.]]

[2013-12-18T10:47:25.277+1100] [glassfish 4.0] [INFO] [] [] [tid: _ThreadID=186 _ThreadName=Thread-7] [timeMillis: 1387324045277] [levelValue: 800] [[
SessionDestroyed: 2f028ea7bf9fc3aa8c6680ed196e]]



 Comments   
Comment by xianwu [ 18/Dec/13 ]

I have uploaded the sample application atest.war at

https://www.dropbox.com/s/x5tbo5yqca9whrg/atest2.war

Comment by Shing Wai Chan [ 24/Jun/14 ]

Sending src/main/java/org/apache/catalina/connector/CoyoteAdapter.java
Transmitting file data .
Committed revision 63382.





[GLASSFISH-19730] support a friendly interface to extend the Web-Container and EJB-Container Created: 27/Feb/13  Updated: 19/Sep/14  Resolved: 08/Oct/13

Status: Resolved
Project: glassfish
Component/s: ejb_container, monitoring, web_container
Affects Version/s: 4.0_b77
Fix Version/s: 4.1

Type: Improvement Priority: Major
Reporter: Jeremy_Lv Assignee: marina vatkina
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows



 Description   

Dear Byron, marina, Shing Wai:

I suggest to develop some additional interface for the
Web Container and EJB Container. User can write some classes that
implements the interface to extends the functions of Container.

e.g. Monitoring the processing time of the applications.

Nowadays, I want to extend a new feature related to the Web Container
and EJB Container. So I tried to search some documents and find some
related to my requirement(http://docs.oracle.com/cd/E18930_01/html/821-2415/ghmos.html#scrolltoc).
But I don't think it is friendly to use the Probe Listener. Here are
some human points as follows:

1).The Probe Listener I have mentioned above is easy to be used to
the Web container but not easy to be used to the Ejb container,
I think the reason why it is hard to apply the Probe Listener to
the Ejb container is because we must specify the exactly ejb name
to register the ejb application.

2).Because it is extended by the monitor, The monitor level must be
enabled if we want the feature available, I don't think it is a kind
way to let the monitor level enable to make sure the feature available
because it will affect the GF's performance.

Above all, I want to develop some additional interface so that both of
the Web container and Ejb container can be extended easily and it doesn't
affect the GF's performance.

Best regards
Jeremy_Lv



 Comments   
Comment by Jeremy_Lv [ 28/Feb/13 ]

As I want to extend the Ejb Container and the Web Container, I will change the code of BaseContainer and CoyoteAdapter, here are the changed place as follows:

ServletContainerInterceptor.java
    public interface ServletContainerInterceptor {
        public void preInvoke(Request req, Response res);
        public void postInvoke(Request req, Response res);
    }
EjbContainerInterceptor.java
    public interface EjbContainerInterceptor {
        public void preInvoke(EjbDescriptor ejbDesc);
        public void postInvoke(EjbDescriptor ejbDesc);
    }

As I want to extend the Ejb Container and the Web Container, I will change the code of BaseContainer and CoyoteAdapter, here are the changed place as follows:
(BTW: If user has not defined any Interceptors, the modification as follow has no influence to the current GF.)

BaseContainer.java
    //~ignored~
    final void onEnteringContainer() {
        ejbProbeNotifier.ejbContainerEnteringEvent(getContainerId(),
                containerInfo.appName, containerInfo.modName, 
                containerInfo.ejbName);
        // Here add a method calling the EjbConetainerInterceptor.
        preInvoke();
        //callFlowAgent.startTime(ContainerTypeOrApplicationType.EJB_CONTAINER);
    }

    final void onLeavingContainer() {
        ejbProbeNotifier.ejbContainerLeavingEvent(getContainerId(),
                containerInfo.appName, containerInfo.modName, 
                containerInfo.ejbName);
        // Here add a method calling the EjbContainerInterceptor.
        postInvoke();
        //callFlowAgent.endTime();
    }

    // Here add a field and some methods for the interceptors.
    private Collection<ContainerInterceptor> interceptors = null;

    private void preInvoke() {
         initInterceptors();
         for(EjbContainerInterceptor interceptor:interceptors) {
           interceptor.preInvoke(ejbDescriptor);
         }
       }

    private void postInvoke() {
        initInterceptors();
        for(EjbContainerInterceptor interceptor:interceptors) {
            interceptor.postInvoke(ejbDescriptor);
        }
    }

    private void initInterceptors() {
        if (interceptors!=null)
            return;
        try {
            Habitat h = ejbContainerUtilImpl.getDefaultHabitat();
            interceptors = h.getAllByContract(EjbContainerInterceptor.class);
        } catch (Throwable th) {
            interceptors = new ArrayList<EjbContainerInterceptor>();
            th.getStackTrace();
        }
    }
    //~ignored~
CoyoteAdapter.java
    //~ignored~
    private void doService(com.sun.grizzly.tcp.Request req,
                           Request request,
                           com.sun.grizzly.tcp.Response res,
                           Response response)
            throws Exception {
        //Here add a method calling the ServletContainerInterceptor.
        preInvoke(request, response);
        try {
            //ignoring some existing code...
        } finally {
            //ignoring some existing code...

            //Here add a method calling the ServletContainerInterceptor.
            postInvoke(request, response);
        }
    }

    // Here add a field and some methods for the interceptors.
    private Collection<ServletContainerInterceptor> interceptors = null;

    private void preInvoke(Request req, Response res) {
        initInterceptors();
        for(ServletContainerInterceptor interceptor:interceptors) {
            interceptor.preInvoke(req, res);
        }
    }

    private void postInvoke(Request req, Response res) {
        initInterceptors();
        for(ServletContainerInterceptor interceptor:interceptors) {
            interceptor.postInvoke(req, res);
        }
    }

    private void initInterceptors() {
        if (interceptors!=null)
            return;
        try {
            Habitat h = org.glassfish.internal.api.Globals.getDefaultHabitat();
            interceptors = h.getAllByContract(ServletContainerInterceptor.class);
        } catch (Throwable th) {
            interceptors = new ArrayList<ServletContainerInterceptor>();
            th.getStackTrace();
        }
    }
    //~ignored~

after all, user can implement the interface to extend the Ejb Container and the Web Container.
For example, user can write the source as follow to monitor the execute time of applications.

ApplicationMonitorInterceptorImpl.java
@Service
@Scoped(Singleton.class)
public class ApplicationMonitorInterceptorImpl implements PostConstruct,
                             ServletContainerInterceptor, EjbContainerInterceptor{
 
    public void postConstruct() {
        System.out.println("ContainerInterceptor has been injected!");
    }

    public void preInvoke(Request req, Response res){
        System.out.println("Enter the web application: "+req.getRequestURI());
    }

    public void postInvoke(Request req, Response res){
        System.out.println("Leave the web application: "+req.getRequestURI());
    }

    public void preInvoke(EjbDescriptor ejbDesc){
        System.out.println("Enter the EJB application: "+ejbDesc.getName());
    }

    public void postInvoke(EjbDescriptor ejbDesc){
        System.out.println("Leave the EJB application: "+ejbDesc.getName());
    }    
}
Comment by marina vatkina [ 28/Feb/13 ]

Please do not change BaseContainer at this time. It can destabilize the RI.

Comment by Jeremy_Lv [ 28/Feb/13 ]

marina:

Please do not change BaseContainer at this time. It can destabilize the RI.

I got it. I hope if you can consider about our modification after RI realease.

Comment by marina vatkina [ 28/Feb/13 ]

Sure

Comment by Jeremy_Lv [ 22/May/13 ]

Hi, Marina:

We can support an interface here so that it can be extend the ejb container easily. Could you take a look about this to check whether it is fine or it is invalid to support such an interface to extend the ejb container?

Comment by Jeremy_Lv [ 30/Jul/13 ]

Can anyone help me to review about this changes whether it is fine to checked in?

Comment by Jeremy_Lv [ 08/Oct/13 ]

Have checked in the changes as revision 62778.





[GLASSFISH-20694] Glassfish 4.0 and jk Unable to populate SSL attributes Created: 10/Jul/13  Updated: 19/Sep/14  Resolved: 17/Jul/13

Status: Resolved
Project: glassfish
Component/s: web_container
Affects Version/s: 4.0
Fix Version/s: 4.1

Type: Bug Priority: Major
Reporter: buddypine Assignee: oleksiys
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Glassfish 4.0 b89, Apache 2.2.22 mod_proxy_ajp


Tags: ajp, apache, proxy

 Description   

I am using a jk enabled listener behind Apache.

GF listener created as follows:
% asadmin create-network-listener --jkenabled true --protocol http-listener-1 --listenerport 8009 jk-listener

Apache httpd-ssl.conf mod_proxy_ajp
------------------------------------------
ProxyPass / ajp://localhost:8009/
ProxyPassReverse / ajp://localhost:8009/

All seems to work fine and I can connect using SSL to Apache which proxies the requests through to Glassfish but I get the exception below in the logs (this does not happen with GF 3):

[2013-07-10T15:06:37.929+0200] [glassfish 4.0] [WARNING] [] [org.glassfish.grizzly.http.server.util.RequestUtils] [tid: _ThreadID=53 _ThreadName=jk-listener(4)] [timeMillis: 1373461597929] [levelValue: 900] [[
Unable to populate SSL attributes
java.lang.IllegalStateException: SSLEngine is null
at org.glassfish.grizzly.ssl.SSLSupportImpl.<init>(SSLSupportImpl.java:87)
at org.glassfish.grizzly.http.server.util.RequestUtils.populateSSLAttributes(RequestUtils.java:85)
at org.glassfish.grizzly.http.server.Request.getAttribute(Request.java:865)
at org.apache.catalina.connector.Request.populateSSLAttributes(Request.java:4581)
at org.apache.catalina.connector.Request.getAttributeNames(Request.java:1412)
at org.apache.catalina.connector.RequestFacade.getAttributeNames(RequestFacade.java:367)
at org.jboss.weld.context.beanstore.http.RequestBeanStore.getAttributeNames(RequestBeanStore.java:48)
at org.jboss.weld.context.beanstore.AttributeBeanStore.getPrefixedAttributeNames(AttributeBeanStore.java:207)
at org.jboss.weld.context.beanstore.AttributeBeanStore.attach(AttributeBeanStore.java:106)
at org.jboss.weld.context.http.HttpRequestContextImpl.associate(HttpRequestContextImpl.java:52)
at org.jboss.weld.context.http.HttpRequestContextImpl.associate(HttpRequestContextImpl.java:37)
at org.jboss.weld.servlet.WeldListener.requestInitialized(WeldListener.java:190)
at org.apache.catalina.core.StandardContext.fireRequestInitializedEvent(StandardContext.java:5225)
at org.apache.catalina.core.StandardHostValve.preInvoke(StandardHostValve.java:647)
at org.apache.catalina.core.StandardHostValve.__invoke(StandardHostValve.java:166)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:357)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:260)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:188)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
at java.lang.Thread.run(Thread.java:724)
]]



 Comments   
Comment by Shing Wai Chan [ 10/Jul/13 ]

The exception is from org.glassfish.grizzly.ssl.SSLSupportImpl in Grizzly. Assign to Alexey for further investigation.

Comment by oleksiys [ 12/Jul/13 ]

looks like apache doesn't pass all the SSL information to Glassfish.
Can you pls. share the entire ssl.conf?

Comment by buddypine [ 12/Jul/13 ]

Sure:

 
#
# This is the Apache server configuration file providing SSL support.
# It contains the configuration directives to instruct the server how to
# serve pages over an https connection. For detailing information about these 
# directives see <URL:http://httpd.apache.org/docs/2.2/mod/mod_ssl.html>
# 
# Do NOT simply read the instructions in here without understanding
# what they do.  They're here only as hints or reminders.  If you are unsure
# consult the online docs. You have been warned.  
#

#
# Pseudo Random Number Generator (PRNG):
# Configure one or more sources to seed the PRNG of the SSL library.
# The seed data should be of good random quality.
# WARNING! On some platforms /dev/random blocks if not enough entropy
# is available. This means you then cannot use the /dev/random device
# because it would lead to very long connection times (as long as
# it requires to make more entropy available). But usually those
# platforms additionally provide a /dev/urandom device which doesn't
# block. So, if available, use this one instead. Read the mod_ssl User
# Manual for more details.
#
#SSLRandomSeed startup file:/dev/random  512
#SSLRandomSeed startup file:/dev/urandom 512
#SSLRandomSeed connect file:/dev/random  512
#SSLRandomSeed connect file:/dev/urandom 512


#
# When we also provide SSL we have to listen to the 
# standard HTTP port (see above) and to the HTTPS port
#
# Note: Configurations that use IPv6 but not IPv4-mapped addresses need two
#       Listen directives: "Listen [::]:443" and "Listen 0.0.0.0:443"
#
Listen 443

##
##  SSL Global Context
##
##  All SSL configuration in this context applies both to
##  the main server and all SSL-enabled virtual hosts.
##

#
#   Some MIME-types for downloading Certificates and CRLs
#
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl    .crl

#   Pass Phrase Dialog:
#   Configure the pass phrase gathering process.
#   The filtering dialog program (`builtin' is a internal
#   terminal dialog) has to provide the pass phrase on stdout.
SSLPassPhraseDialog  builtin

#   Inter-Process Session Cache:
#   Configure the SSL Session Cache: First the mechanism 
#   to use and second the expiring timeout (in seconds).
#SSLSessionCache         "dbm:/private/var/run/ssl_scache"
SSLSessionCache        "shmcb:/private/var/run/ssl_scache(512000)"
SSLSessionCacheTimeout  300

#   Semaphore:
#   Configure the path to the mutual exclusion semaphore the
#   SSL engine uses internally for inter-process synchronization. 
SSLMutex  "file:/private/var/run/ssl_mutex"

##
## SSL Virtual Host Context
##

<VirtualHost _default_:443>

#   General setup for the virtual host
DocumentRoot "/Library/WebServer/Documents"

ServerAdmin you@example.com
ErrorLog "/private/var/log/apache2/error_log"
TransferLog "/private/var/log/apache2/access_log"

ServerName myapp.local.inversebit.com:443
ProxyPass / ajp://myapp.local.inversebit.com:8009/
ProxyPassReverse / ajp://myapp.local.inversebit.com:8009/

#   SSL Engine Switch:
#   Enable/Disable SSL for this virtual host.
SSLEngine on

#   SSL Cipher Suite:
#   List the ciphers that the client is permitted to negotiate.
#   See the mod_ssl documentation for a complete list.
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL

#   Server Certificate:
#   Point SSLCertificateFile at a PEM encoded certificate.  If
#   the certificate is encrypted, then you will be prompted for a
#   pass phrase.  Note that a kill -HUP will prompt again.  Keep
#   in mind that if you have both an RSA and a DSA certificate you
#   can configure both in parallel (to also allow the use of DSA
#   ciphers, etc.)
#SSLCertificateFile "/private/etc/apache2/server.crt"
#SSLCertificateFile "/private/etc/apache2/server-dsa.crt"

SSLCertificateFile /Users/phill/etc/certs/newcert.pem
SSLCertificateKeyFile /Users/phill/etc/certs/webserver.nopass.key
SSLCACertificateFile /Users/phill/etc/certs/demoCA/cacert.pem
SSLCARevocationPath /Users/phill/etc/certs/demoCA/crl

#   Server Private Key:
#   If the key is not combined with the certificate, use this
#   directive to point at the key file.  Keep in mind that if
#   you've both a RSA and a DSA private key you can configure
#   both in parallel (to also allow the use of DSA ciphers, etc.)
#SSLCertificateKeyFile "/private/etc/apache2/server.key"
#SSLCertificateKeyFile "/private/etc/apache2/server-dsa.key"

#   Server Certificate Chain:
#   Point SSLCertificateChainFile at a file containing the
#   concatenation of PEM encoded CA certificates which form the
#   certificate chain for the server certificate. Alternatively
#   the referenced file can be the same as SSLCertificateFile
#   when the CA certificates are directly appended to the server
#   certificate for convinience.
#SSLCertificateChainFile "/private/etc/apache2/server-ca.crt"

#   Certificate Authority (CA):
#   Set the CA certificate verification path where to find CA
#   certificates for client authentication or alternatively one
#   huge file containing all of them (file must be PEM encoded)
#   Note: Inside SSLCACertificatePath you need hash symlinks
#         to point to the certificate files. Use the provided
#         Makefile to update the hash symlinks after changes.
#SSLCACertificatePath "/private/etc/apache2/ssl.crt"
#SSLCACertificateFile "/private/etc/apache2/ssl.crt/ca-bundle.crt"

#   Certificate Revocation Lists (CRL):
#   Set the CA revocation path where to find CA CRLs for client
#   authentication or alternatively one huge file containing all
#   of them (file must be PEM encoded)
#   Note: Inside SSLCARevocationPath you need hash symlinks
#         to point to the certificate files. Use the provided
#         Makefile to update the hash symlinks after changes.
#SSLCARevocationPath "/private/etc/apache2/ssl.crl"
#SSLCARevocationFile "/private/etc/apache2/ssl.crl/ca-bundle.crl"

#   Client Authentication (Type):
#   Client certificate verification type and depth.  Types are
#   none, optional, require and optional_no_ca.  Depth is a
#   number which specifies how deeply to verify the certificate
#   issuer chain before deciding the certificate is not valid.
#SSLVerifyClient require
#SSLVerifyDepth  10

#   Access Control:
#   With SSLRequire you can do per-directory access control based
#   on arbitrary complex boolean expressions containing server
#   variable checks and other lookup directives.  The syntax is a
#   mixture between C and Perl.  See the mod_ssl documentation
#   for more details.
#<Location />
#SSLRequire (    %{SSL_CIPHER} !~ m/^(EXP|NULL)/ \
#            and %{SSL_CLIENT_S_DN_O} eq "Snake Oil, Ltd." \
#            and %{SSL_CLIENT_S_DN_OU} in {"Staff", "CA", "Dev"} \
#            and %{TIME_WDAY} >= 1 and %{TIME_WDAY} <= 5 \
#            and %{TIME_HOUR} >= 8 and %{TIME_HOUR} <= 20       ) \
#           or %{REMOTE_ADDR} =~ m/^192\.76\.162\.[0-9]+$/
#</Location>

#   SSL Engine Options:
#   Set various options for the SSL engine.
#   o FakeBasicAuth:
#     Translate the client X.509 into a Basic Authorisation.  This means that
#     the standard Auth/DBMAuth methods can be used for access control.  The
#     user name is the `one line' version of the client's X.509 certificate.
#     Note that no password is obtained from the user. Every entry in the user
#     file needs this password: `xxj31ZMTZzkVA'.
#   o ExportCertData:
#     This exports two additional environment variables: SSL_CLIENT_CERT and
#     SSL_SERVER_CERT. These contain the PEM-encoded certificates of the
#     server (always existing) and the client (only existing when client
#     authentication is used). This can be used to import the certificates
#     into CGI scripts.
#   o StdEnvVars:
#     This exports the standard SSL/TLS related `SSL_*' environment variables.
#     Per default this exportation is switched off for performance reasons,
#     because the extraction step is an expensive operation and is usually
#     useless for serving static content. So one usually enables the
#     exportation for CGI and SSI requests only.
#   o StrictRequire:
#     This denies access when "SSLRequireSSL" or "SSLRequire" applied even
#     under a "Satisfy any" situation, i.e. when it applies access is denied
#     and no other module can change it.
#   o OptRenegotiate:
#     This enables optimized SSL connection renegotiation handling when SSL
#     directives are used in per-directory context. 
#SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
<FilesMatch "\.(cgi|shtml|phtml|php)$">
    SSLOptions +StdEnvVars
</FilesMatch>
<Directory "/Library/WebServer/CGI-Executables">
    SSLOptions +StdEnvVars
</Directory>

#   SSL Protocol Adjustments:
#   The safe and default but still SSL/TLS standard compliant shutdown
#   approach is that mod_ssl sends the close notify alert but doesn't wait for
#   the close notify alert from client. When you need a different shutdown
#   approach you can use one of the following variables:
#   o ssl-unclean-shutdown:
#     This forces an unclean shutdown when the connection is closed, i.e. no
#     SSL close notify alert is send or allowed to received.  This violates
#     the SSL/TLS standard but is needed for some brain-dead browsers. Use
#     this when you receive I/O errors because of the standard approach where
#     mod_ssl sends the close notify alert.
#   o ssl-accurate-shutdown:
#     This forces an accurate shutdown when the connection is closed, i.e. a
#     SSL close notify alert is send and mod_ssl waits for the close notify
#     alert of the client. This is 100% SSL/TLS standard compliant, but in
#     practice often causes hanging connections with brain-dead browsers. Use
#     this only for browsers where you know that their SSL implementation
#     works correctly. 
#   Notice: Most problems of broken clients are also related to the HTTP
#   keep-alive facility, so you usually additionally want to disable
#   keep-alive for those clients, too. Use variable "nokeepalive" for this.
#   Similarly, one has to force some clients to use HTTP/1.0 to workaround
#   their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and
#   "force-response-1.0" for this.
BrowserMatch ".*MSIE.*" \
         nokeepalive ssl-unclean-shutdown \
         downgrade-1.0 force-response-1.0

#   Per-Server Logging:
#   The home of a custom SSL log file. Use this when you want a
#   compact non-error SSL logfile on a virtual host basis.
CustomLog "/private/var/log/apache2/ssl_request_log" \
          "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

</VirtualHost>                                  
Comment by oleksiys [ 16/Jul/13 ]

Ok, looks like jboss.weld tries to retrieve client certificate, which is not available because Apache didn't forward it to us.
The exception itself doesn't have any impact on execution flow, except flooding server.log w/ the stacktrace.

We have reduced the logging level of the exception to FINE, so it will not occur in the server.log in normal case.
As a workaround you can change the logging level (via admin gui) of "org.glassfish.grizzly.http.server.util.RequestUtils" to "SEVERE"

Comment by oleksiys [ 17/Jul/13 ]

marking as fixed and closing the issue.
feel free to reopen it if needed.

thanks.

Comment by juliohm [ 04/Aug/13 ]

Greetings,

I am attempting to pass on the SSL authentication from Apache into Glassfish using mod_jk. I found the same exception reported here, and a call to

request.getAttribute("javax.servlet.request.X509Certificate");

returns null.

Other have also reported:

The exception itself doesn't have any impact on execution flow, except flooding server.log w/ the stacktrace.

Could this exception be the cause of it? Or am I doing something wrong with mod_jk at this point?

Comment by oleksiys [ 06/Aug/13 ]

@juliohm
most probably your client (may be browser) doesn't sent its certificate.
You may want to force clients to send their certificates by adding/uncommenting this in the Apache ssl.conf:

SSLVerifyClient require
Comment by juliohm [ 06/Aug/13 ]

Oddly, I already have the SSL config in the VirtualHost.

I can connect fine using a web browser and the appropriate certificates.

I've been trying to understand how the mod_jk module works, but I can't get a grip on the concept. Since it's forwarding the SSL authentication to a backend glassfish, does the java server need to receive this through its SSL listener as well (standard port 8181)? Or are the SSL credentials simply filled within the clear HTTP listener (8080)?.

Do I even need the same certificates in Java keystore as well as in Apache?

Comment by oleksiys [ 06/Aug/13 ]

Client certificate should be forwarded to Glassfish as part of Jk request, so you don't need any additional listeners neither https nor http.
But in your case you said

request.getAttribute("javax.servlet.request.X509Certificate");

return null, which IMO means Apache/mod_jk doesn't forward the certificate. Did you try to set SSLVerfyClient flag to "require"?

Comment by juliohm [ 06/Aug/13 ]

This is the basic setup I have in my VirtualHost (comments and related file paths redacted)

<VirtualHost ...>
   ......
   JkMount /gf_forward/* ajp13_worker
   SSLEngine on
   SSLProtocol all -SSLv2
   SSLHonorCipherOrder On
   SSLCipherSuite .......
   SSLCertificateFile    /path/to/certfile
   SSLCertificateKeyFile /path/to/keyfile
   SSLCACertificateFile /path/to/ca/certfile
   SSLCARevocationFile /path/to/crlfile
   SSLVerifyClient require
   SSLVerifyDepth  10
   ......
</VirtualHost>

I just find it funny that connections are correctly directed to glassfish. I can navigate whatever service is deployed in there. For example https://myserver/gf_forward/myapp works just fine. But I can see from my server.log that the request attribute "javax.servlet.request.X509Certificate" resolves to null.

I'm actually not sure what's going on

Comment by oleksiys [ 07/Aug/13 ]

Do you have this set?

JkOptions +ForwardSSLCertChain 

If it still doesn't work, can you pls. share your apache configuration (pls. send to oleksiys [at] java.net).

Comment by juliohm [ 07/Aug/13 ]

I was finally able to get it working! After several days, one of my friends had this insight.

SSLOptions +StdEnvVars +ExportCertData

You need ExportCertData enabled in SSLOptions. Now the certificate shows up in the request inside glassfish.

This is not much related to the ticket here, so I'm glad to this out of the way from this therad. Thank you very much for the help.





[GLASSFISH-21040] Update commons-fileupload Created: 11/Apr/14  Updated: 19/Sep/14  Resolved: 05/May/14

Status: Resolved
Project: glassfish
Component/s: web_container
Affects Version/s: 4.0
Fix Version/s: 4.1

Type: Bug Priority: Major
Reporter: Joe Di Pol Assignee: Joe Di Pol
Resolution: Invalid Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: 4_0_1-mustfix

 Description   

Update commons-fileupload to 1.3.1 (requires commons-io 2.2)



 Comments   
Comment by Joe Di Pol [ 05/May/14 ]

The bug was fixed in r63213 by patching the source and not updating the component version. Closing this bug as invalid.





[GLASSFISH-20980] Convert private JDK API usage to new public equivalent (web container) Created: 11/Feb/14  Updated: 19/Sep/14  Resolved: 13/Feb/14

Status: Resolved
Project: glassfish
Component/s: web_container
Affects Version/s: None
Fix Version/s: 4.1

Type: Bug Priority: Major
Reporter: Tim Quinn Assignee: Shing Wai Chan
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Dependency
blocks GLASSFISH-19812 Prevent usage of proprietary API" war... Open

 Description   

Some time ago the JDK team provided a private entry point sun.misc.ClassLoaderUtil.releaseLoader for cleaning up open JARs held by a class loader.

The JDK team would like to remove this private method in JDK 9 given that JDK 7 provides the equivalent URLClassLoader.close method.

Currently the only place in GlassFish where grep finds sun.misc.ClassLoaderUtil is

main/appserver/web/war-util/src/main/java/org/glassfish/web/loader/WebappClassLoader.java



 Comments   
Comment by Romain Grécourt [ 13/Feb/14 ]

Tim, you may also want to look at GLASSFISH-19812, it's an umbrella issue for all the private APIs reported by javac during the build.

Comment by Tim Quinn [ 13/Feb/14 ]

Add "web container" to the title

Comment by Shing Wai Chan [ 13/Feb/14 ]

Sending src/main/java/org/glassfish/web/loader/WebappClassLoader.java
Transmitting file data .
Committed revision 63126.





[GLASSFISH-21032] NPE if alternatedocroot_1 has from=/* Created: 07/Apr/14  Updated: 19/Sep/14  Resolved: 28/May/14

Status: Resolved
Project: glassfish
Component/s: web_container
Affects Version/s: 4.1
Fix Version/s: 4.1_b08

Type: Bug Priority: Major
Reporter: m.zdila Assignee: Shing Wai Chan
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

glassfish-4.0.1-b04-04_05_2014-ml
java version "1.7.0_51"
OpenJDK Runtime Environment (IcedTea 2.4.5) (7u51-2.4.5-2)
OpenJDK 64-Bit Server VM (build 24.51-b03, mixed mode)


Tags: 4_0_1-review

 Description   

glassfish-4.0.1-b04-04_05_2014-ml

In glassfish-web.xml I have following element:
<property name="alternatedocroot_1" value="from=/* dir=/home/martin/teris-client"/>

On deploy Glassfish throws exception:

2014-04-07T16:32:31.149+0200|SEVERE: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: org.apache.catalina.LifecycleException: start:
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5898)
at com.sun.enterprise.web.WebModule.start(WebModule.java:691)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1041)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:1024)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:747)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2286)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1932)
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:139)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:500)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:539)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:535)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:356)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:534)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:565)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:557)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:356)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:556)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1464)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1300(CommandRunnerImpl.java:109)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1846)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1722)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534)
at com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224)
at org.glassfish.grizzly.http.server.StaticHttpHandlerBase.service(StaticHttpHandlerBase.java:189)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:215)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:291)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:209)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:137)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:115)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:550)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
at java.lang.Thread.run(Thread.java:744)
Caused by: org.apache.catalina.LifecycleException: start:
at org.apache.catalina.loader.WebappLoader.start(WebappLoader.java:770)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5864)
... 49 more
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 0
at java.lang.String.charAt(String.java:658)
at org.apache.naming.resources.WebDirContext.getAbsoluteJarResourceName(WebDirContext.java:416)
at org.apache.naming.resources.WebDirContext.lookupAllFromJars(WebDirContext.java:349)
at org.apache.naming.resources.WebDirContext.list(WebDirContext.java:214)
at org.apache.catalina.loader.WebappLoader.copyDir(WebappLoader.java:1321)
at org.apache.catalina.loader.WebappLoader.setRepositories(WebappLoader.java:1116)
at org.apache.catalina.loader.WebappLoader.start(WebappLoader.java:759)
... 50 more

In Glassfish 4.0 it works.



 Comments   
Comment by Shing Wai Chan [ 17/May/14 ]

Local testing seems ok. Can you attach a test case for this?

Comment by Shing Wai Chan [ 27/May/14 ]

According to stack trace, an empty String is passed to WebDirContext.getAbsoluteJarResourceName.
The code need to be fixed in this case.

Comment by Shing Wai Chan [ 28/May/14 ]

Sending src/main/java/org/apache/naming/resources/WebDirContext.java
Transmitting file data .
Committed revision 63309.





[GLASSFISH-21052] NPE occurs in AuthenticatorBase.register with log level Fine. Created: 28/Apr/14  Updated: 19/Sep/14  Resolved: 13/May/14

Status: Resolved
Project: glassfish
Component/s: web_container
Affects Version/s: 4.0, 4.1
Fix Version/s: 4.1_b08

Type: Bug Priority: Minor
Reporter: nkobayashi Assignee: Shing Wai Chan
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All


Tags: 4_0_1-review

 Description   

This is NPE
java.lang.NullPointerException
at org.apache.catalina.authenticator.AuthenticatorBase.register(AuthenticatorBase.java:861)
at org.apache.catalina.authenticator.AuthenticatorBase.logout(AuthenticatorBase.java:973)
at com.sun.web.security.RealmAdapter.doLogout(RealmAdapter.java:503)
at com.sun.web.security.RealmAdapter.logout(RealmAdapter.java:485)
at org.apache.catalina.connector.Request.logout(Request.java:2262)
at org.apache.catalina.connector.RequestFacade.logout(RequestFacade.java:1121)

org.apache.catalina.authenticator.AuthenticatorBase#register

protected void register(HttpRequest request, HttpResponse response,
        Principal principal, String authType,
        String username, char[] password) {

    if (log.isLoggable(Level.FINE)) {
        String msg = "Authenticated '" + principal.getName() + "' with type '"
                     + authType + "'";
        log.log(Level.FINE, msg);
    }

principal is null. because
org.apache.catalina.authenticator.AuthenticatorBase#logout

        // principal and authType set to null in the following
        register(request, (HttpResponse)request.getResponse(), null,
                null, null, null);


 Comments   
Comment by Shing Wai Chan [ 13/May/14 ]

Sending src/main/java/org/apache/catalina/authenticator/AuthenticatorBase.java
Transmitting file data .
Committed revision 63267.





[GLASSFISH-20591] JAX-RSResponse.status(404) is overwritten by WebContainer Created: 29/May/13  Updated: 19/Sep/14

Status: Open
Project: glassfish
Component/s: jax-rs, web_container
Affects Version/s: 4.0_b89_RC5
Fix Version/s: 4.1

Type: Bug Priority: Major
Reporter: Aslak Knutsen Assignee: Miroslav Fuksa
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to JERSEY-1909 JAX-RSResponse.status(404) is overwri... Resolved

 Description   

Given:

@Path("/conference")
public class ConferenceResource implements Resource {
 
    private static final String BASE_MEDIA_TYPE = "application/vnd.ced+xml";
    private static final String CONFERENCE_MEDIA_TYPE = BASE_MEDIA_TYPE + ";type=conference";
    private static final String SESSION_MEDIA_TYPE = BASE_MEDIA_TYPE + ";type=session";
 
...
 
    @GET
    @Path("/{id}")
    @Produces("application/vnd.ced+xml")
    public Response get(@PathParam("id") String id) {
        Conference conference = repository.get(id);
        if(conference == null) {
            return Response.status(Status.NOT_FOUND).type(CONFERENCE_MEDIA_TYPE).build();
        }
        return Response.ok(
                new ConferenceRepresentation(conference, uriInfo.getAbsolutePathBuilder()))
                .type(CONFERENCE_MEDIA_TYPE).build();
    }
...
}

Expected:

Content-Type: application/vnd.ced+xml; type=conference
[Empty Body]

Result:

When the Resource is not found (http 404 is returned by JAX-RS), the WebContainer takes over and returns Content-Type: text/html and the standard Error page as a body.

wire log

DEBUG [org.apache.http.wire] >> "GET /3998f027-d794-4650-9144-aac9990f26bd/api/conference/b849d477-fb42-4e93-9902-84e0741d1ffb HTTP/1.1[\r][\n]"
DEBUG [org.apache.http.wire] >> "Accept: application/vnd.ced+xml; type=conference[\r][\n]"
DEBUG [org.apache.http.wire] >> "Host: localhost:8080[\r][\n]"
DEBUG [org.apache.http.wire] >> "Connection: Keep-Alive[\r][\n]"
DEBUG [org.apache.http.wire] >> "Accept-Encoding: gzip,deflate[\r][\n]"
DEBUG [org.apache.http.wire] >> "[\r][\n]"
DEBUG [org.apache.http.wire] << "HTTP/1.1 404 Not Found[\r][\n]"
DEBUG [org.apache.http.wire] << "X-Powered-By: Servlet/3.1 JSP/2.3 (GlassFish Server Open Source Edition  4.0  Java/Oracle Corporation/1.7)[\r][\n]"
DEBUG [org.apache.http.wire] << "Server: GlassFish Server Open Source Edition  4.0 [\r][\n]"
DEBUG [org.apache.http.wire] << "Content-Language: [\r][\n]"
DEBUG [org.apache.http.wire] << "Content-Type: text/html[\r][\n]"
DEBUG [org.apache.http.wire] << "Date: Wed, 29 May 2013 23:29:43 GMT[\r][\n]"
DEBUG [org.apache.http.wire] << "Content-Length: 1082[\r][\n]"
DEBUG [org.apache.http.wire] << "[\r][\n]"
DEBUG [org.apache.http.wire] << "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>GlassFish Server Open Source Edition  4.0  - Error report</title><style type="text/css"><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - Not Found</h1><hr/><p><b>type</b> Status report</p><p><b>message</b>Not Found</p><p><b>description</b>The requested resource is not available.</p><hr/><h3>GlassFish Server Open Source Edition  4.0 </h3></body></html>"





GlassFish services and components to conform with configuration modularity (GLASSFISH-19408)

[GLASSFISH-19412] Web container configuration to conform with configuration modularity Created: 06/Dec/12  Updated: 19/Sep/14

Status: Open
Project: glassfish
Component/s: web_container
Affects Version/s: None
Fix Version/s: 4.1

Type: Sub-task Priority: Major
Reporter: Masoud Kalali Assignee: Amy Roh
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Different modules requires to conform with configuration modularity. This is a parent task for all the issue being filed for this project. More details at the internal wiki page: http://aseng-wiki.us.oracle.com/asengwiki/display/GlassFish/Config+Modularity+One+Pager This ticket is to track this change for web container.



 Comments   
Comment by Amy Roh [ 14/Mar/13 ]

Grizzly service starts before web container service which is only started after web deployment. Grizzly start up service currently requires some of web related configs to exist in domain.xml.  Since Grizzly requires web configuration to be available, config modularity divides web container configurations to multiple modules (some will go to grizzly service module to satisfy its dependency and some remain in the gf-web-connector.  Need to decide what is the optimal solution.

Comment by Amy Roh [ 27/Mar/13 ]

Configuration modularity will be addressed in 4.0.1.





[GLASSFISH-18267] Traffic loss during instance start between the time 8080 is up and application is loaded Created: 30/Jan/12  Updated: 19/Sep/14  Resolved: 30/May/13

Status: Resolved
Project: glassfish
Component/s: web_container
Affects Version/s: 3.1.2
Fix Version/s: 4.1

Type: Bug Priority: Critical
Reporter: sonymanuel Assignee: oleksiys
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

OEL6 + JRockit


Attachments: File framework.log.1     Text File server.log    
Issue Links:
Dependency
depends on GLASSFISH-18268 NPE in org.shoal.adapter.store.Replic... Open
Related
is related to GLASSFISH-18211 http client sometimes receives a "400... Resolved
Tags: 312_qa, 3_1_2-exclude, 3_1_2-release-note-added, 3_1_2-release-notes, 4_0-release-notes, 4_0-release-notes-completed, 4_0-release-notes-drafted

 Description   

Build : 3.1.2 build 17 , JRockit VM 6u29., OEL6

When running HA Stress tests we are observing traffic loss when a cluster instance is restarting. There is a time gap between the time when port 8080 is up and application loading is done. Loadbalancer probably detects http port is up and starts forwarding traffic. In this particular case, the time is approx. 11 sec and the request rate is 25 reqs/instance. 325 requests failed.

The client receives a 404 during this time :

SEVERE: 4xx or 5xx Response code - 404 HttpClientSession-47926
Jan 17, 2012 10:58:01 PM com.sun.dft.glassfish.stress.ReadWriteTest$MyTestListener postInvoke
SEVERE: <Unable to render embedded object: File (//www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>GlassFish v3 - Error report</title><style type="text/css"><) not found.--H1

{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}

H2

{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;}

H3

{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;}

BODY

{font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;}

B

{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;}

P

{font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}

A

{color : black;}

HR

{color : #525D76;}

--></style> </head><body><h1>HTTP Status 404 - </h1><hr/><p><b>type</b> Status report</p><p><b>message</b></p><p><b>description</b>The requested resource () is not available.</p><hr/><h3>GlassFish Server Open Source Edition 3.1.2-b17</h3></body></html>

Server log :

http://agni-1.us.oracle.com/net/asqe-logs.us.oracle.com/export1/3.1.2/Results/build17/ha/oel6_stress/stress/com.sun.dft.glassfish.stress.ReadWriteTest/testReadWrite/logs/st-cluster/instance101/logs/server.log

[#|2012-01-17T22:58:00.873-0800|INFO|glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=10;_ThreadName=Thread-2;|WEB0169: Created HTTP listener [http-listener-1] on host/port [0.0.0.0:28080]|#]

[#|2012-01-17T22:58:00.994-0800|INFO|glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=10;_ThreadName=Thread-2;|WEB0169: Created HTTP listener [http-listener-2] on host/port [0.0.0.0:28181]|#]

[#|2012-01-17T22:58:01.025-0800|INFO|glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=10;_ThreadName=Thread-2;|WEB0169: Created HTTP listener [admin-listener] on host/port [0.0.0.0:24848]|#]

[#|2012-01-17T22:58:01.509-0800|INFO|glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=10;_ThreadName=Thread-2;|WEB0171: Created virtual server [server]|#]

[#|2012-01-17T22:58:01.518-0800|INFO|glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=10;_ThreadName=Thread-2;|WEB0171: Created virtual server [__asadmin]|#]

[#|2012-01-17T22:58:05.306-0800|INFO|glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=10;_ThreadName=Thread-2;|WEB0172: Virtual server [server] loaded default web module []|#]

[#|2012-01-17T22:58:08.619-0800|INFO|glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.services.impl|_ThreadID=10;_ThreadName=Thread-2;|core.start_container_done|#]

[#|2012-01-17T22:58:09.940-0800|INFO|glassfish3.1.2|javax.enterprise.system.core.security.com.sun.enterprise.security|_ThreadID=10;_ThreadName=Thread-2;|SEC1002: Security Manager is OFF.|#]

[#|2012-01-17T22:58:10.115-0800|INFO|glassfish3.1.2|javax.enterprise.system.core.security.com.sun.enterprise.security|_ThreadID=10;_ThreadName=Thread-2;|SEC1010: Entering Security Startup Service|#]

[#|2012-01-17T22:58:10.147-0800|INFO|glassfish3.1.2|javax.enterprise.system.core.security.com.sun.enterprise.security|_ThreadID=10;_ThreadName=Thread-2;|SEC1143: Loading policy provider com.sun.enterprise.security.provider.PolicyWrapper.|#]

[#|2012-01-17T22:58:10.405-0800|INFO|glassfish3.1.2|javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm|_ThreadID=10;_ThreadName=Thread-2;|SEC1115: Realm [admin-realm] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created.|#]

[#|2012-01-17T22:58:10.417-0800|INFO|glassfish3.1.2|javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm|_ThreadID=10;_ThreadName=Thread-2;|SEC1115: Realm [file] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created.|#]

[#|2012-01-17T22:58:10.539-0800|INFO|glassfish3.1.2|javax.enterprise.system.core.security.com.sun.enterprise.security.auth.realm|_ThreadID=10;_ThreadName=Thread-2;|SEC1115: Realm [certificate] of classtype [com.sun.enterprise.security.auth.realm.certificate.CertificateRealm] successfully created.|#]

[#|2012-01-17T22:58:10.591-0800|INFO|glassfish3.1.2|javax.enterprise.system.core.security.com.sun.enterprise.security|_ThreadID=10;_ThreadName=Thread-2;|SEC1011: Security Service(s) Started Successfully|#]

[#|2012-01-17T22:58:13.758-0800|INFO|glassfish3.1.2|ShoalLogger|_ThreadID=10;_ThreadName=Thread-2;|**GroupServiceProvider:: REGISTERED member event listeners for <group, instance> => <st-cluster, instance101>|#]

[#|2012-01-17T22:58:14.061-0800|INFO|glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=10;_ThreadName=Thread-2;|WEB0671: Loading application [ReadWriteServletTest] at [/ReadWriteServletTest]|#]

[#|2012-01-17T22:58:14.076-0800|INFO|glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=10;_ThreadName=Thread-2;|CORE10010: Loading application ReadWriteServletTest done in 5,380 ms|#]

[#|2012-01-17T22:58:14.085-0800|INFO|glassfish3.1.2|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=10;_ThreadName=Thread-2;|GlassFish Server Open Source Edition 3.1.2-b17 (17) startup time : Felix (8,857ms), startup services(21,300ms), total(30,157ms)|#]



 Comments   
Comment by Shing Wai Chan [ 30/Jan/12 ]

I notice the following in the server.log:

exception or error occurred in the container during the request processing
java.lang.NullPointerException
at org.shoal.adapter.store.ReplicatedBackingStore.load(ReplicatedBackingStore.java:97)
at org.glassfish.web.ha.session.management.ReplicationStore.loadFromBackingStore(ReplicationStore.java:407)
at org.glassfish.web.ha.session.management.ReplicationStore.load(ReplicationStore.java:396)
at org.apache.catalina.session.PersistentManagerBase.doSwapIn(PersistentManagerBase.java:1052)
at org.apache.catalina.session.PersistentManagerBase.swapIn(PersistentManagerBase.java:1015)
at org.glassfish.web.ha.session.management.ReplicationManagerBase.findSession(ReplicationManagerBase.java:151)
at org.apache.catalina.connector.Request.doGetSession(Request.java:2852)
at org.apache.catalina.connector.Request.getSessionInternal(Request.java:2777)
at org.apache.catalina.connector.Request.unlockSession(Request.java:4201)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:342)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:174)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:746)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1045)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:228)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
at java.lang.Thread.run(Thread.java:662)

Comment by Shing Wai Chan [ 30/Jan/12 ]

Assign to shoal team to investigate the NPE from org.shoal.adapter.store.ReplicatedBackingStore.load(ReplicatedBackingStore.java:97).

Comment by Joe Fialli [ 30/Jan/12 ]

The reported NPE in shoal is happening AFTER the clustered instance is started and immediately stops. Here are relevant log messages. Shoal GMS has an glassfish PREPARE_SHUTDOWN event handler. As part of that handling,
GMS leaves the cluster. The server initiated shutdown is at 22:52:23.747. I can not tell if someone ran
"asadmin stop-instance" on the instance or if something failed in the startup of the server and then glassfish server
shutdown was initiated. The NPE is not causing the server to shutdown, the NPE is occurring after the instance leaves the gms cluster. The shoal cache code is not handling quick shutdown properly but I do not think that is the main
issue for this bug.

[#|2012-01-17T22:44:08.990-0800|INFO|glassfish3.1.2|javax.enterprise.system.core.security.com.sun.enterprise.security|_ThreadID=21;_ThreadName=Thread-2;|SEC1011: Security Service(s) Started Successfully|#]

[#|2012-01-17T22:44:10.170-0800|INFO|glassfish3.1.2|ShoalLogger|_ThreadID=21;_ThreadName=Thread-2;|**GroupServiceProvider:: REGISTERED member event listeners for <group, instance> => <st-cluster, instance101>|#]

[#|2012-01-17T22:44:10.361-0800|INFO|glassfish3.1.2|javax.enterprise.system.container.web.com.sun.enterprise.web|_ThreadID=21;_ThreadName=Thread-2;|WEB0671: Loading application [ReadWriteServletTest] at [/ReadWriteServletTest]|#]

[#|2012-01-17T22:44:10.568-0800|INFO|glassfish3.1.2|javax.enterprise.system.tools.admin.org.glassfish.deployment.admin|_ThreadID=21;_ThreadName=Thread-2;|ReadWriteServletTest was successfully deployed in 2,513 milliseconds.|#]

[#|2012-01-17T22:52:23.747-0800|INFO|glassfish3.1.2|javax.enterprise.system.tools.admin.com.sun.enterprise.v3.admin.cluster|_ThreadID=22;_ThreadName=Thread-2;|Server shutdown initiated|#]

[#|2012-01-17T22:52:23.752-0800|INFO|glassfish3.1.2|javax.org.glassfish.gms.org.glassfish.gms|_ThreadID=22;_ThreadName=Thread-2;|GMSAD1008: GMSAdapter for member: instance101 group: st-cluster received GlassfishEventType: prepare_shutdown|#]

[#|2012-01-17T22:52:23.757-0800|INFO|glassfish3.1.2|ShoalLogger|_ThreadID=22;_ThreadName=Thread-2;|GMS1096: member: instance101 is leaving group: st-cluster|#]

[#|2012-01-17T22:52:23.759-0800|INFO|glassfish3.1.2|ShoalLogger|_ThreadID=22;_ThreadName=Thread-2;|GMS1010: Leaving GMS group: st-cluster with shutdown type set to InstanceShutdown|#]

[#|2012-01-17T22:52:23.774-0800|CONFIG|glassfish3.1.2|ShoalLogger|_ThreadID=23;_ThreadName=Thread-2;|GMS1065: Completed processing outstanding master node messages for member: instance101 group: st-cluster outstandingMessages to process: 1|#]

<deleted some log messages>

[#|2012-01-17T22:52:25.453-0800|SEVERE|glassfish3.1.2|org.apache.catalina.connector.CoyoteAdapter|_ThreadID=29;_ThreadName=Thread-2;|PWC3989: An exception or error occurred in the container during the request processing
java.lang.NullPointerException
at org.shoal.adapter.store.ReplicatedBackingStore.load(ReplicatedBackingStore.java:97)
at org.glassfish.web.ha.session.management.ReplicationStore.loadFromBackingStore(ReplicationStore.java:407)
at org.glassfish.web.ha.session.management.ReplicationStore.load(ReplicationStore.java:396)
at org.apache.catalina.session.PersistentManagerBase.doSwapIn(PersistentManagerBase.java:1052)
at org.apache.catalina.session.PersistentManagerBase.swapIn(PersistentManagerBase.java:1015)
at org.glassfish.web.ha.session.management.ReplicationManagerBase.findSession(ReplicationManagerBase.java:151)
at org.apache.catalina.connector.Request.doGetSession(Request.java:2852)
at org.apache.catalina.connector.Request.getSessionInternal(Request.java:2777)
at org.apache.catalina.connector.Request.unlockSession(Request.java:4201)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:342)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:174)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.ja3DThread-2;|PWC3989: An exception or error occurred in the container during the request processing
java.lang.NullPointerException
at org.shoal.adapter.store.ReplicatedBackingStore.load(ReplicatedBackingStore.java:97)
at org.glassfish.web.ha.session.management.ReplicationStore.loadFromBackingStore(ReplicationStore.java:407)
at org.glassfish.web.ha.session.management.ReplicationStore.load(ReplicationStore.java:396)
at org.apache.catalina.session.PersistentManagerBase.doSwapIn(PersistentManagerBase.java:1052)
at org.apache.catalina.session.PersistentManagerBase.swapIn(PersistentManagerBase.java:1015)
at org.glassfish.web.ha.session.management.ReplicationManagerBase.findSession(ReplicationManagerBase.java:151)
at org.apache.catalina.connector.Request.doGetSession(Request.java:2852)
at org.apache.catalina.connector.Request.getSessionInternal(Request.java:2777)
at org.apache.catalina.connector.Request.unlockSession(Request.java:4201)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:342)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter
Bug tracking, issue tracking and project management software powered by Atlassian JIRA (v4.0.2#472) | Report a problem | Request a feature | Contact administrators

Comment by Joe Fialli [ 30/Jan/12 ]

The NPE in shoal cache in this bug report duplicates GLASSFISH-18268.
The NPE is happening AFTER the instance is shutdown.

[#|2012-01-17T22:52:23.747-0800|INFO|glassfish3.1.2|javax.enterprise.system.tools.admin.com.sun.enterprise.v3.admin.cluster|_ThreadID=22;_ThreadName=Thread-2;|Server shutdown initiated|#]

[#|2012-01-17T22:52:23.752-0800|INFO|glassfish3.1.2|javax.org.glassfish.gms.org.glassfish.gms|_ThreadID=22;_ThreadName=Thread-2;|GMSAD1008: GMSAdapter for member: instance101 group: st-cluster received GlassfishEventType: prepare_shutdown|#]

[#|2012-01-17T22:52:23.757-0800|INFO|glassfish3.1.2|ShoalLogger|_ThreadID=22;_ThreadName=Thread-2;|GMS1096: member: instance101 is leaving group: st-cluster|#]

[#|2012-01-17T22:52:23.759-0800|INFO|glassfish3.1.2|ShoalLogger|_ThreadID=22;_ThreadName=Thread-2;|GMS1010: Leaving GMS group: st-cluster with shutdown type set to InstanceShutdown|#]

[#|2012-01-17T22:52:23.774-0800|CONFIG|glassfish3.1.2|ShoalLogger|_ThreadID=23;_ThreadName=Thread-2;|GMS1065: Completed processing outstanding master node messages for member: instance101 group: st-cluster outstandingMessages to process: 1|#]

[#|2012-01-17T22:52:25.453-0800|SEVERE|glassfish3.1.2|org.apache.catalina.connector.CoyoteAdapter|_ThreadID=29;_ThreadName=Thread-2;|PWC3989: An exception or error occurred in the container during the request processing
java.lang.NullPointerException
at org.shoal.adapter.store.ReplicatedBackingStore.load(ReplicatedBackingStore.java:97)

Comment by sonymanuel [ 31/Jan/12 ]

To clarify NPE is reported as a separate bug 18268. It has not connection with this particular issue.

Test scenario is as follows :

1. Deploy app.
2. Start http traffic (75 new requests per sec)
3. After 5 minutes, stop a cluster instance (asadmin stop-instance)

  • This shows the NPE in server logs (18268)
    4. After 5 minutes, start instance. During the instance start there is traffic loss (this issue). LB probably detects http port is up and starts forwarding traffic. But the application loading is not complete.
    5. After startup is complete test runs fine for few hours.
Comment by Joe Fialli [ 31/Jan/12 ]

this bug is concerning the http traffic loss.
The NPE in shoal cache is occurring after the server instance is being shutdown.
This issue is already reported as GF-18268 and has nothing to do with the traffic loss.
The instance is already shutdown when the NPE is occurring (as described in 18268).

The NPE is 2 seconds after server shutdown was initiated. This is exactly what GLASSFISH-18268 in the server.log attached to this issue.

To summarize, see that server shutdown is initiated (probably by asdmin stop-instance) and
then the NPE happens 2 seconds later.

#|2012-01-17T22:52:23.747-0800|INFO|glassfish3.1.2|javax.enterprise.system.tools.admin.com.sun.enterprise.v3.admin.cluster|_ThreadID=22;_ThreadName=Thread-2;|
Server shutdown initiated|#]

[#|2012-01-17T22:52:23.752-0800|INFO|glassfish3.1.2|javax.org.glassfish.gms.org.glassfish.gms|_ThreadID=22;_ThreadName=Thread-2;|GMSAD1008: GMSAdapter for member: instance101 group: st-cluster received GlassfishEventType: prepare_shutdown|#]

[#|2012-01-17T22:52:23.759-0800|INFO|glassfish3.1.2|ShoalLogger|_ThreadID=22;_ThreadName=Thread-2;|GMS1010: Leaving GMS group: st-cluster with shutdown type set to InstanceShutdown|#]

[#|2012-01-17T22:52:23.774-0800|CONFIG|glassfish3.1.2|ShoalLogger|_ThreadID=23;_ThreadName=Thread-2;|GMS1065: Completed processing outstanding master node messages for member: instance101 group: st-cluster outstandingMessages to process: 1|#]

[#|2012-01-17T22:52:25.453-0800|SEVERE|glassfish3.1.2|org.apache.catalina.connector.CoyoteAdapter|_ThreadID=29;_ThreadName=Thread-2;|PWC3989: An exception or error occurred in the container during the request processing
java.lang.NullPointerException
at org.shoal.adapter.store.ReplicatedBackingStore.load(ReplicatedBackingStore.java:97)

Comment by sb110099 [ 31/Jan/12 ]

Upgrading to P2 as discussed with Sony .

Comment by Shing Wai Chan [ 31/Jan/12 ]

While AppServerStartup.run, the following is called in order:
(a) GrizzlyService create a GrizzlyProxy, which creates ContainerMapper and Mapper.
(b) WebContainer.postConstruct is invoked and then calls Connector.start and the above mapper is set.
(c) WebApplication.start is called for each web application

If the request comes before (b) or (c) are done, then ContainerMapper will process the request and hence 404 in this case.

The fix should be to let (b) and (c) finish. Then the request will be handled by CoyoteAdapter. One may need a mechanism to notify that the loading is started and done.

Comment by Shing Wai Chan [ 01/Feb/12 ]

In this case, Grizzly should not process the request before (b) and (c) are completed.

Comment by Joe Di Pol [ 01/Feb/12 ]

As discussed in Bug Swat we will not stop the 3.1.2 release to fix this bug, therefore I am excluding it from the release. Note that these tests (HA stress) were not run on 3.1.1 so it is difficult to know if this is a regression or not, but engineering thinks that the same design problem exists in 3.1.1.

Comment by oleksiys [ 02/Feb/12 ]

not sure I understand why it's assigned to Grizzly...
Grizzly has no idea if any other container is going or not going to be started as part of GF startup.

Comment by Shing Wai Chan [ 02/Feb/12 ]

One can know when other containers are started in AppServerStartup.run.
The issue is in GrizzlyService (a) above. (a) has done the following:
set up mapper
(ii) creates ContainerMapper
(iii) ContainerMapper serves requests.

need to happens before (b) above.
(iii) need to happens after other containers are started.

The fix need to separate and (iii) within (a). That is why I assign the issue to Grizzly team.

Comment by Rebecca Parks [ 07/Feb/12 ]

Added to the 3.1.2 Release Notes:

Description

A traffic loss occurs when a clustered server instance is restarting. There is a time gap of a few seconds between when port 8080 is running and when application loading is complete. During this gap client requests are denied with a 404 error.

Workaround

None. The client must retry the request after application loading is complete.

Comment by oleksiys [ 11/Feb/12 ]

Should be fixed as part of GLASSFISH-18211 fix.

Comment by Tom Mueller [ 16/May/13 ]

Has this issue been resolved in 4.0?

Comment by oleksiys [ 22/May/13 ]

It hasn't. This issue and GLASSFISH-18211 have to be revisited for Glassfish v4.

Comment by oleksiys [ 30/May/13 ]

fixed

Project: glassfish
Revision: 62129
Author: oleksiys
Date: 2013-05-30 01:27:59 UTC

Log Message:
------------
+ fix issue #18267
https://java.net/jira/browse/GLASSFISH-18267

"Traffic loss during instance start between the time 8080 is up and application is loaded"

Startup AJP/JK listener only after receiving Glassfish SERVER_READY event

Comment by Gail Risdal [ 01/Jun/13 ]

The following has been added to the release notes:

Traffic loss during instance start between the time 8080 is up and application is loaded (18267)

Description
A traffic loss occurs when a clustered server instance is restarting. There is a time gap of a few seconds between when port 8080 is running and when application loading is complete. During this gap client requests are denied with a 404 error.

Workaround
None. The client must retry the request after application loading is complete.

Comment by Gail Risdal [ 01/Jun/13 ]

Actually, looks like the write-up was carried forward from the 3.1.2 Release Notes.

Comment by oleksiys [ 03/Jun/13 ]

@Gail

can we change the description a bit like:

Traffic loss during instance start between the time AJP (Apache) connector port is up and application is loaded (18267)

Description
A traffic loss occurs when a clustered server instance is restarting. There is a time gap of a few seconds between when AJP (Apache) connector port is running and when application loading is complete. During this gap client requests are denied with a 404 error.

Comment by dlaudams [ 03/Jun/13 ]

A workaround:

GlassFish will not start without an enabled listener. To get around this I add a secondary listener on a different port, disable the primary listener, restart/deploy, and then enabled the primary listener when running again.

My deployment sequence looks like this:

asadmin set server.network-config.network-listeners.network-listener.http-listener-1.enabled=false
asadmin undeploy <appname>
asadmin stop-domain domain1
asadmin start-domain domain1
asadmin deploy --name <appname> <earfile>
asadmin set server.network-config.network-listeners.network-listener.http-listener-1.enabled=true

Another benefit is that post-deployment checkout can be done against the secondary port before enabling the primary port.

Comment by Gail Risdal [ 05/Jun/13 ]

Revised the Description in the release notes write-up to now read:

A traffic loss occurs when a clustered server instance is restarting. There is a time gap of a few seconds between when the AJP (Apache) connector port is running and when application loading is complete. During this gap client requests are denied with a 404 error.

I left the title as it was because that reflects the actual title of the JIRA issue.

Comment by oleksiys [ 05/Jun/13 ]

Ok, thank you Gail!





[GLASSFISH-21043] Glassfish 4 admin gui class loading issue when built from source (as at svn revision 63170) Created: 17/Apr/14  Updated: 19/Sep/14

Status: Open
Project: glassfish
Component/s: web_container
Affects Version/s: 4.1
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Dave Whitla Assignee: Shing Wai Chan
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: Not Specified
Original Estimate: 0 minutes
Environment:

Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 23:51:28+1000)
Maven home: /opt/local/share/java/maven3
Java version: 1.7.0_55, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: utf-8
OS name: "mac os x", version: "10.9.2", arch: "x86_64", family: "mac"


Tags: admin-gui

 Description   

The default domain starts without error. Attempting to access the admin application fails with the root cause being failure to locate com.sun.webui.jsf.faces.UIComponentELResolver.
The class in question exists within $INSTALL_ROOT/lib/install/applications/__admingui/WEB-INF/extra/webui-jsf-4.0.2.10.jar and was compiled using the same JDK I am using to start the container.

Root cause:

The current source for sun-web.xml in the __admingui module contains the following:

<class-loader delegate="true"
extra-class-path="WEB-INF/extra/webui-jsf-suntheme-4.0.2.10.jar
:WEB-INF/extra/dojo-ajax-nodemo-0.4.1.jar
:WEB-INF/extra/webui-jsf-4.0.2.10.jar
:WEB-INF/extra/commons-fileupload-1.1.1.jar
:WEB-INF/extra/commons-io-1.3.1.jar
:WEB-INF/extra/json-1.0.jar
:WEB-INF/extra/prototype-1.5.0.jar" />

com.sun.enterprise.glassfish.web.WarHandler.configureLoaderAttributes() does not strip whitespace characters when splitting extra-class-path into path elements.
See com.sun.enterprise.glassfish.web.WarHandler:286 for details.

Consequently at line 310:
URL url = file.toURI().toURL();

the spaces are URL encoded as %20 before passing the string to:
cloader.addRepository(url.toString());

which then silently fails to add the jar to the classpath.
Strangely addRepository(String) converts the string back to a URL before passing it (eventually) to URLClassPath.addURL(). I don't have the source for this class but it evidently doesn't like the trailing encoded whitespace characters, because after this call returns the classpath has not changed.

A patch for the issue is attached to https://www.java.net/forum/topic/glassfish/glassfish/glassfish-4-admin-console-class-loading-issue-when-built-source where the problem was first reported.



 Comments   
Comment by Dave Whitla [ 17/Apr/14 ]

When reviewing my changes to commit the fix (to my git clone) I noticed that the reformatting of sun-web.xml had actually been done automagically by my IDE (IntelliJ).
This explains the issue not affecting others.

While the conditions were thus self inflicted, I think this is still a latent bug.
The documentation does state that the extra-class-path consists of path elements separated by ':' or ';' with no explicit allowance for whitespace. However whitespace at the end of a path is perfectly valid and failure to handle it robustly is a future problem. Further, the root cause failure is silent in the shipped configuration, giving new users/developers no clue at all as to why their application fails to load.

Request that you apply the patch.

Comment by Anissa Lam [ 17/Apr/14 ]

Thanks for filing and debugging the issue.
The suspect code is in web container, I am transferring this to that team for further evaluation.
If we can't load the console, then this is very critical and we will need to upgrade this to P2 and need to be fixed for 4.0.1.

Comment by Dave Whitla [ 18/Apr/14 ]

Hi Anissa,

You may have missed that I already have a fix and that, on further analysis, this does not affect all users as first suspected - indeed it is a bit of an edge case.
I would attach my patch but I don't seem to have permissions to attach files to this bug report.

Please see the link in my original report for the patch I have created for this issue.

Comment by Anissa Lam [ 18/Apr/14 ]

Yes, looks like our comments cross each other, with 2 min. difference.
The web container team will make the decision on how to proceed with the bug.
thanks.





[GLASSFISH-20631] "IllegalStateException: Response has not been set" Created: 13/Jun/13  Updated: 19/Sep/14  Resolved: 11/Jul/13

Status: Resolved
Project: glassfish
Component/s: web_container
Affects Version/s: 4.1
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Pavel Bucek Assignee: Shing Wai Chan
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

reproducible with glassfish trunk with integrated Tyrus 1.1-SNAPSHOT (just change tyrus version in appserver/pom.xml) and deploy following app: http://anise.cz/~paja/tyrus-sample-echo-1.1-SNAPSHOT.war ; then:

open http://localhost:8080/sample-echo/ in your favorite browser
click [press me] button, two alert messages will be produced; just click "OK" twice.
check server log, it should contain something like:

[2013-06-12T13:41:46.809+0200] [glassfish 4.0] [SEVERE] [AS-WEB-CORE-00037] [javax.enterprise.web.core] [tid: _ThreadID=30 _ThreadName=http-listener-1(5)] [timeMillis: 1371037306809] [levelValue: 1000] [[
  An exception or error occurred in the container during the request processing
java.lang.IllegalStateException: Internal org.glassfish.grizzly.http.server.Response has not been set
    at org.glassfish.grizzly.http.server.Response.checkResponse(Response.java:1840)
    at org.glassfish.grizzly.http.server.Response.getStatus(Response.java:968)
    at org.apache.catalina.connector.Response.getStatus(Response.java:1070)
    at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:366)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:260)
    at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:496)
    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:175)
    at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
    at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
    at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:187)
    at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
    at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
    at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:837)
    at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
    at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
    at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
    at java.lang.Thread.run(Thread.java:722)
]] 


 Comments   
Comment by Shing Wai Chan [ 08/Jul/13 ]

I have written a simple echo WebSocket test case without issue.
But I do see the issue with the attached war. Can you send us the source of the org.glassfish.tyrus.sample.echo.EchoEndpoint

Comment by Pavel Bucek [ 09/Jul/13 ]

It is related to https://java.net/jira/browse/TYRUS-192 ..

Add session.close() call to @OnOpen method and issue should be reproducible.

Comment by Shing Wai Chan [ 11/Jul/13 ]

Sending src/main/java/org/apache/catalina/connector/Request.java
Sending src/main/java/org/apache/catalina/connector/WebConnectionImpl.java
Transmitting file data ..
Committed revision 62334.





[GLASSFISH-20402] web-naming issue of displaying exception msg Created: 24/Apr/13  Updated: 19/Sep/14  Resolved: 04/Jun/13

Status: Resolved
Project: glassfish
Component/s: web_container
Affects Version/s: 4