[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-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-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-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-13134] Allow to override javax.* packages on the web application level Created: 26/Aug/10  Updated: 23/Aug/11

Status: Open
Project: glassfish
Component/s: web_container
Affects Version/s: v3.0.1
Fix Version/s: None

Type: Improvement Priority: Critical
Reporter: Jakub Podlesak Assignee: Shing Wai Chan
Resolution: Unresolved Votes: 3
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: Linux


Attachments: Text File overrideablePackages.patch    
Issuezilla Id: 13,134

 Description   

While there is a good reason to disallow applications to override e.g. the
standard Servlet API implementation in GlassFish, it could make perfect sense
for other Java EE APIs. For instance there is already a custom tag in
sun-web.xml to allow using custom JSF API classes bundled with a web application
to override the default version bundled with GlassFish. I would like to make
this possible also for JAX-RS API, and also at the application level.

Currently, one could use the following command:
asadmin create-jvm-options
-Dcom.sun.enterprise.overrideablejavaxpackages=javax.ws.rs,javax.ws.rs.core,javax.ws.rs.ext

together with <class-loader delegate="false"> in the sun-web.xml

This, however, works only at the application server level and does not allow
control at the application level as in the JSF case. The drawbacks are obvious:
if you do not control the whole container, you are out of luck. Also to change
this just for one application, you would need to restart the whole server
and interrupt also the other running applications.

I am going to attach a patch to allow to specify a list of overriden
Java packages in the GlassFish specific web application descriptor,
sun-web.xml or glassfish-web.xml, so that the application could
configure use of it's own bundled Java packages belonging to the protected
javax.* space.

Following is an excerpt of how the web application bundling it's own
JAX-RS implementation should look like after the patch is applied:

<class-loader delegate="false">
<property name="overrideablePackages"
value="javax.ws.rs,javax.ws.rs.core,javax.ws.rs.ext"/>
</class-loader>



 Comments   
Comment by Jakub Podlesak [ 26/Aug/10 ]

Created an attachment (id=4745)
patch

Comment by survivant [ 02/Feb/11 ]

please check the Issue http://java.net/jira/browse/GLASSFISH-15741

for a sample that doesn't work.

Comment by gfuser9999 [ 23/Aug/11 ]

user comment
------------
1) This issues is for http://java.net/jira/browse/GLASSFISH-15741
is not differently related to this issue.
The testcase in http://java.net/jira/browse/GLASSFISH-15741
is due to classloading but this fix enhancement
is neccesary to provide per-webapp isolation
of Jersey and others.

2) For example with adding "-Dcom.sun.enterprise.overrideablejavaxpackages=javax.ws.rs,javax.ws.rs.core,javax.ws.rs.ext" and where the sun-web.xml have
delegate="false", the above same app will fail after
a deploy <app>, undeploy <app>, deploy <app> cycle.
and you will hit http://java.net/jira/browse/JERSEY-660

3) The reason w/o the override seems to be that the JAXRS
Single RuntimeDelegate will point to the undeployed
WebappClassLoader. And By default GF31
WebappClassLoader will clear internal references.

If the above system property exists, then it should
be working fine. In fact as the system property
is global, it is not fine grain. It seems to me
that the request to have the overridePackages in
sun-web.xml would be Good as it is the same
trick as useBundledJsf or useMyFaces switch tries
to achieve.

So +1 for this.


Note:


WebappClassLoader seem to have a coding bug:
On GF311, Line 1886->1903, the "If statement" is
wrongly done – triggering wrong condition to
clear-reference. (It also does not check loadedByThisOrChild()).





[GLASSFISH-6971] Check for <distributable/> when deploying with Availability enabled Created: 24/Dec/08  Updated: 24/Sep/12

Status: In Progress
Project: glassfish
Component/s: web_container
Affects Version/s: v2.1
Fix Version/s: not determined

Type: Improvement Priority: Critical
Reporter: Alexis MP Assignee: Rajiv Mordani
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issuezilla Id: 6,971

 Description   

I believe it doesn't make sense to deploy an application on a GlassFish cluster with availability enabled
(checkbox in web console or --availabilityenabled=true using asadmin) when the <distributable/> tag is
not present in the web.xml descriptor.

GlassFish should log the event as an explicit warning and provide feedback to the user upon deployment.



 Comments   
Comment by kumara [ 01/Sep/09 ]

Changing version from 9.1.1 to v2.1 to reflect new name/version.

Comment by Hong Zhang [ 23/Mar/11 ]

Assign to web team for initial evaluation to see if it's applicable to the current release and what we could do for it

Comment by Tom Mueller [ 06/Mar/12 ]

Bulk update to change fix version to "not determined" for all issues still open but with a fix version for a released version.





[GLASSFISH-4306] GUI needs help in placing a 'stand by' msg. Created: 28/Feb/08  Updated: 06/Mar/12

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

Type: Improvement Priority: Critical
Reporter: Anissa Lam Assignee: jluehe
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issue Links:
Dependency
blocks GLASSFISH-4305 standby msg when app is down for main... Open
Issuezilla Id: 4,306

 Description   

This is AdminConsole-015 in
http://wiki.glassfish.java.net/Wiki.jsp?page=V3AdminConsoleImprovements

Placement of a configurable (with default) "stand by" message when an
application is down for maintenance or is in the process of being re-deployed

An admin_gui enhancement is opened, and now opening this as GUI depends on web
container for this.
GUI teams need web container to provide a way for achieving this.



 Comments   
Comment by harpreet [ 04/Mar/08 ]

changing target release from 9.1.1 to v3.

Comment by jluehe [ 18/Mar/08 ]

This is a request for an enhancement, not a bug.

Comment by Tom Mueller [ 06/Mar/12 ]

Bulk update to change fix version to "not determined" for all issues still open but with a fix version for a released version.





[GLASSFISH-18222] [JRockit-intermittent] Observed 100% CPU usage & deploy taking > 5 minutes when running the Coherence HA tests Created: 19/Jan/12  Updated: 26/Mar/13

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

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

Attachments: Zip Archive coh-test-logs-1.zip     Zip Archive coh-test-logs-2.zip    
Issue Links:
Dependency
blocks GLASSFISH-18190 [JRockit] 100% CPU usage by 2 instanc... Closed
Tags: 312_qa, 3_1_2-exclude, 3_1_2-release-note-added, 3_1_2-release-notes, 3_1_2_review

 Description   

GF Build: 18
Setup: 10 instance cluster (3 machines)
Platform: OEL6
JDK: JRockit
Has this test passed before: No. This is the first time that the combination OEL6 + JRockit + CoherenceTests is being tried out.

Parent Issue: 18160. Observed with build 17. 18222 is a result of further investigation.

Following observed when running Coherence tests (specifically while deploy of the coherence enabled application is on):

  • 100% CPU usage on some machines. "top" was run manually on all the machines involved in the setup if it was observed that one of the test's deploy method was taking unusually long.
  • This was not the case with all Coherence HA tests.
  • In some Coherence HA tests when the invocation of "asadmin deploy" was observed to be taking long (> 5 minutes), some instance logs were observed to contain thread dumps, while others have coherence related exceptions.
  • Tests that hit this issue ended up failing as instances did not seem to be available to service a http request for the application in question.
  • Different instances (1 or more) were observed to be utilizing 100% of the CPU during different tests.
  • In one of the tests a lot of GMS FAILURE_EVENTs have been observed while the deploy is on. Since 100% CPU usage has been observed during the deploy, it is quite likely that GMS alive messages (don't remember the exact terminology) were getting missed.

Logs from 2 different tests have been attached:
a) The first set is that of a test that showed a number of GMS FAILURE_EVENTs. This test happened to run before the test from which the second set of logs was collected.
b) The second set of logs shows thread dumps (see log of st-cluster/instance105) and exceptions (see log of st-cluster/instance106).
Note: The setup was able to continue the tests run after stalling for a bit. The second set of logs have been attached for a test after it had already stalled the tests run for about 2 hrs. A "kill -SIGABRT pid" was done on the instances that were taking 100% CPU (instanc101 & instance104 - second set of logs). Those kill steps seem to have generated thread dumps in the logs. Instances 101 and 104 got restarted after the kill -SIGABRT.

Client logs are in the ant.output file.

  • Deploy for the first set of logs begins at 3:58:33 AM
  • Deploy for the second set of logs begins at 4:10:52 AM

The coherence cache server's logs are also available - see coherence/<machine-name>/cache-server.log.

  • There was only a single storage enable cache server running. It formed the cluster with the storage-disabled GF cache nodes
  • The cache-server.log shows indications of failed members around the time of deploy for both the test cases.

NOTE: A core dump is also available. This was obtained before and for a different test run than the 2 sets of attached test logs. A "kill -SIGABRT pid" in this case had created a core dump rather than a thread dump in the instance logs.

  • Please send us an email and we will send its location.


 Comments   
Comment by Shing Wai Chan [ 20/Jan/12 ]

I notice the following coherence related messages in the instance log files.
Per discussion with James, this is very likely due to a resource or network issue.
So, this may be a result rather a cause of 100% cpu usage.

#|2012-01-19T04:06:40.072-0800|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=25;_ThreadName=Thread-2;|2012-01-19 04:06:40.070/1652.885 Oracle Coherence GE 3.7.0.0 <Error> (thread=Termination Thread, member=n/a): Full Thread Dump

[#|2012-01-19T04:06:40.294-0800|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=25;_ThreadName=Thread-2;|2012-01-19 04:06:40.293/1653.108 Oracle Coherence GE 3.7.0.0 <Error> (thread=http-thread-pool-24849(2), member=n/a): Error while starting cluster: com.tangosol.net.RequestTimeoutException: Timeout during service start: ServiceInfo(Id=0, Name=Cluster, Type=Cluster
MemberSet=ServiceMemberSet(
OldestMember=n/a
ActualMemberSet=MemberSet(Size=9, BitSetCount=2
Member(Id=1, Timestamp=2012-01-19 03:38:42.501, Address=10.133.185.54:8088, MachineId=13878, Location=site:us.oracle.com,machine:jed-asqe-24,process:8642, Role=CoherenceServer)
Member(Id=13, Timestamp=2012-01-19 03:58:48.887, Address=10.133.185.54:8090, MachineId=13878, Location=site:us.oracle.com,machine:jed-asqe-24,process:11176)
Member(Id=14, Timestamp=2012-01-19 03:58:50.606, Address=10.133.185.54:8092, MachineId=13878, Location=site:us.oracle.com,machine:jed-asqe-24,process:9028)
Member(Id=16, Timestamp=2012-01-19 03:59:12.252, Address=10.133.185.20:8090, MachineId=13844, Location=site:us.oracle.com,machine:jed-asqe-25,process:2421)
Member(Id=17, Timestamp=2012-01-19 03:59:19.923, Address=10.133.185.20:8094, MachineId=13844, Location=site:us.oracle.com,machine:jed-asqe-25,process:2408)
Member(Id=18, Timestamp=2012-01-19 04:00:47.551, Address=10.133.185.55:8088, MachineId=13879, Location=site:us.oracle.com,machine:jed-asqe-26,process:15657)
Member(Id=19, Timestamp=2012-01-19 04:01:02.177, Address=10.133.185.55:8090, MachineId=13879, Location=site:us.oracle.com,machine:jed-asqe-26,process:15651)
Member(Id=20, Timestamp=2012-01-19 04:01:04.076, Address=10.133.185.55:8092, MachineId=13879, Location=site:us.oracle.com,machine:jed-asqe-26,process:15690)
Member(Id=21, Timestamp=2012-01-19 04:01:18.349, Address=10.133.185.55:8094, MachineId=13879, Location=site:us.oracle.com,machine:jed-asqe-26,process:15658)
)
MemberId/ServiceVersion/ServiceJoined/MemberState
1/3.7/Thu Jan 19 03:38:42 PST 2012/JOINED,
13/3.7/Thu Jan 19 03:58:48 PST 2012/JOINED,
14/3.7/Thu Jan 19 03:58:50 PST 2012/JOINED,
16/3.7/Thu Jan 19 03:59:13 PST 2012/JOINED,
17/3.7/Thu Jan 19 03:59:19 PST 2012/JOINING,
18/3.7/Thu Jan 19 04:00:47 PST 2012/JOINED,
19/3.7/Thu Jan 19 04:01:02 PST 2012/JOINED,
20/3.7/Thu Jan 19 04:01:04 PST 2012/JOINED,
21/3.7/Thu Jan 19 04:01:18 PST 2012/JOINED
)
)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onStartupTimeout(Grid.CDB:6)
at com.tangosol.coherence.component.util.daemon.queueProcessor.Service.start(Service.CDB:28)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.start(Grid.CDB:6)
at com.tangosol.coherence.component.net.Cluster.onStart(Cluster.CDB:61)
at com.tangosol.coherence.component.net.Cluster.start(Cluster.CDB:11)
at com.tangosol.coherence.component.util.SafeCluster.startCluster(SafeCluster.CDB:4)
at com.tangosol.coherence.component.util.SafeCluster.restartCluster(SafeCluster.CDB:10)
at com.tangosol.coherence.component.util.SafeCluster.ensureRunningCluster(SafeCluster.CDB:26)
at com.tangosol.coherence.component.util.SafeCluster.start(SafeCluster.CDB:2)
at com.tangosol.net.CacheFactory.ensureCluster(CacheFactory.java:427)
at com.tangosol.coherence.servlet.SessionHelper.checkEdition(SessionHelper.java:295)
at com.tangosol.coherence.servlet.SessionHelper.configure(SessionHelper.java:107)
at com.tangosol.coherence.servlet.SessionHelper.ensureSessionHelper(SessionHelper.java:482)
at com.tangosol.coherence.servlet.glassfish31.CoherenceWebSessionManager.init(CoherenceWebSessionManager.java:133)
at com.tangosol.coherence.servlet.glassfish31.CoherenceWebSessionManager.start(CoherenceWebSessionManager.java:577)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5370)
at com.sun.enterprise.web.WebModule.start(WebModule.java:503)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:917)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:901)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:735)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2010)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1661)
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:109)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:302)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
at org.glassfish.deployment.admin.InstanceDeployCommand.execute(InstanceDeployCommand.java:187)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:348)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:363)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1066)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:95)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1295)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1260)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:461)
at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:212)
at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:179)
at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:238)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:849)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:747)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1046)
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:105)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:91)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:56)
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 [ 24/Jan/12 ]

Does the same test pass in Oracle JDK?

Comment by varunrupela [ 24/Jan/12 ]

Yes. The coherence tests passed with Oracle JDK. The collected logs from that run do not contain any Thread Dumps and do not indicate delay in execution of DAS commands.

Will send a mail with the results link.

Comment by Shing Wai Chan [ 25/Jan/12 ]

Can you increase the memory for JRockit JVM? I would like to know whether the problems went away after the change.

Comment by varunrupela [ 25/Jan/12 ]

Is there an indication that memory has been an issue ?

Comment by sherryshen [ 30/Jan/12 ]

GF Build: 19
Setup: 10 instance cluster (3 machines)
Platform: OEL6
JDK: JRockit

The execution is hanging on coherence in run 10b,
jed-asqe-28 97% cpu
asqeopteron1,3 2.7% cpu

http://agni-1.us.oracle.com/JSPWiki/Wiki.jsp?page=V312HATest
Varun checked the the log on asqe-log, and found that
both the runs (10a and 10b) have Coherence related failures
due to issue 18222.

*****
[root@jed-asqe-28 coherence-http-runtime]# find . -name "ant.output" | xargs grep "30000"
./com.sun.dft.glassfish.http.failover.runtime.HttpFailoverRuntimeTest4/ant.output: [testng] INFO: The asadmin command - /space/gf-ha/glassfish3/bin/asadmin --user admin deploy --availabilityenabled=true --force=true --target st-cluster /space/gf-ha/agent-repository/glassfish-samples/clusterjsp.ear is taking longer than 300000 milliseconds.
./com.sun.dft.glassfish.http.failover.runtime.HttpFailoverRuntimeTest24/ant.output: [testng] INFO: The asadmin command - /space/gf-ha/glassfish3/bin/asadmin --user admin deploy --availabilityenabled=true --force=true --target st-cluster /space/gf-ha/agent-repository/web/runtime/SimpleSession.war is taking longer than 300000 milliseconds.
[root@jed-asqe-28 coherence-http-runtime]#
[root@jed-asqe-28 coherence-http-runtime]# find . -name "server.log" | xargs grep "Thread Dump"
./com.sun.dft.glassfish.http.failover.runtime.HttpFailoverRuntimeTest4/failoverRuntimeThroughLB/logs/st-cluster/instance101/logs/server.log:[#|2012-01-29T23:36:01.649-0800|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=24;_ThreadName=Thread-4;|2012-01-29 23:36:01.642/437.818 Oracle Coherence GE 3.7.0.0 <Error> (thread=Recovery Thread, member=n/a): Full Thread Dump
*****

http://agni-1.us.oracle.com/net/asqe-logs.us.oracle.com/export1/3.1.2/Results/build19/ha/oel6nm/all/coherence-http-runtime/com.sun.dft.glassfish.http.failover.runtime.HttpFailoverRuntimeTest4/failoverRuntimeThroughLB/logs/st-cluster/instance101/logs/server.log
http://agni-1.us.oracle.com/net/asqe-logs.us.oracle.com/export1/3.1.2/Results/build19/ha/oel6nm/all/coherence-http-runtime/com.sun.dft.glassfish.http.failover.runtime.HttpFailoverRuntimeTest4/failoverRuntimeThroughLB/logs/coherence/jed-asqe-28.us.oracle.com/cache-server.log

Comment by Shing Wai Chan [ 30/Jan/12 ]

In one of the thread dump, we notice the following:

Thread[Cluster|SERVICE_STARTING|STATE_ANNOUNCE|Member(Id=0, Timestamp=2012-01-29 23:30:08.126, Address=10.133.185.4:8090, MachineId=13828, Location=site:us.oracle.com,machine:jed-asqe-28,process:32266),5,Cluster]
com.tangosol.coherence.component.util.daemon.queueProcessor.packetProcessor.PacketPublisher.drainOverflow(PacketPublisher.CDB:0)
com.tangosol.coherence.component.util.daemon.queueProcessor.packetProcessor.PacketPublisher$InQueue.add(PacketPublisher.CDB:8)
com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.dispatchMessage(Grid.CDB:62)
com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.post(Grid.CDB:46)
com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.send(Grid.CDB:1)
com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.ClusterService.onTimerAnnouncing(ClusterService.CDB:68)
com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.ClusterService.onNotify(ClusterService.CDB:11)
com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
java.lang.Thread.run(Thread.java:662)

Comment by Joe Di Pol [ 01/Feb/12 ]

Current thinking is that this may be a problem with the Coherence code on JRockit. This will not be resolved in time for 3.1.2. We should document this in the release notes as a known issue with JRockit. The work-around is to use the normal Oracle JDK.

Comment by Shing Wai Chan [ 02/Feb/12 ]

If you see the 100% cpu usage again, then please collect the following information. This will help coherence team to debug this further:

  • If this is reproducible, can we take thread dumps every few seconds?
  • Do we know which processes are using up CPU? (using top the pid and then identify what process that pid is)
  • Do we know if this is in user land or kernel? (from top)
Comment by Shing Wai Chan [ 06/Feb/12 ]

An issue is filed on Coherence as follows:
13689509: 100% CPU USAGE IN DEPLOYING COHERENCE 3.7.1 WEB APPLICATION WITH JROCKIT.

Comment by varunrupela [ 07/Feb/12 ]

We are Observing similar thread dumps and GMS related failures in the GF instance server logs with coherence 3.7.1 as well. Will work on collecting the requested frequent thread dumps and then upload the logs.

Comment by Tom Mueller [ 07/Mar/12 ]

Bulk update to set Fix Version to "not determined" for issues that had it set to a version that has already been released.





[GLASSFISH-17416] Add configurable delay to servlet container shutdown process. Created: 12/Oct/11  Updated: 07/Mar/12

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

Type: New Feature Priority: Critical
Reporter: psprague Assignee: Shing Wai Chan
Resolution: Unresolved Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The version of tomcat GlassFish's servlet container is based on doesn't allow us to configure a delay before unloading the servlets. Since the threads are set as daemon threads the JVM simply stops them. This means when we try and do a graceful shutdown (asadmin stop-domain --force=false) in-flight requests are killed before they complete.

org.apache.catalina.core.StandardWrapper

public synchronized void unload() throws ServletException {

        // Nothing to do if we have never loaded the instance
        if (!singleThreadModel && (instance == null))
            return;
        unloading = true;

        // Loaf a while if the current instance is allocated
        // (possibly more than once if non-STM)
        if (countAllocated > 0) {
            int nRetries = 0;
            while ((nRetries < 21) && (countAllocated > 0)) {
                if ((nRetries % 10) == 0) {
                    if (log.isLoggable(Level.FINE)) {
                        log.fine(sm.getString("standardWrapper.waiting",
                                              countAllocated,
                                              instance.getClass().getName()));
                    }
                }
                try {
                    Thread.sleep(100);
                } catch (InterruptedException e) {
                    // Ignore
                }
                nRetries++;
            }
        }

    ...
}

In Tomcat 6 this method has been changed to support a configurable unload delay.

I would also like to point out that the documentation for asadmin stop-domain states that --force=false waits for threads to complete; while this appears to be true for the EJB container it is not true for the servlet container.

     --force

         Specifies whether the domain is forcibly stopped immedi-
         ately.

         Possible values are as follows:

         true
             The   domain   is   forcibly   stopped   immediately
             (default).

         false
             The subcommand waits  until  all  threads  that  are
             associated  with  the domain are exited before stop-
             ping the domain.

Thanks,
Paul



 Comments   
Comment by Shing Wai Chan [ 06/Jan/12 ]

Port Tomcat change: http://svn.apache.org/viewvc?view=revision&revision=345286

Sending web-core/src/main/java/org/apache/catalina/core/StandardContext.java
Sending web-core/src/main/java/org/apache/catalina/core/StandardWrapper.java
Transmitting file data ..
Committed revision 51916.

Comment by craigwblake [ 07/Mar/12 ]

Does the commit mean that this has been resolved? If so, what release can we expect this in?

Thanks!





[GLASSFISH-18583] PrecompileJSP Option during Application deployment causes PWC6112: Failed to load or instantiate TagExtraInfo class: org. Created: 30/Mar/12  Updated: 19/Oct/12

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

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

SunOS 5.10 Generic_144489-11 i86pc i386 i86pc
Version: GlassFish Server Open Source Edition 3.1.1 (build 12)


Attachments: Zip Archive ccanet.zip    
Tags: PWC6112, PrecompileJSP, admin-gui

 Description   

PreCompileJSP Option during Application deployment causes the following error.
But gets deployes without the precompileJSP option
and also same deployment file works on Glassfish 2.1 with the precompile opion without any issues.

Error:
[#|2012-03-29T17:32:10.465-0500|INFO|glassfish3.1.1|org.glassfish.admingui|_ThreadID=28;_ThreadName=Thread-2;|Exception Occurred :Error occurred during deployment: E
xception while preparing the app : JSP Compilation Error: org.apache.jasper.JasperException: file:/opt/appsvr/glassfish/domains/domain1/applications/ccanet/ccanet_wa
r/Index.jsp(1,45) PWC6112: Failed to load or instantiate TagExtraInfo class: org.apache.struts.taglib.tiles.UseAttributeTei – file:/opt/appsvr/glassfish/domains/dom
ain1/applications/ccanet/ccanet_war/Index.jsp(1,45) PWC6112: Failed to load or instantiate TagExtraInfo class: org.apache.struts.taglib.tiles.UseAttributeTei. Please
see server.log for more details.
Exception while invoking class com.sun.enterprise.web.WebDeployer prepare method : java.lang.RuntimeException: JSP Compilation Error: org.apache.jasper.JasperExcepti
on: file:/opt/appsvr/glassfish/domains/domain1/applications/ccanet/ccanet_war/Index.jsp(1,45) PWC6112: Failed to load or instantiate TagExtraInfo class: org.apache.s
truts.taglib.tiles.UseAttributeTei – file:/opt/appsvr/glassfish/domains/domain1/applications/ccanet/ccanet_war/Index.jsp(1,45) PWC6112: Failed to load or instantiat
e TagExtraInfo class: org.apache.struts.taglib.tiles.UseAttributeTei
JSP Compilation Error: org.apache.jasper.JasperException: file:/opt/appsvr/glassfish/domains/domain1/applications/ccanet/ccanet_war/Index.jsp(1,45) PWC6112: Failed t
o load or instantiate TagExtraInfo class: org.apache.struts.taglib.tiles.UseAttributeTei – file:/opt/appsvr/glassfish/domains/domain1/applications/ccanet/ccanet_war
/Index.jsp(1,45) PWC6112: Failed to load or instantiate TagExtraInfo class: org.apache.struts.taglib.tiles.UseAttributeTei Exception while invoking class com.su
n.enterprise.web.WebDeployer prepare method : java.lang.RuntimeException: JSP Compilation Error: org.apache.jasper.JasperException: file:/opt/appsvr/glassfish/domain
s/domain1/applications/ccanet/ccanet_war/Index.jsp(1,45) PWC6112: Failed to load or instantiate TagExtraInfo class: org.apache.struts.taglib.tiles.UseAttributeTei –
file:/opt/appsvr/glassfish/domains/domain1/applications/ccanet/ccanet_war/Index.jsp(1,45) PWC6112: Failed to load or instantiate TagExtraInfo class: org.apache.stru
ts.taglib.tiles.UseAttributeTei
JSP Compilation Error: org.apache.jasper.JasperException: file:/opt/appsvr/glassfish/domains/domain1/applications/ccanet/ccanet_war/Index.jsp(1,45) PWC6112: Failed t
o load or instantiate TagExtraInfo class: org.apache.struts.taglib.tiles.UseAttributeTei – file:/opt/appsvr/glassfish/domains/domain1/applications/ccanet/ccanet_war
/Index.jsp(1,45) PWC6112: Failed to load or instantiate TagExtraInfo class: org.apache.struts.taglib.tiles.UseAttributeTei|#]
------

the index.jsp refered above:
----------------------------
< % @ taglib uri="struts-tiles" prefix="tiles" % >
<tiles:insert template="/core/corePage.jsp">
<tiles:put name="header" content="/core/jsp/layout/header.jsp"/>
<tiles:put name="topNavBar" content="/core/jsp/layout/topNavBar.jsp"/>
<tiles:put name="errorsAndMessages" content="/core/jsp/layout/errorsAndMessages.jsp"/>
<tiles:put name="mainwindow" content="/core/jsp/layout/Index.jsp"/>
</tiles:insert>



 Comments   
Comment by kchung [ 02/Apr/12 ]

When deploying without precompilejsp, I got the following error. Please fix the test case.

[#|2012-04-02T13:56:43.252-0700|SEVERE|glassfish3.1.2|javax.enterprise.system.tools.admin.org.glassfish.deployment.admin|_ThreadID=17;_ThreadName=Thread-2;|Exception while loading the app : EJB Container initialization error
java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at com.cca.core.security.info.UserProfileInfo.<clinit>(UserProfileInfo.java:59)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at com.sun.enterprise.deployment.util.TypeUtil.getMethod(TypeUtil.java:399)
at com.sun.enterprise.deployment.MethodDescriptor.getMethod(MethodDescriptor.java:287)
at org.glassfish.ejb.security.application.EJBSecurityManager.convertEJBMethodPermissions(EJBSecurityManager.java:550)
at org.glassfish.ejb.security.application.EJBSecurityManager.loadPolicyConfiguration(EJBSecurityManager.java:256)
at org.glassfish.ejb.security.application.EJBSecurityManager.initialize(EJBSecurityManager.java:317)
at org.glassfish.ejb.security.application.EJBSecurityManager.<init>(EJBSecurityManager.java:190)
at org.glassfish.ejb.security.factory.EJBSecurityManagerFactory.createManager(EJBSecurityManagerFactory.java:209)
at org.glassfish.ejb.startup.EjbApplication.loadContainers(EjbApplication.java:229)
at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:299)
at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:105)
at org.glassfish.internal.data.ModuleInfo.load(ModuleInfo.java:186)
at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.jav

Comment by Anissa Lam [ 19/Oct/12 ]

I am moving this bug to web-container as Kinman is looking at it.





[GLASSFISH-21007] HTTP Upgrade handler init called twice when access log is turned on Created: 17/Mar/14  Updated: 01/Jun/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: 3
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

Comment by xwibao [ 01/Jun/15 ]

The same happens when Single Sign-On is enabled (Configuration → server-config → Virtual Servers → server → SSO: Enabled).

What's peculiar, during the second @OnOpen invocation, CDI contexts are not activated. So if you inject any CDI beans into your @ServerEndpoint and use them in @OnOpen, you will get another exception.

Linux i586 + x86_64
JDK 1.8.0_45
GlassFish 4.1 stable
GlassFish 4.1-b14-05_21_2015

(not observed in Payara 4.1.152.1)





[GLASSFISH-20884] Does not full fit the javax.servlet.ServletContainerInitializer's functions Created: 07/Nov/13  Updated: 01/May/14

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

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


 Description   

The interface javax.servlet.ServletContainerInitializer has declared that "Implementations of this interface may be annotated with HandlesTypes, in order to receive (at their onStartup(java.util.Set>, javax.servlet.ServletContext) method) the Set of application classes that implement, extend, or have been annotated with the class types specified by the annotation. "
While, when I define an interface A as IA,an interface B as IB which extends IA,and a class C implements IB, the HandlesTypes annotation declared to receive IA classes, the onStartup method does receive the class C.



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

Can you attach a simple test case for this issue?





[GLASSFISH-10971] Ability to configure the usage of double quotes on the elements logged in to the access log Created: 11/Nov/09  Updated: 06/Mar/12

Status: Open
Project: glassfish
Component/s: web_container
Affects Version/s: v2.1
Fix Version/s: not determined

Type: Improvement Priority: Major
Reporter: imranbohoran Assignee: jluehe
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issuezilla Id: 10,971

 Description   

The HTTP access log currently has a bunch of useful information that one can
choose to be logged. However these elements are all logged with surrounding
double-quotes. This poses problems for applications needing to scan these logs
based on predefied formats.
Therefore can we;
1. Have the access logging provide a configurable property that indicates what
character should be used and the default can be kept as double quotes.
2. Or (better) simply let the format definition be driven off based on what the
user has specified for. i.e. The user would say the format of the log to be;
%client.name% [%header.Host%] [%datetime%] "%request%" %status% %response.length%
where the logging would happen as
11.23.43.111 [www.example.com] [11/Nov/2009:09:33:54 +0000] "GET
/my-app/myresource.html HTTP/1.0" 200 233

I'd vote for (2) as it gives users to configure what ever they need using the
tokens provided by GF.

A discussion thad led to this enhancement request can be found at;
http://forums.java.net/jive/message.jspa?messageID=371289#371289

Thanks!!

Cheers
– Imran



 Comments   
Comment by Tom Mueller [ 06/Mar/12 ]

Bulk update to change fix version to "not determined" for all issues still open but with a fix version for a released version.





[GLASSFISH-12065] JSP spec bug: method-signature element: no way to declare optional arguments Created: 27/May/10  Updated: 06/Mar/12

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

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

Operating System: All
Platform: All


Issuezilla Id: 12,065

 Description   

This follows from https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=731 and
https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=732 .

There are a few tag attributes in JSF 2.0 whose type is MethodExpression. These are declared in the TLD
using a <method-signature> element. For two of these attributes in JSF 2.0, we have relaxed the
argument requirements to make the argument optional. However, there is no way to declare this fact in
the TLD.

We need some way to declare arguments as optional.

I suggest we allow multiple method-signature elements within an attribute. The meaning of this is: any
of the following method signatures are allowed.

ALso, I'm quite certain jsp-spec-public.dev.java.net is NOT the correct issue tracker for this, but I'm not
certain glassfish.dev.java.net IS the right one. Any other suggestions?



 Comments   
Comment by Tom Mueller [ 06/Mar/12 ]

Bulk update to change fix version to "not determined" for all issues still open but with a fix version for a released version.





[GLASSFISH-10334] Provide more info in jasper Class-Path TldScanner warnings Created: 16/Oct/09  Updated: 06/Mar/12

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

Type: Improvement Priority: Major
Reporter: eskatos Assignee: kchung
Resolution: Unresolved Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: Linux
Platform: Linux


Issuezilla Id: 10,334

 Description   

At deployment time, if a lib jar has a Class-Path entry in it's manifest, it's
auto scanned and a warning is emmited for every jar that cannot be found.

For an example jar see truezip-6.6 on maven central :

<dependency>
<groupId>de.schlichtherle.io</groupId>
<artifactId>truezip</artifactId>
<version>6.6</version>
</dependency>

or http://repo1.maven.org/maven2/de/schlichtherle/io/truezip/6.6/truezip-6.6.jar

When deploying I get this log :

[#|2009-10-16T10:50:45.413+0200|WARNING|glassfish|org.apache.jasper.runtime.TldScanner|_ThreadID=11;_ThreadName=Thread-3;|PWC6351:
In TLD scanning, the supplied resource
file:/home/paul/opt/gf3/glassfish/domains/acme/applications/acme-ear-1.3.0-SNAPSHOT/lib/lib/lcrypto-jdk14-135.jar
does not exist
java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:114)
at java.util.jar.JarFile.<init>(JarFile.java:133)
at java.util.jar.JarFile.<init>(JarFile.java:70)
at sun.net.www.protocol.jar.URLJarFile.<init>(URLJarFile.java:72)
at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:48)
at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:68)
at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:104)
at
sun.net.www.protocol.jar.JarURLConnection.getJarFile(JarURLConnection.java:71)
at org.apache.jasper.runtime.TldScanner.scanJar(TldScanner.java:338)
at org.apache.jasper.runtime.TldScanner.scanJars(TldScanner.java:529)
at org.apache.jasper.runtime.TldScanner.scanTlds(TldScanner.java:268)
at org.apache.jasper.runtime.TldScanner.onStartup(TldScanner.java:214)
at
org.apache.catalina.core.StandardContext.callServletContainerInitializers(StandardContext.java:5372)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5283)
at com.sun.enterprise.web.WebModule.start(WebModule.java:493)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:928)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:912)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:694)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1826)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1522)
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:93)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:126)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:229)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:214)
at
com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:307)
at
com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:331)
at
com.sun.enterprise.v3.server.ApplicationLoaderService.postConstruct(ApplicationLoaderService.java:173)
at com.sun.hk2.component.AbstractWombImpl.inject(AbstractWombImpl.java:174)
at com.sun.hk2.component.ConstructorWomb$1.run(ConstructorWomb.java:91)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.hk2.component.ConstructorWomb.initialize(ConstructorWomb.java:88)
at com.sun.hk2.component.AbstractWombImpl.get(AbstractWombImpl.java:77)
at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:58)
at com.sun.hk2.component.LazyInhabitant.get(LazyInhabitant.java:107)
at
com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:60)
at com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.java:243)
at
com.sun.enterprise.v3.server.AppServerStartup.start(AppServerStartup.java:130)
at com.sun.enterprise.module.bootstrap.Main.launch(Main.java:457)
at com.sun.enterprise.module.bootstrap.Main.launch(Main.java:401)
at org.jvnet.hk2.osgiadapter.HK2Main.start(HK2Main.java:121)
at
org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:667)
at org.apache.felix.framework.Felix.activateBundle(Felix.java:1699)
at org.apache.felix.framework.Felix.startBundle(Felix.java:1621)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:890)
at org.jvnet.hk2.osgimain.Main.start(Main.java:124)
at
org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:667)
at org.apache.felix.framework.Felix.activateBundle(Felix.java:1699)
at org.apache.felix.framework.Felix.startBundle(Felix.java:1621)
at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1076)
at org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
at java.lang.Thread.run(Thread.java:619)

#]

This enhancement is simply about providing the problematic jar name/path in the
logs so we don't have to hunt the incriminated jar. This would be very handy
when your application has several dependencies.

This may be a Jasper issues but as I see this behavior with glassfish first,
here is the enhancement issue.



 Comments   
Comment by Hong Zhang [ 16/Oct/09 ]

assign to web as this is from web code

Comment by jluehe [ 22/Oct/09 ]

...

Comment by ymajoros [ 18/Mar/11 ]

it's not Jasper specific, I have it for a lot of libraries and it isn't always easy to solve without more information...

Comment by orair [ 16/Dec/11 ]

I think this problem annoying too.
In my case, I use Jackrabbit. Jackrabbit has a derby dependency and the MANIFEST of derby is wrong.
This warning generates a lot of unnecessary stacktrace (the supplied resource file:/dados/glassfish3/glassfish/domains/domain1/applications/EconoInfo-OCONSI-EAR-0.1.1-SNAPSHOT/lib/derbyLocale_cs.jar does not exist) and I cannot solve the issue because it is a third party library dependence.
Would be great if the stacktraces were not showed...

Comment by Tom Mueller [ 06/Mar/12 ]

Bulk update to change fix version to "not determined" for all issues still open but with a fix version for a released version.





[GLASSFISH-10891] [rfc 66] Hybrid web app's bundle-activator should run in web app's context Created: 08/Nov/09  Updated: 06/Mar/12

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

Type: Improvement Priority: Major
Reporter: Sanjeeb Sahoo Assignee: Sanjeeb Sahoo
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issuezilla Id: 10,891

 Description   

Bundle-Activator of a hybrid web app should run in webapp's context.



 Comments   
Comment by Tom Mueller [ 06/Mar/12 ]

Bulk update to change fix version to "not determined" for all issues still open but with a fix version for a released version.





[GLASSFISH-11697] subdomain wildcard support Created: 17/Mar/10  Updated: 06/Mar/12

Status: Open
Project: glassfish
Component/s: web_container
Affects Version/s: 9.0pe
Fix Version/s: not determined

Type: Improvement Priority: Major
Reporter: pradyut Assignee: jluehe
Resolution: Unresolved Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issuezilla Id: 11,697

 Description   

Hi

I want to set up a virtual server for subdomain

my domain is redirected from
pradyut.dyndns.org

to pradyut.dyndns.org/WebApplicationSecurity

using a virtual server whose default web module is
WebApplicationSecurity
I have used the string "$

{com.sun.aas.hostName}

,pradyut.dyndns.org"
in the hosts of the virtual server

now to the question
if someone enters "newa.pradyut.dyndns.org"
how can i redirect to

pradyut.dyndns.org/WebApplicationSecurity/newa

or "*.pradyut.dyndns.org"
redirects to pradyut.dyndns.org/WebApplicationSecurity/*

Thanks
Pradyut



 Comments   
Comment by Tom Mueller [ 06/Mar/12 ]

Bulk update to change fix version to "not determined" for all issues still open but with a fix version for a released version.





[GLASSFISH-6676] Need a clearer error message when there are dataSource issues from JSTL Created: 31/Oct/08  Updated: 06/Mar/12

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

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

Operating System: All
Platform: All


Issuezilla Id: 6,676
Status Whiteboard:

v3_exclude

Tags: 3_1-exclude

 Description   

We need a clearer error message when the dataSource specified in a JSTL sql tag
is not available.

if i do not put the resource-ref in sun-web.xml of
<resource-ref>
<res-ref-name>jdbc/mysqlTestDB</res-ref-name>
<jndi-name>jdbc/mysqlTestDB</jndi-name>
</resource-ref>

I get the following error (which makes sense) using JSTL tag of

<sql:query var="resultSet" dataSource="jdbc/mysqlTestDB" >
select * from contacts
</sql:query>

javax.servlet.ServletException: javax.servlet.jsp.JspException: Unable to get
connection, DataSource invalid: "java.sql.SQLException: No suitable driver found
for jdbc/mysqlTestDB"

The problem with the message is the issue is not with the JDBC driver, it is
with looking up the dataSource.

The error message should try to be more specific.



 Comments   
Comment by jluehe [ 31/Oct/08 ]

...

Comment by kchung [ 27/Oct/09 ]

To be fixed after v3

Comment by kumara [ 07/Dec/09 ]

Setting target release for unresolved issues submitted on v3 release to the next release. Not changing
issues submitted on v2.x release because they might not apply to v3.next release.

Comment by kchung [ 07/Oct/10 ]

Currently, there is no plans for JSTL development.

Comment by Tom Mueller [ 06/Mar/12 ]

Bulk update to change fix version to "not determined" for all issues still open but with a fix version for a released version.





[GLASSFISH-5413] Add support for disabling default-virtual-server Created: 31/Jul/08  Updated: 08/Dec/10

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

Type: Improvement Priority: Major
Reporter: jluehe Assignee: Justin Lee
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: Sun


Issuezilla Id: 5,413
Status Whiteboard:

v3_exclude


 Description   

Add support for disabling default-virtual-server, by setting its value to the
empty string (since default-virtual-server is mandatory according to the DTD
that governs domain.xml). Another option would be to change the DTD to declare
this attribute as OPTIONAL.

See http://forums.java.net/jive/thread.jspa?messageID=288450 for use case that
has motivated this.



 Comments   
Comment by jluehe [ 31/Jul/08 ]

..

Comment by jluehe [ 06/Oct/08 ]

...

Comment by Justin Lee [ 08/Oct/08 ]

accepting

Comment by Justin Lee [ 29/Apr/09 ]

hrm. is this still a problem since there is no more DTD enforcing this?

Comment by Justin Lee [ 05/May/09 ]

...

Comment by Justin Lee [ 25/Jun/09 ]

I think this can be closed, yes? Bueller?

Comment by Justin Lee [ 06/Oct/09 ]

no one seems to be terribly interested in this at the moment and it's a
big(gish) change from what investigation i've done. bumping to 3.1.





[GLASSFISH-7149] 1st access to resources in jars in web apps is slow Created: 05/Feb/09  Updated: 06/Mar/12

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

Type: Improvement Priority: Major
Reporter: Dies Koper Assignee: jluehe
Resolution: Unresolved Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issuezilla Id: 7,149

 Description   

When including a jar with resources in a web app's WEB-INF/lib, at the
moment a resource is first accessed from the application the jar's
contents is extracted into the generated directory.

This means that when there are many resources in a jar, there is a long
delay when accessing the first resource. This is also noticeable when
accessing the admin console each time after starting the domain.

Jan answered to my question about it in the dev ML:

--------------------------------
GlassFish inherited this behaviour from Tomcat.
The motivation for it is summarized in this Tomcat FAQ entry:

I want to redeploy web applications, how do I prevent resources from
getting locked?

Most locking issues will occur with JARs from /WEB-INF/lib, and are
useally caused by access through URLs. Tomcat has mechanisms to allow
avoiding locking. In Tomcat 5.0, a mechanism exists to prevent locking
when accessing resources using the getResource method of the URL
classloader (many applications, such as Xerces, do not set the use of
caching to false before opening the URL connection, causing
locking). If such a call occurs, resources inside the JARs will be
extracted to the work directory of the web application. In Tomcat 5.5,
this mechanism is disabled by default (as it has a non negligible
influence on startup times, and is often useless), and can be enabled
using the antiJARLocking attribute of the Context element.

GlassFish still enables antiJARLocking by default, and currently does
not provide any way of turning it off.

We should definitely support a way of turning antiJARLocking off
(and might want to consider turning it off by default), by honoring
the antiJARLocking attribute in Tomcat's context.xml, and adding a
similar property to sun-web.xml.
--------------------------------



 Comments   
Comment by Dies Koper [ 17/Nov/09 ]

Adding my comment to Jan at the time:
(I suspect the reason the Admin Console is now not packaged as a war anymore
because of this slow-down. I suppose fixing this issue would allow the Admin
Console or any other similar application to have reasonable performance even
packaged as a war/ear).

I do think a better solution is to do what the EJBClassLoader does, instead of
just disabling antiJARLocking.

What EJBClassLoader does in its getResource (findResource0 really) and
getResourceAsStream methods is, it wraps the stream to a resource with a special
stream class (SentinelInputStream) that has a close method. When an application
is redeployed, the container calls a method in the EJBClassLoader that will
close all streams of the resources explicitly.

This is much more reliable than waiting for the gc to kick in. It also solves
the problem of the URL connection's caching not disabled by the user application.

I don't think making antiJARLocking user configurable is the way to go,
especially when it is possible to solve the problem completely.

Comment by Tom Mueller [ 06/Mar/12 ]

Bulk update to change fix version to "not determined" for all issues still open but with a fix version for a released version.





[GLASSFISH-3813] Deployment of web app directories without editing domain.xml Created: 26/Oct/07  Updated: 06/Mar/12

Status: Open
Project: glassfish
Component/s: web_container
Affects Version/s: 9.1pe
Fix Version/s: not determined

Type: Improvement Priority: Major
Reporter: jess_holle Assignee: Shing Wai Chan
Resolution: Unresolved 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,813

 Description   

Tomcat has now long had the ability to deploy deploy web application directories
without editing server.xml. [By deploy I don't mean copy the web app files, but
rather just enable the web app in the servlet engine using the existing
directory.] Similarly it would be very useful for Glassfish to support this
ability without editing domain.xml.

In Tomcat this is done through a context.xml file just one like that which
Glassfish supports/uses from docroot/META-INF except:

  • The file is named webAppName.xml [only required in later Tomcats]
  • The <context> element must have path and docBase attributes to specify the
    context path and docbase directory of the web app, respectively.

This file is just placed in a specified location in Tomcat and the web app is
loaded automatically shortly thereafter.

This capability has a number of advantages.

First, it is very easy to create this simple XML file in a specified location as
compared to properly inserting into domain.xml.

More importantly, however, it allows one to easily deploy the same web app
directory multiple times, i.e. under different context paths and with different
deployment parameters. For instance, I have a simple web app that is designed
to address a database instance. In Tomcat I create multiple context.xml files
with unique context paths and unique DBCP parameters specifying various database
instances. In Glassfish I currently cannot do this as context.xml always
resides in docroot/META-INF, so I can only have one per docbase.



 Comments   
Comment by Hong Zhang [ 06/Nov/07 ]

Just want to let you know similar things were planned/implemented for v3. For v3
developer profile, the application will not be registered in the central
domain.xml and there will be a separate property file for each deployed
application.

Comment by Hong Zhang [ 08/Nov/07 ]

look in v3.

Comment by Hong Zhang [ 21/Jan/11 ]

I think we already have partial support of context.xml in glassfish, but not sure if this scenario is part of it. Assign to web team to follow up.

Comment by Tom Mueller [ 06/Mar/12 ]

Bulk update to change fix version to "not determined" for all issues still open but with a fix version for a released version.





[GLASSFISH-3468] Application Libraries - Specify in Sun DD Created: 06/Aug/07  Updated: 06/Mar/12

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

Type: Improvement Priority: Major
Reporter: danielrhoades Assignee: jluehe
Resolution: Unresolved Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: Linux


Issuezilla Id: 3,468

 Description   

The --libraries or "Libraries" field in asadmin can be used to specify
additional runtime library dependancies for applications.

Currently there is no way to add this information to the Sun DD, this prevents
applications depending on libraries being autodeployed and makes rapid
development in IDEs like Netbeans slower as the package has to be manually
deployed after each development iteration.

See forum thread for more information:

http://forums.java.net/jive/thread.jspa?messageID=229456



 Comments   
Comment by Hong Zhang [ 06/Aug/07 ]

Assign to Jan as web team owns the sun-web-app dd contents. The deployment team
will make the relevant deployment changes when this work starts.

Comment by Hong Zhang [ 06/Aug/07 ]

add myself to Cc

Comment by jfarcand [ 18/Feb/08 ]

Re-assign to myself.

Comment by jfarcand [ 02/Sep/08 ]

Re-assign to Jan to see what he thinks. It should be simple for us to implement
such support, except it will require a change to sun-web DTD....

Comment by Tom Mueller [ 06/Mar/12 ]

Bulk update to change fix version to "not determined" for all issues still open but with a fix version for a released version.





[GLASSFISH-1742] Request for spec change - Support a user based connection pool Created: 13/Dec/06  Updated: 06/Mar/12

Status: Open
Project: glassfish
Component/s: web_container
Affects Version/s: 9.0pe
Fix Version/s: not determined

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

Operating System: All
Platform: Macintosh


Issuezilla Id: 1,742

 Description   

This is an issue reported to Jakarta Taglibs. As the email address is bouncing
(jsr-52-comments@jcp.org), I thought that reporting it to the RefImpl would be
the best bet.

Here's the original issue (now closed):

https://issues.apache.org/bugzilla/show_bug.cgi?id=34315



 Comments   
Comment by bayard [ 13/Dec/06 ]

Enhancement

Comment by jfarcand [ 18/Feb/08 ]

Kin-Man

Comment by Tom Mueller [ 06/Mar/12 ]

Bulk update to change fix version to "not determined" for all issues still open but with a fix version for a released version.





[GLASSFISH-1744] Request for spec change - Enable escaping of tags in format:message Created: 13/Dec/06  Updated: 06/Mar/12

Status: Open
Project: glassfish
Component/s: web_container
Affects Version/s: 9.0pe
Fix Version/s: not determined

Type: Improvement Priority: Major
Reporter: bayard Assignee: kchung
Resolution: Unresolved Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: Macintosh


Issuezilla Id: 1,744

 Description   

This is an issue reported to Jakarta Taglibs. As the email address is bouncing
(jsr-52-comments@jcp.org), I thought that reporting it to the RefImpl would be
the best bet.

Here's the original issue (now closed):

https://issues.apache.org/bugzilla/show_bug.cgi?id=39431



 Comments   
Comment by jfarcand [ 18/Feb/08 ]

Re-assign to Kin-Man

Comment by Tom Mueller [ 06/Mar/12 ]

Bulk update to change fix version to "not determined" for all issues still open but with a fix version for a released version.





[GLASSFISH-1743] Request for spec change - Encode 'c:param's in 'c:url's. Created: 13/Dec/06  Updated: 06/Mar/12

Status: Open
Project: glassfish
Component/s: web_container
Affects Version/s: 9.0pe
Fix Version/s: not determined

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

Operating System: All
Platform: Macintosh


Issuezilla Id: 1,743

 Description   

This is an issue reported to Jakarta Taglibs. As the email address is bouncing
(jsr-52-comments@jcp.org), I thought that reporting it to the RefImpl would be
the best bet.

Here's the original issue (now closed):

https://issues.apache.org/bugzilla/show_bug.cgi?id=23319

Further thoughts on my part:

Reading the spec, it does state for c:url that:

"If the URL contains characters that should be encoded (e.g. space), it is the
user's responsibility to encode them. "

c:param on the other hand says:

"Moreover, it has been designed such that the attributes name and value are
automatically URL encoded. "

The two sections seem to contradict each other.



 Comments   
Comment by bayard [ 13/Dec/06 ]

I'm getting my url encoding and xml escaping muddled. Ignore my quotes from the
spec. The issue requests that xml escaping be handled better - not url encoding.

Comment by bayard [ 13/Dec/06 ]

Enhancement

Comment by jfarcand [ 18/Feb/08 ]

Comment by Tom Mueller [ 06/Mar/12 ]

Bulk update to change fix version to "not determined" for all issues still open but with a fix version for a released version.





[GLASSFISH-1740] Request for spec change - Allow c:forEach step to be -ve Created: 13/Dec/06  Updated: 06/Mar/12

Status: Open
Project: glassfish
Component/s: web_container
Affects Version/s: 9.0pe
Fix Version/s: not determined

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

Operating System: All
Platform: Macintosh


Issuezilla Id: 1,740

 Description   

This is an issue reported to Jakarta Taglibs. As the email address is bouncing
(jsr-52-comments@jcp.org), I thought that reporting it to the RefImpl would be
the best bet.

Here's the original issue (now closed):

https://issues.apache.org/bugzilla/show_bug.cgi?id=31047



 Comments   
Comment by bayard [ 13/Dec/06 ]

Enhancement

Comment by jfarcand [ 18/Feb/08 ]

Re-assign to Kin-Man to see what he thinks for v3.

Comment by Tom Mueller [ 06/Mar/12 ]

Bulk update to change fix version to "not determined" for all issues still open but with a fix version for a released version.





[GLASSFISH-1741] Request for spec change - Allow c:forEach begin to be -ve Created: 13/Dec/06  Updated: 06/Mar/12

Status: Open
Project: glassfish
Component/s: web_container
Affects Version/s: 9.0pe
Fix Version/s: not determined

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

Operating System: All
Platform: Macintosh


Issuezilla Id: 1,741

 Description   

This is an issue reported to Jakarta Taglibs. As the email address is bouncing
(jsr-52-comments@jcp.org), I thought that reporting it to the RefImpl would be
the best bet.

Here's the original issue (now closed):

https://issues.apache.org/bugzilla/show_bug.cgi?id=31103

I imagine 'end' would want to allow negative too if this were changed in the spec.



 Comments   
Comment by bayard [ 13/Dec/06 ]

Enhancement

Comment by jfarcand [ 18/Feb/08 ]

Re0-assign to Kin-Man for v3.

Comment by Tom Mueller [ 06/Mar/12 ]

Bulk update to change fix version to "not determined" for all issues still open but with a fix version for a released version.





[GLASSFISH-1608] Add Line-specific Error Reporting for Deferred Expressions Created: 29/Nov/06  Updated: 06/Mar/12

Status: Open
Project: glassfish
Component/s: web_container
Affects Version/s: 9.0pe
Fix Version/s: not determined

Type: Improvement Priority: Major
Reporter: jhook Assignee: kchung
Resolution: Unresolved 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,608

 Description   

It'd be a good feature to transfer from Tomcat 6 to Glassfish Jasper around
wrapping generated Value/MethodExpressions with line-specific error reporting,
here's an example from JSF:

org.apache.jasper.JasperException: /customerInfo.jsp(157,0) Cannot
coerce value (creditCardConverter) to type
(javax.faces.convert.Converter) for attribute converter.

Code Example:
http://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk/java/org/apache/jasper/el/JspValueExpression.java



 Comments   
Comment by jluehe [ 29/Nov/06 ]

-> Kin-Man

Comment by Tom Mueller [ 06/Mar/12 ]

Bulk update to change fix version to "not determined" for all issues still open but with a fix version for a released version.





[GLASSFISH-4731] Different root context for the same app Created: 10/Apr/08  Updated: 06/Mar/12

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

Type: New Feature Priority: Major
Reporter: arungupta Assignee: vivekp
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: Macintosh


Issuezilla Id: 4,731

 Description   

I've created a Rails app and added WEB-INF/sun-web.xml directory with the
contents as:

– cut here –
<sun-web-app error-url="">
<context-root>/ruby_comet</context-root>
<class-loader delegate="true"/>
– cut here –

If the app is deployed then the following message is shown:

INFO: Loading application ttt_ruby at /ttt_ruby

However if I restart the server (w/o re-deploying the app) then the following
message is shown:

INFO: Loading application ttt_ruby at /ruby_comet

The same app is getting loaded in different root context. And indeed this is
verified by accessing the URL as well.

Tried this with Preview 2, b08.



 Comments   
Comment by jluehe [ 10/Apr/08 ]

Taking ownership

Comment by jluehe [ 10/Apr/08 ]

Arun, this is working as expected for me with a fresh build off the trunk, i.e.,
the webapp is deployed to, and accessible at, the context-root specified in its
sun-web.xml at its initial deployment. I've deployed using "asadmin", not the V3
plugin.

Please reopen if you continue to have this problem with a later build.

Comment by jluehe [ 10/Apr/08 ]

Reopening issue, and also adding email thread to it:

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Arun Gupta wrote:

Hmm, I'm still seing an error with hudson #3238 (4:41pm today). Here is the
message shown during app deployment...

Apr 10, 2008 5:50:52 PM com.sun.enterprise.rails.RailsDeployer registerAdapter
INFO: Loading application ttt_ruby at /ttt_ruby
Apr 10, 2008 5:50:52 PM
INFO: Starting Rails instances
Apr 10, 2008 5:50:59 PM
SEVERE: JRuby limited openssl loaded. gem install jruby-openssl for full support.
http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL
Apr 10, 2008 5:51:00 PM com.sun.grizzly.jruby.RubyObjectPool$1 run
INFO: Rails instance instantiation took : 8174ms
Apr 10, 2008 5:51:00 PM com.sun.enterprise.web.WebApplication start
INFO: Loading application ttt_ruby at /ruby_comet
Apr 10, 2008 5:51:00 PM com.sun.enterprise.v3.deployment.DeployCommand execute
INFO: Deployment of ttt_ruby done is 9858 ms

This is correctly deployed at ttt_ruby & ruby_comet. And the message shown when
server is restarted ...

Apr 10, 2008 5:51:50 PM com.sun.enterprise.rails.RailsDeployer registerAdapter
INFO: Loading application ttt_ruby at /ruby_comet
Apr 10, 2008 5:51:50 PM
INFO: Starting Rails instances
Apr 10, 2008 5:51:56 PM
SEVERE: JRuby limited openssl loaded. gem install jruby-openssl for full support.
http://wiki.jruby.org/wiki/JRuby_Builtin_OpenSSL
Apr 10, 2008 5:51:57 PM com.sun.grizzly.jruby.RubyObjectPool$1 run
INFO: Rails instance instantiation took : 6813ms
Apr 10, 2008 5:51:57 PM com.sun.enterprise.web.WebApplication start
INFO: Loading application ttt_ruby at /ruby_comet
Apr 10, 2008 5:51:57 PM
com.sun.enterprise.v3.services.impl.ApplicationLoaderService processApplication
INFO: Loading ttt_ruby Application done is 8653 ms

Here both are deployed at ruby_comet. I'll try a more recent build later tonight.

-Arun

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Jan Luehe wrote:

OK, from your original bug report, it wasn't clear which aspect of the
deployment you were complaining about:

>If the app is deployed then the following message is shown:
>INFO: Loading application ttt_ruby at /ttt_ruby

when in fact there are 2 deployments involved: one rails related:

INFO: Loading application ttt_ruby at /ttt_ruby

and the other one web related:

INFO: Loading application ttt_ruby at /ruby_comet

Are you saying that after a server restart, you would have expected
the rails deployment to continue to load at /ttt_ruby, but it suddenly
started honoring the context-root from sun-web.xml and deployed at
/ruby_comet?

When I marked the bug as WORKSFORME, I only considered the web
deployment aspect (since I was deploying a WAR), which works as
expected, i.e., the context-root from sun-web.xml is being honored.

So this looks like a problem with the RailsDeployer?

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Vivek Pandey wrote:

Although, what surprises me is the fact that the first time deployment goes thru
fine. It is re-deployment that causes not work. Is it possible that somewhere in
grizzly or v3, the logic to invoke a specific deployer is such that it is not
giving chance to RailsDeployer once it is identified as web app?

I will need to look at it to see what is going on.

Comment by jluehe [ 10/Apr/08 ]

Assigning to Vivek, as per previous discussion

Comment by vivekp [ 23/Jun/08 ]

On further investigation it appears that it really ends up being the case when
we are talking about composite application deployment - ruby_comet being a
servlet applciation which is co-bundled with the rails application.

Either at grizzly level this can be taken care in terms of passing on the
request to the servlet app or could be something else. It needs more
investigation and since we dont have concept of composite applciation worked
out, I am changing it from defect and marking as enhancement.

Comment by Tom Mueller [ 06/Mar/12 ]

Bulk change to set fix version to "not determined" where the issue is open but the value is for a released version.





[GLASSFISH-4589] Add support for session tracking via SSL session id Created: 02/Apr/08  Updated: 06/Mar/12

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

Type: New Feature Priority: Major
Reporter: jluehe Assignee: jluehe
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: Sun


Issuezilla Id: 4,589

 Description   

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



 Comments   
Comment by jluehe [ 26/Aug/08 ]

This is a new feature, and not the enhancement of an existing one.

Comment by jluehe [ 07/Apr/10 ]

Joe (java.net id "infosun") posted this interesting comment to the above froum
thread:

<comment>
Jan Luehe described a possible solution in his Blog "GlassFish Support for
Cookie-less HTTP Sessions"
http://blogs.sun.com/jluehe/date/200712

follow the example and replace his invoke method with the following code.

@Override
public int invoke(Request request, Response response) throws IOException,
ServletException
{
CoyoteRequest coyoReq = (CoyoteRequest) request;
coyoReq.getAttribute(Globals.CERTIFICATES_ATTR); // call
populateSSLAttributes();
String cid =
(String)coyoReq.getAttribute("javax.servlet.request.ssl_session");
if(cid != null)

{ coyoReq.setRequestedSessionId(cid); }

return INVOKE_NEXT;
}

works for me under Glassfish v2ur2.

Joe
</comment>

This should continue to work with GF v3.

All that's left to do would be to install this special-purpose valve (that is,
add it to the application's pipeline) for any application that had SSL
configured as its session tracking mode.

Comment by Tom Mueller [ 06/Mar/12 ]

Bulk update to change fix version to "not determined" for all issues still open but with a fix version for a released version.





[GLASSFISH-4007] support valves as first class object: asadmin command, configuration Created: 16/Jan/08  Updated: 21/Jan/11

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

Type: Improvement Priority: Major
Reporter: writtmeyer Assignee: Shing Wai Chan
Resolution: Unresolved Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: Linux


Issue Links:
Duplicate
is duplicated by GLASSFISH-4006 Add more flexible configuration possi... Resolved
Issuezilla Id: 4,007

 Description   

Right now it is possible to add valves to visual-server elements as well as to
web-module elements using properties. E.g.:
asadmin set
server.http-service.virtual-server.server.property.valve_1=org.apache.catalina.valves.RequestDumperValve

But it is not possible to configure them appropriately - especially to set
properties of the valves themselves.

For the current situation see Jeanfrancois Arcand's blog:
http://weblogs.java.net/blog/jfarcand/archive/2006/09/extending_glass.html

It is highly desirable to be able to do s.th. more Valve-specific - to get an
explicit command line command for valves.

A possible syntax could be s.th. like the following:

asadmin create-valve --class x.y.SomeValve --parent-type
(virtual-server|web-module) --parent /parent/ --target /target/ /valve_name/

--class is obviously the class of the Valve to create.
--parent-type would be either virtual-server or web-module since these are the
only places a Valve can be added to (see Jeanfrancois' post above).
--parent would denote the id for virtual-servers or the name for web-modules
--target would be domain, server or cluster_name

For more about this see the thread on the developer mailing list starting with
the following post:
https://glassfish.dev.java.net/servlets/ReadMsg?list=dev&msgNo=5244



 Comments   
Comment by writtmeyer [ 16/Jan/08 ]

I've selected the wrong issue type for this RFE at the beginning. Sorry!

Comment by writtmeyer [ 16/Jan/08 ]

I've posted a related issue for necessary changes in the domain.xml:

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

Comment by janey [ 26/Jan/10 ]

reassign to kedar

Comment by writtmeyer [ 27/Jan/10 ]

I am not sure whether this is relevant for asadmin as well, but Valve and
ValveNode have been enhanced in working on this RFE:

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

At least parts of these enhancements might help with this issue.

Comment by Tom Mueller [ 21/Jan/11 ]

The blog entry referred to in the description is now here:
http://jfarcand.wordpress.com/2006/09/08/extending-glassfishs-webcontainer/

Please evaluate this issue to see if it should be closed, included in 3.2, or deferred to a future release.

Comment by Tom Mueller [ 21/Jan/11 ]

Issue 4006 talks about adding configuration data in the domain.xml file for valves. I'm combined that one into this one and closing issue 4006 as a duplicate.

Please consider the implementation of valve-specific data in the domain.xml along with commands for managing valves when evaluation this bug.





[GLASSFISH-2616] "VariableResolver in PageContext is not used by JSTL core tags" Created: 14/Mar/07  Updated: 06/Mar/12

Status: Open
Project: glassfish
Component/s: web_container
Affects Version/s: 9.0pe
Fix Version/s: not determined

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

Operating System: All
Platform: Macintosh


Issuezilla Id: 2,616

 Description   

Another Jakarta Taglibs issue. This one is a request/query concerning
VariableResolver being extendable. Rather than try to fix this in the Standard
Taglib, I'm passing it on to you guys for inclusion in a newer ref implementation.

The (now closed) issue url is:

https://issues.apache.org/bugzilla/show_bug.cgi?id=39438



 Comments   
Comment by jluehe [ 08/Jan/08 ]

Asking Kin-Man to take a look.

Comment by Tom Mueller [ 06/Mar/12 ]

Bulk update to change fix version to "not determined" for all issues still open but with a fix version for a released version.





[GLASSFISH-2615] "JstlCoreTLV is too strict in its requirements" Created: 14/Mar/07  Updated: 06/Mar/12

Status: Open
Project: glassfish
Component/s: web_container
Affects Version/s: 9.0pe
Fix Version/s: not determined

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

Operating System: All
Platform: Macintosh


Issuezilla Id: 2,615

 Description   

This is an issue reported to Jakarta Taglibs asking that the JSTLCoreTLV be
relaxed to allow people to use the param tag in their own tag implementations.
As Jakarta Taglibs 1.1.x is a maintenance branch, I'm avoiding making this
change but thought it might be of value here.

The (now closed) issue url is:

https://issues.apache.org/bugzilla/show_bug.cgi?id=39719



 Comments   
Comment by jluehe [ 08/Jan/08 ]

Asking Kin-Man to take a look.

Comment by Tom Mueller [ 06/Mar/12 ]

Bulk update to change fix version to "not determined" for all issues still open but with a fix version for a released version.





[GLASSFISH-1250] Core ELResolvers (MapELResolver, ListELResolver) should make better use of available generic type info Created: 03/Oct/06  Updated: 06/Mar/12

Status: Open
Project: glassfish
Component/s: web_container
Affects Version/s: 9.1pe
Fix Version/s: not determined

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

Operating System: All
Platform: All
URL: http://fisheye5.cenqua.com/viewrep/glassfish/servlet-api/src/jsr245/src/share/javax/el


Attachments: Text File servlet-api.patch     Zip Archive servlet-api.zip    
Issuezilla Id: 1,250

 Description   

The existing ELResolvers within "servlet-api/src/jsr245/src/share/javax/el"
make no use of generic type information in the "getType()"
and "getCommonPropertyType()" methods, even in those instances where it is
actually available. In particular, the ListELResolver and MapELResolver assume
that the list or map is the raw type only, and so return "Object.class" as the
value type. When setting a value, this can cause class cast exceptions (if
checked collections are being used), or worse, it will violate the intended
type constraints of the collection.
If the correct type is returned, then the value can be correctly converted by
the caller first.

While isolated instances of the generified collection classes do not retain the
type information at runtime, there are at least two significant instances where
the generic type IS actually available.

(1) The runtime class of the base object itself extends or implements the
generic collection interface or class. Eg:
class MyDateList extends java.util.ArrayList<java.util.Date> {
...
}
In this case the concrete type information is available via
the "getGenericSuperclass()" or "getGenericInterfaces()" methods of the class.

(2) The base object has just be resolved from a bean property as part of an
overall EL expression. For example:
class MyBean {
java.util.Map<String,java.util.Date> getLocalDate()

{ ... }

}
Then assume a managed bean "abean" of type "MyBean", and an expression like "#

{abean.localDate.au}

". In this case, the type info for the map is available
via "getGenericReturnType()" on the reader method.

To make use of (1) requires only a change to the List and Map resolvers
themselves, and should be quite simple.
To make use of (2) would require a change to the BeanELResolver as well as the
List and Map resolvers.
One way I can think of is to have the BeanELResolver add a "typemap" to the
ELContext (via the "ELContext.putContext()" method).
Whenever "BeanELResolver.getValue()" is about to return a value whose type is
a "ParameterizedType", that type is added to the "typemap" using the value as
the key. Then if the "typemap" is present, the List or Map resolver can lookup
the correct type for the "base" object.

I think (2) is probably the more common use case, so it is probably worth the
extra effort. I can put together a change bundle for this, but would welcome
any feedback first.



 Comments   
Comment by jluehe [ 04/Oct/06 ]

-> Kin-Man

Comment by tony_robertson [ 04/Oct/06 ]

Created an attachment (id=489)
Preliminary version of patch for suggest fix

Comment by tony_robertson [ 04/Oct/06 ]

Created an attachment (id=490)
new source file for patch

Comment by tony_robertson [ 04/Oct/06 ]

Attached is a preliminary version of a suggested fix
(currently has a few extra logger calls that will need culling).
Basically to demonstrate the viability of the approach and allow
some testing.

Comment by Tom Mueller [ 06/Mar/12 ]

Bulk update to change fix version to "not determined" for all issues still open but with a fix version for a released version.





[GLASSFISH-17787] provide an asadmin command that secures a deployed Java EE archive Created: 21/Nov/11  Updated: 01/Feb/13

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

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


 Description   

Currently, it is possible to make an artifact that doesn't require authentication and then change it to require authentication... It is not even a hard thing to do... but it sure is tedious.

And it requires a developer/deployer to alter the archive... which opens up the possibility that they will make a mistake as they go through the process of doing the conversion.

It would be nice to have a single command that would alter a deployed artifact to use authentication, without forcing the user to explode their app, edit files, rebuild the archive and redeploy.

The command may do all those things (behind the scenes).



 Comments   
Comment by Hong Zhang [ 10/Oct/12 ]

Reassign to web team to see if it makes sense to implement something like this.

Comment by Shing Wai Chan [ 01/Feb/13 ]

In order to a secure a web application with authentication, one need to have the following:
a) auth-method (associated login pages, etc if necessary)
b) realm name
c) security-constraint
d) security-role mapping

We have default for a) and b) in GlassFish.
For c) and d), we need to wait for http://java.net/jira/browse/SERVLET_SPEC-34, where one can define a constraint for a valid authenticated users without roles.

Comment by vince kraemer [ 01/Feb/13 ]

one thing to note... I guess this would apply to any Java EE artifact that is deployed and has the ability to be secured... it does not have to be just for web apps

Comment by vince kraemer [ 01/Feb/13 ]

extended the goal of the improvement to all deployable, securable Java EE artifacts.





[GLASSFISH-17046] Deployment with precompile of jsp of a portable J2EE 6 EAR on a cluster using admin interface doesn't work Created: 14/Jul/11  Updated: 21/Oct/11

Status: Open
Project: glassfish
Component/s: web_container
Affects Version/s: 3.1, 3.1.1_b11
Fix Version/s: None

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

Windows XP
Java 1.6.0_24
J2EE 6.0 portable and distributable EAR application (no dependancy injection)
Note that the EAR has all referenced JARs on manifests as required for portable applications.


Attachments: Zip Archive CSIPortal-J2EE6.zip    
Tags: 3_1-next, 3_1_1-scrubbed, 3_1_2-exclude

 Description   

By testing Glassfish 3.1 (b48) and Glassfish 3.1.1 (b11) I found that the deployment with precompile option doesn't work as expected.

I tried two different packaging:
1) providing utility JARs under EAR/lib
2) providing all utility JARs references on META-INF/MANIFEST.mf for all interested modules.
In both cases the deployment raises the following error that is asserting the JSP cannot resolve many class libraries that are actually visible and correctly packaged in the EAR.

The same packaged EARs are correctly deployed with Netbeans 7.0 in a GF 3.1 (developer profile)

ERROR RAISED:
Error occurred during deployment: Exception while preparing the app : JSP Compilation Error: org.apache.jasper.JasperException: PWC6033: Error in Javac compilation for JSP PWC6199: Generated servlet error: string:///download_jsp.java:8: package com.portal.util does not exist PWC6199: Generated servlet error: string:///download_jsp.java:9: package com.portal.util does not exist PWC6199: Generated servlet error: string:///download_jsp.java:12: package com.contshipitalia.broker does not exist PWC6199: Generated servlet error: string:///download_jsp.java:13: package com.contshipitalia.persistence does not exist PWC6199: Generated servlet error: string:///download_jsp.java:14: package com.contshipitalia.persistence does not exist PWC6199: Generated servlet error: string:///download_jsp.java:15: package com.contshipitalia.util does not exist PWC6199: Generated servlet error: string:///download_jsp.java:16: package com.contshipitalia.net does not exist PWC6197: An error occurred at li .... msg.seeServerLog

Using GF 3.1.1 errors are thousand and I do not list them here but I just can say the deployment is completely corrupted in this version using the admin GUI.
I had no time to test the asadmin command-line yet.

Using GF 3.1 I tried a deployement always using the asadmin GUI but without precompile option and I found that the EAR is deployed with no errors apparently.
Anyway the Application it doesn't work as I obtain always HTTP 404 when a jsp or servlet is requested.
The 404 is raised because pages are searched in the docroot location which is empty after deployment:

[#|2011-07-14T10:53:34.500+0200|SEVERE|glassfish3.1|org.apache.jasper.servlet.JspServlet|_ThreadID=23;_ThreadName=Thread-1;|PWC6117: File "D%3A%5Cglassfish3%5Cglassfish%5Cnodes%5Clocalhost-domain1%5Cinstance1%5Cdocroot%5Cnews%5Clatest_news.jsp" not found|#]

By inspecting the GF directories I found that under /domain1/applications/... the EAR has been deployed, and docroot is empty.
A request to a jsp or servlet do not trigger its compilation bacause it is not resolved under /docroot.

It is not clear the role of /docroot that should be optional (see when static pages in the root are installed on a web server)



 Comments   
Comment by cistox [ 14/Jul/11 ]

Please read

Glassfish 3.1 (b48)

as

Glassfish 3.1 (b43)

Comment by Anissa Lam [ 14/Jul/11 ]

>> I had no time to test the asadmin command-line yet.
It will be nice if you can try this using CLI.
It is just one single command:
%asadmin deploy --precompilejsp=true myApplication.war

If you can attach the application, that will definitely help too.

I have double checked that when user checks the "Precompile JSP" checkbox, console passes in "precompilejsp" as "true".
I am going to assign to "deployment" for evaluation.

Comment by cistox [ 15/Jul/11 ]

I tried the deployment using the command-line.

I provided the EAR separately as attachment.

These are the details:

D:\glassfish3\bin>asadmin deploy --precompilejsp=true --target CSIPortal-cluster
CSIPortal-J2EE6.ear
remote failure: Unknown plain text format. A properly formatted response from a
PlainTextActionReporter
always starts with one of these 2 strings: PlainTextActionReporterSUCCESS or Pla
inTextActionReporterFAILURE. The response we received from the server was not u
nderstood: Signature-Version: 1.0
message: Error occurred during deployment: Exception while preparing t
he app : JSP Compilation Error: org.apache.jasper.JasperException: PW
C6033: Error in Javac compilation for JSP

PWC6199: G
enerated servlet error:
string:///download_jsp.java:8: packag
e com.portal.util does not exist

PWC6199: Generated
servlet error:
string:///download_jsp.java:9: package com.por
tal.util does not exist

PWC6199: Generated servlet e
rror:
string:///download_jsp.java:12: package com.contshipita
lia.broker does not exist

PWC6199: Generated servlet
error:
string:///download_jsp.java:13: package com.contshipi
talia.persistence does not exist

PWC6199: Generated
servlet error:
string:///download_jsp.java:14: package com.co
ntshipitalia.persistence does not exist

PWC6199: Gen
erated servlet error:
string:///download_jsp.java:15: package
com.contshipitalia.util does not exist

PWC6199: Gen
erated servlet error:
string:///download_jsp.java:16: package
com.contshipitalia.net does not exist

PWC6197: An e
rror occurred at line: 13 in the jsp file: /resources/download.jsp%%%
EOL%%%PWC6199: Generated servlet error:
string:///download_js
p.java:21: cannot find symbol
symbol : class GenericServiceB
roker
location: class org.apache.jsp.resources.download_jsp%%
%EOL%%%
PWC6197: An error occurred at line: 13 in the jsp fil
e: /resources/download.jsp
PWC6199: Generated servlet error:%
%%EOL%%%string:///download_jsp.java:21: cannot find symbol
sy
mbol : class GenericServiceBroker
location: class org.apache
.jsp.resources.download_jsp

PWC6197: An error occurr
ed at line: 13 in the jsp file: /resources/download.jsp
PWC61
99: Generated servlet error:
string:///download_jsp.java:58:
package com.contshipitalia.net does not exist

PWC619
7: An error occurred at line: 13 in the jsp file: /resources/download
.jsp
PWC6199: Generated servlet error:
string:///down
load_jsp.java:60: package com.contshipitalia.net does not exist%%%EOL
%%%
PWC6197: An error occurred at line: 13 in the jsp file: /
resources/download.jsp
PWC6199: Generated servlet error:%%%EO
L%%%string:///download_jsp.java:63: package com.contshipitalia.net do
es not exist

PWC6197: An error occurred at line: 14
in the jsp file: /resources/download.jsp
PWC6199: Generated s
ervlet error:
string:///download_jsp.java:76: cannot find sym
bol
symbol : variable Form
location: class org.apach
e.jsp.resources.download_jsp

PWC6197: An error occur
red at line: 14 in the jsp file: /resources/download.jsp
PWC6
199: Generated servlet error:
string:///download_jsp.java:89:
cannot find symbol
symbol : class Download
location
: class org.apache.jsp.resources.download_jsp

PWC619
7: An error occurred at line: 14 in the jsp file: /resources/download
.jsp
PWC6199: Generated servlet error:
string:///down
load_jsp.java:95: cannot find symbol
symbol : variable Form%
%%EOL%%%location: class org.apache.jsp.resources.download_jsp%%%EOL%%
%
PWC6197: An error occurred at line: 14 in the jsp file: /re
sources/download.jsp
PWC6199: Generated servlet error:%%%EOL%
%%string:///download_jsp.java:101: cannot find symbol
symbol
: variable Environment
location: class org.apache.jsp.resour
ces.download_jsp

PWC6197: An error occurred at line:
14 in the jsp file: /resources/download.jsp
PWC6199: Generat
ed servlet error:
string:///download_jsp.java:109: cannot fin
d symbol
symbol : class GenericData
location: class
org.apache.jsp.resources.download_jsp

PWC6197: An er
ror occurred at line: 14 in the jsp file: /resources/download.jsp%%%E
OL%%%PWC6199: Generated servlet error:
string:///download_jsp
.java:136: cannot find symbol
symbol : class Download%%%EOL%
%%location: class org.apache.jsp.resources.download_jsp
%%%EO
L%%%PWC6197: An error occurred at line: 14 in the jsp file: /resource
s/download.jsp
PWC6199: Generated servlet error:
stri
ng:///download_jsp.java:165: cannot find symbol
symbol : cla
ss Download
location: class org.apache.jsp.resources.download
_jsp

PWC6197: An error occurred at line: 14 in the j
sp file: /resources/download.jsp
PWC6199: Generated servlet e
rror:
string:///download_jsp.java:167: cannot find symbol%%%E
OL%%%symbol : class Download
location: class org.apache.jsp.
resources.download_jsp

PWC6197: An error occurred at
line: 14 in the jsp file: /resources/download.jsp
PWC6199: G
enerated servlet error:
string:///download_jsp.java:184: cann
ot find symbol
symbol : class Download
location: cla
ss org.apache.jsp.resources.download_jsp

PWC6197: An
error occurred at line: 14 in the jsp file: /resources/download.jsp%
%%EOL%%%PWC6199: Generated servlet error:
string:///download_
jsp.java:205: cannot find symbol
symbol : class Download%%%E
OL%%%location: class org.apache.jsp.resources.download_jsp
%%
%EOL%%%PWC6197: An error occurred at line: 14 in the jsp file: /resou
rces/download.jsp
PWC6199: Generated servlet error:
s
tring:///download_jsp.java:218: cannot find symbol
symbol :
class StringInputStream
location: class org.apache.jsp.resour
ces.download_jsp

PWC6197: An error occurred at line:
14 in the jsp file: /resources/download.jsp
PWC6199: Generat
ed servlet error:
string:///download_jsp.java:243: cannot fin
d symbol
symbol : variable JMail
location: class org
.apache.jsp.resources.download_jsp

PWC6197: An error
occurred at line: 14 in the jsp file: /resources/download.jsp%%%EOL%
%%PWC6199: Generated servlet error:
string:///download_jsp.ja
va:247: cannot find symbol
symbol : variable JMail
l
ocation: class org.apache.jsp.resources.download_jsp
%%%EOL%%
% – PWC6033: Error in Javac compilation for JSP

PWC
6199: Generated servlet error:
string:///download_jsp.java:8:
package com.portal.util does not exist

PWC6199: Gen
erated servlet error:
string:///download_jsp.java:9: package
com.portal.util does not exist

PWC6199: Generated se
rvlet error:
string:///download_jsp.java:12: package com.cont
shipitalia.broker does not exist

PWC6199: Generated
servlet error:
string:///download_jsp.java:13: package com.co
ntshipitalia.persistence does not exist

PWC6199: Gen
erated servlet error:
string:///download_jsp.java:14: package
com.contshipitalia.persistence does not exist

PWC61
99: Generated servlet error:
string:///download_jsp.java:15:
package com.contshipitalia.util does not exist

PWC61
99: Generated servlet error:
string:///download_jsp.java:16:
package com.contshipitalia.net does not exist

PWC619
7: An error occurred at line: 13 in the jsp file: /resources/download
.jsp
PWC6199: Generated servlet error:
string:///down
load_jsp.java:21: cannot find symbol
symbol : class GenericS
erviceBroker
location: class org.apache.jsp.resources.downloa
d_jsp

PWC6197: An error occurred at line: 13 in the
jsp file: /resources/download.jsp
PWC6199: Generated servlet
error:
string:///download_jsp.java:21: cannot find symbol%%%E
OL%%%symbol : class GenericServiceBroker
location: class org
.apache.jsp.resources.download_jsp

PWC6197: An error
occurred at line: 13 in the jsp file: /resources/download.jsp%%%EOL%
%%PWC6199: Generated servlet error:
string:///download_jsp.ja
va:58: package com.contshipitalia.net does not exist
%%%EOL%%
%PWC6197: An error occurred at line: 13 in the jsp file: /resources/d
ownload.jsp
PWC6199: Generated servlet error:
string:
///download_jsp.java:60: package com.contshipitalia.net does not exis
t

PWC6197: An error occurred at line: 13 in the jsp
file: /resources/download.jsp
PWC6199: Generated servlet erro
r:
string:///download_jsp.java:63: package com.contshipitalia
.net does not exist

PWC6197: An error occurred at li
ne: 14 in the jsp file: /resources/download.jsp
PWC6199: Gene
rated servlet error:
string:///download_jsp.java:76: cannot f
ind symbol
symbol : variable Form
location: class or
g.apache.jsp.resources.download_jsp

PWC6197: An erro
r occurred at line: 14 in the jsp file: /resources/download.jsp%%%EOL
%%%PWC6199: Generated servlet error:
string:///download_jsp.j
ava:89: cannot find symbol
symbol : class Download
l
ocation: class org.apache.jsp.resources.download_jsp
%%%EOL%%
%PWC6197: An error occurred at line: 14 in the jsp file: /resources/d
ownload.jsp
PWC6199: Generated servlet error:
string:
///download_jsp.java:95: cannot find symbol
symbol : variabl
e Form
location: class org.apache.jsp.resources.download_jsp%
%%EOL%%%
PWC6197: An error occurred at line: 14 in the jsp fi
le: /resources/download.jsp
PWC6199: Generated servlet error:

string:///download_jsp.java:101: cannot find symbol

symbol : variable Environment
location: class org.apache.jsp
.resources.download_jsp

PWC6197: An error occurred a
t line: 14 in the jsp file: /resources/download.jsp
PWC6199:
Generated servlet error:
string:///download_jsp.java:109: can
not find symbol
symbol : class GenericData
location:
class org.apache.jsp.resources.download_jsp

PWC6197
: An error occurred at line: 14 in the jsp file: /resources/download.
jsp
PWC6199: Generated servlet error:
string:///downl
oad_jsp.java:136: cannot find symbol
symbol : class Download

location: class org.apache.jsp.resources.download_jsp%%%EOL%
%%
PWC6197: An error occurred at line: 14 in the jsp file: /r
esources/download.jsp
PWC6199: Generated servlet error:%%%EOL
%%%string:///download_jsp.java:165: cannot find symbol
symbol
: class Download
location: class org.apache.jsp.resources.d
ownload_jsp

PWC6197: An error occurred at line: 14 i
n the jsp file: /resources/download.jsp
PWC6199: Generated se
rvlet error:
string:///download_jsp.java:167: cannot find sym
bol
symbol : class Download
location: class org.apac
he.jsp.resources.download_jsp

PWC6197: An error occu
rred at line: 14 in the jsp file: /resources/download.jsp
PWC
6199: Generated servlet error:
string:///download_jsp.java:18
4: cannot find symbol
symbol : class Download
locati
on: class org.apache.jsp.resources.download_jsp

PWC6
197: An error occurred at line: 14 in the jsp file: /resources/downlo
ad.jsp
PWC6199: Generated servlet error:
string:///do
wnload_jsp.java:205: cannot find symbol
symbol : class Downl
oad
location: class org.apache.jsp.resources.download_jsp%%%E
OL%%%
PWC6197: An error occurred at line: 14 in the jsp file:
/resources/download.jsp
PWC6199: Generated servlet error:%%%
EOL%%%string:///download_jsp.java:218: cannot find symbol
sym
bol : class StringInputStream
location: class org.apache.jsp
.resources.download_jsp

PWC6197: An error occurred a
t line: 14 in the jsp file: /resources/download.jsp
PWC6199:
Generated servlet error:
string:///download_jsp.java:243: can
not find symbol
symbol : variable JMail
location: cl
ass org.apache.jsp.resources.download_jsp

PWC6197: A
n error occurred at line: 14 in the jsp file: /resources/download.jsp

PWC6199: Generated servlet error:
string:///download
_jsp.java:247: cannot find symbol
symbol : variable JMail%%%
EOL%%%location: class org.apache.jsp.resources.download_jsp
%
%%EOL%%%. Please see server.log for more details.
Exception w
hile invoking class com.sun.enterprise.web.WebDeployer prepare method
: java.lang.RuntimeException: JSP Compilation Error: org.apache.jasp
er.JasperException: PWC6033: Error in Javac compilation for JSP%%%EOL
%%%
PWC6199: Generated servlet error:
string:///downl
oad_jsp.java:8: package com.portal.util does not exist
%%%EOL
%%%PWC6199: Generated servlet error:
string:///download_jsp.j
ava:9: package com.portal.util does not exist

PWC619
9: Generated servlet error:
string:///download_jsp.java:12: p
ackage com.contshipitalia.broker does not exist

PWC6
199: Generated servlet error:
string:///download_jsp.java:13:
package com.contshipitalia.persistence does not exist
%%%EOL
%%%PWC6199: Generated servlet error:
string:///download_jsp.j
ava:14: package com.contshipitalia.persistence does not exist%%%EOL%%
%
PWC6199: Generated servlet error:
string:///downloa
d_jsp.java:15: package com.contshipitalia.util does not exist%%%EOL%%
%
PWC6199: Generated servlet error:
string:///downloa
d_jsp.java:16: package com.contshipitalia.net does not exist

PWC6197: An error occurred at line: 13 in the jsp file: /res
ources/download.jsp
PWC6199: Generated servlet error:%%%EOL%%
%string:///download_jsp.java:21: cannot find symbol
symbol :
class GenericServiceBroker
location: class org.apache.jsp.re
sources.download_jsp

PWC6197: An error occurred at l
ine: 13 in the jsp file: /resources/download.jsp
PWC6199: Gen
erated servlet error:
string:///download_jsp.java:21: cannot
find symbol
symbol : class GenericServiceBroker
loca
tion: class org.apache.jsp.resources.download_jsp

PW
C6197: An error occurred at line: 13 in the jsp file: /resources/down
load.jsp
PWC6199: Generated servlet error:
string:///
download_jsp.java:58: package com.contshipitalia.net does not exist%%
%EOL%%%
PWC6197: An error occurred at line: 13 in the jsp fil
e: /resources/download.jsp
PWC6199: Generated servlet error:%
%%EOL%%%string:///download_jsp.java:60: package com.contshipitalia.ne
t does not exist

PWC6197: An error occurred at line:
13 in the jsp file: /resources/download.jsp
PWC6199: Generat
ed servlet error:
string:///download_jsp.java:63: package com
.contshipitalia.net does not exist

PWC6197: An error
occurred at line: 14 in the jsp file: /resources/download.jsp%%%EOL%
%%PWC6199: Generated servlet error:
string:///download_jsp.ja
va:76: cannot find symbol
symbol : variable Form
loc
ation: class org.apache.jsp.resources.download_jsp

P
WC6197: An error occurred at line: 14 in the jsp file: /resources/dow
nload.jsp
PWC6199: Generated servlet error:
string://
/download_jsp.java:89: cannot find symbol
symbol : class Dow
nload
location: class org.apache.jsp.resources.download_jsp%%
%EOL%%%
PWC6197: An error occurred at line: 14 in the jsp fil
e: /resources/download.jsp
PWC6199: Generated servlet error:%
%%EOL%%%string:///download_jsp.java:95: cannot find symbol
sy
mbol : variable Form
location: class org.apache.jsp.resource
s.download_jsp

PWC6197: An error occurred at line: 1
4 in the jsp file: /resources/download.jsp
PWC6199: Generated
servlet error:
string:///download_jsp.java:101: cannot find
symbol
symbol : variable Environment
location: class
org.apache.jsp.resources.download_jsp

PWC6197: An e
rror occurred at line: 14 in the jsp file: /resources/download.jsp%%%
EOL%%%PWC6199: Generated servlet error:
string:///download_js
p.java:109: cannot find symbol
symbol : class GenericData%%%
EOL%%%location: class org.apache.jsp.resources.download_jsp
%
%%EOL%%%PWC6197: An error occurred at line: 14 in the jsp file: /reso
urces/download.jsp
PWC6199: Generated servlet error:

string:///download_jsp.java:136: cannot find symbol
symbol :
class Download
location: class org.apache.jsp.resources.down
load_jsp

PWC6197: An error occurred at line: 14 in t
he jsp file: /resources/download.jsp
PWC6199: Generated servl
et error:
string:///download_jsp.java:165: cannot find symbol

symbol : class Download
location: class org.apache.
jsp.resources.download_jsp

PWC6197: An error occurre
d at line: 14 in the jsp file: /resources/download.jsp
PWC619
9: Generated servlet error:
string:///download_jsp.java:167:
cannot find symbol
symbol : class Download
location:
class org.apache.jsp.resources.download_jsp

PWC6197
: An error occurred at line: 14 in the jsp file: /resources/download.
jsp
PWC6199: Generated servlet error:
string:///downl
oad_jsp.java:184: cannot find symbol
symbol : class Download

location: class org.apache.jsp.resources.download_jsp%%%EOL%
%%
PWC6197: An error occurred at line: 14 in the jsp file: /r
esources/download.jsp
PWC6199: Generated servlet error:%%%EOL
%%%string:///download_jsp.java:205: cannot find symbol
symbol
: class Download
location: class org.apache.jsp.resources.d
ownload_jsp

PWC6197: An error occurred at line: 14 i
n the jsp file: /resources/download.jsp
PWC6199: Generated se
rvlet error:
string:///download_jsp.java:218: cannot find sym
bol
symbol : class StringInputStream
location: class
org.apache.jsp.resources.download_jsp

PWC6197: An e
rror occurred at line: 14 in the jsp file: /resources/download.jsp%%%
EOL%%%PWC6199: Generated servlet error:
string:///download_js
p.java:243: cannot find symbol
symbol : variable JMail%%%EOL
%%%location: class org.apache.jsp.resources.download_jsp
%%%E
OL%%%PWC6197: An error occurred at line: 14 in the jsp file: /resourc
es/download.jsp
PWC6199: Generated servlet error:
str
ing:///download_jsp.java:247: cannot find symbol
symbol : va
riable JMail
location: class org.apache.jsp.resources.downloa
d_jsp

– PWC6033: Error in Javac compilation for JS
P

PWC6199: Generated servlet error:
string:/
//download_jsp.java:8: package com.portal.util does not exist%%%EOL%%
%
PWC6199: Generated servlet error:
string:///downloa
d_jsp.java:9: package com.portal.util does not exist
%%%EOL%%
%PWC6199: Generated servlet error:
string:///download_jsp.jav
a:12: package com.contshipitalia.broker does not exist
%%%EOL
%%%PWC6199: Generated servlet error:
string:///download_jsp.j
ava:13: package com.contshipitalia.persistence does not exist%%%EOL%%
%
PWC6199: Generated servlet error:
string:///downloa
d_jsp.java:14: package com.contshipitalia.persistence does not exist%
%%EOL%%%
PWC6199: Generated servlet error:
string:///
download_jsp.java:15: package com.contshipitalia.util does not exist%
%%EOL%%%
PWC6199: Generated servlet error:
string:///
download_jsp.java:16: package com.contshipitalia.net does not exist%%
%EOL%%%
PWC6197: An error occurred at line: 13 in the jsp fil
e: /resources/download.jsp
PWC6199: Generated servlet error:%
%%EOL%%%string:///download_jsp.java:21: cannot find symbol
sy
mbol : class GenericServiceBroker
location: class org.apache
.jsp.resources.download_jsp

PWC6197: An error occurr
ed at line: 13 in the jsp file: /resources/download.jsp
PWC61
99: Generated servlet error:
string:///download_jsp.java:21:
cannot find symbol
symbol : class GenericServiceBroker%%%EOL
%%%location: class org.apache.jsp.resources.download_jsp
%%%E
OL%%%PWC6197: An error occurred at line: 13 in the jsp file: /resourc
es/download.jsp
PWC6199: Generated servlet error:
str
ing:///download_jsp.java:58: package com.contshipitalia.net does not
exist

PWC6197: An error occurred at line: 13 in the
jsp file: /resources/download.jsp
PWC6199: Generated servlet
error:
string:///download_jsp.java:60: package com.contshipit
alia.net does not exist

PWC6197: An error occurred a
t line: 13 in the jsp file: /resources/download.jsp
PWC6199:
Generated servlet error:
string:///download_jsp.java:63: pack
age com.contshipitalia.net does not exist

PWC6197: A
n error occurred at line: 14 in the jsp file: /resources/download.jsp

PWC6199: Generated servlet error:
string:///download
_jsp.java:76: cannot find symbol
symbol : variable Form%%%EO
L%%%location: class org.apache.jsp.resources.download_jsp
%%%
EOL%%%PWC6197: An error occurred at line: 14 in the jsp file: /resour
ces/download.jsp
PWC6199: Generated servlet error:
st
ring:///download_jsp.java:89: cannot find symbol
symbol : cl
ass Download
location: class org.apache.jsp.resources.downloa
d_jsp

PWC6197: An error occurred at line: 14 in the
jsp file: /resources/download.jsp
PWC6199: Generated servlet
error:
string:///download_jsp.java:95: cannot find symbol%%%E
OL%%%symbol : variable Form
location: class org.apache.jsp.r
esources.download_jsp

PWC6197: An error occurred at
line: 14 in the jsp file: /resources/download.jsp
PWC6199: Ge
nerated servlet error:
string:///download_jsp.java:101: canno
t find symbol
symbol : variable Environment
location
: class org.apache.jsp.resources.download_jsp

PWC619
7: An error occurred at line: 14 in the jsp file: /resources/download
.jsp
PWC6199: Generated servlet error:
string:///down
load_jsp.java:109: cannot find symbol
symbol : class Generic
Data
location: class org.apache.jsp.resources.download_jsp%%%
EOL%%%
PWC6197: An error occurred at line: 14 in the jsp file
: /resources/download.jsp
PWC6199: Generated servlet error:%%
%EOL%%%string:///download_jsp.java:136: cannot find symbol
sy
mbol : class Download
location: class org.apache.jsp.resourc
es.download_jsp

PWC6197: An error occurred at line:
14 in the jsp file: /resources/download.jsp
PWC6199: Generate
d servlet error:
string:///download_jsp.java:165: cannot find
symbol
symbol : class Download
location: class org.
apache.jsp.resources.download_jsp

PWC6197: An error
occurred at line: 14 in the jsp file: /resources/download.jsp%%%EOL%%
%PWC6199: Generated servlet error:
string:///download_jsp.jav
a:167: cannot find symbol
symbol : class Download
lo
cation: class org.apache.jsp.resources.download_jsp

PWC6197: An error occurred at line: 14 in the jsp file: /resources/do
wnload.jsp
PWC6199: Generated servlet error:
string:/
//download_jsp.java:184: cannot find symbol
symbol : class D
ownload
location: class org.apache.jsp.resources.download_jsp

PWC6197: An error occurred at line: 14 in the jsp f
ile: /resources/download.jsp
PWC6199: Generated servlet error
:
string:///download_jsp.java:205: cannot find symbol%%%EOL%%
%symbol : class Download
location: class org.apache.jsp.reso
urces.download_jsp

PWC6197: An error occurred at lin
e: 14 in the jsp file: /resources/download.jsp
PWC6199: Gener
ated servlet error:
string:///download_jsp.java:218: cannot f
ind symbol
symbol : class StringInputStream
location
: class org.apache.jsp.resources.download_jsp

PWC619
7: An error occurred at line: 14 in the jsp file: /resources/download
.jsp
PWC6199: Generated servlet error:
string:///down
load_jsp.java:243: cannot find symbol
symbol : variable JMai
l
location: class org.apache.jsp.resources.download_jsp%%%EOL
%%%
PWC6197: An error occurred at line: 14 in the jsp file: /
resources/download.jsp
PWC6199: Generated servlet error:%%%EO
L%%%string:///download_jsp.java:247: cannot find symbol
symbo
l : variable JMail
location: class org.apache.jsp.resources.
download_jsp

JSP Compilation Error: org.apa
che.jasper.JasperException: PWC6033: Error in Javac compilation for J
SP

PWC6199: Generated servlet error:
string:///download_jsp.java:8:
package com.portal.util does not exist

PWC6199: Generated servlet er
ror:
string:///download_jsp.java:9: package com.portal.util does not
exist

PWC6199: Generated servlet error:
string:///download_jsp.java:
12: package com.contshipitalia.broker does not exist

PWC6199: Genera
ted servlet error:
string:///download_jsp.java:13: package com.contsh
ipitalia.persistence does not exist

PWC6199: Generated servlet error
:
string:///download_jsp.java:14: package com.contshipitalia.persiste
nce does not exist

PWC6199: Generated servlet error:
string:///downl
oad_jsp.java:15: package com.contshipitalia.util does not exist

PWC6
199: Generated servlet error:
string:///download_jsp.java:16: package
com.contshipitalia.net does not exist

PWC6197: An error occurred at
line: 13 in the jsp file: /resources/download.jsp
PWC6199: Generated
servlet error:
string:///download_jsp.java:21: cannot find symbol
sy
mbol : class GenericServiceBroker
location: class org.apache.jsp.res
ources.download_jsp

PWC6197: An error occurred at line: 13 in the js
p file: /resources/download.jsp
PWC6199: Generated servlet error:
str
ing:///download_jsp.java:21: cannot find symbol
symbol : class Gener
icServiceBroker
location: class org.apache.jsp.resources.download_jsp

PWC6197: An error occurred at line: 13 in the jsp file: /resources/
download.jsp
PWC6199: Generated servlet error:
string:///download_jsp
.java:58: package com.contshipitalia.net does not exist

PWC6197: An
error occurred at line: 13 in the jsp file: /resources/download.jsp
P
WC6199: Generated servlet error:
string:///download_jsp.java:60: pack
age com.contshipitalia.net does not exist

PWC6197: An error occurred
at line: 13 in the jsp file: /resources/download.jsp
PWC6199: Genera
ted servlet error:
string:///download_jsp.java:63: package com.contsh
ipitalia.net does not exist

PWC6197: An error occurred at line: 14 i
n the jsp file: /resources/download.jsp
PWC6199: Generated servlet er
ror:
string:///download_jsp.java:76: cannot find symbol
symbol : var
iable Form
location: class org.apache.jsp.resources.download_jsp

PWC
6197: An error occurred at line: 14 in the jsp file: /resources/downl
oad.jsp
PWC6199: Generated servlet error:
string:///download_jsp.java
:89: cannot find symbol
symbol : class Download
location: class org.
apache.jsp.resources.download_jsp

PWC6197: An error occurred at line
: 14 in the jsp file: /resources/download.jsp
PWC6199: Generated serv
let error:
string:///download_jsp.java:95: cannot find symbol
symbol
: variable Form
location: class org.apache.jsp.resources.download_js
p

PWC6197: An error occurred at line: 14 in the jsp file: /resources
/download.jsp
PWC6199: Generated servlet error:
string:///download_js
p.java:101: cannot find symbol
symbol : variable Environment
locatio
n: class org.apache.jsp.resources.download_jsp

PWC6197: An error occ
urred at line: 14 in the jsp file: /resources/download.jsp
PWC6199: G
enerated servlet error:
string:///download_jsp.java:109: cannot find
symbol
symbol : class GenericData
location: class org.apache.jsp.res
ources.download_jsp

PWC6197: An error occurred at line: 14 in the js
p file: /resources/download.jsp
PWC6199: Generated servlet error:
str
ing:///download_jsp.java:136: cannot find symbol
symbol : class Down
load
location: class org.apache.jsp.resources.download_jsp

PWC6197:
An error occurred at line: 14 in the jsp file: /resources/download.js
p
PWC6199: Generated servlet error:
string:///download_jsp.java:165:
cannot find symbol
symbol : class Download
location: class org.apach
e.jsp.resources.download_jsp

PWC6197: An error occurred at line: 14
in the jsp file: /resources/download.jsp
PWC6199: Generated servlet e
rror:
string:///download_jsp.java:167: cannot find symbol
symbol : c
lass Download
location: class org.apache.jsp.resources.download_jsp

PWC6197: An error occurred at line: 14 in the jsp file: /resources/do
wnload.jsp
PWC6199: Generated servlet error:
string:///download_jsp.j
ava:184: cannot find symbol
symbol : class Download
location: class
org.apache.jsp.resources.download_jsp

PWC6197: An error occurred at
line: 14 in the jsp file: /resources/download.jsp
PWC6199: Generated
servlet error:
string:///download_jsp.java:205: cannot find symbol
sy
mbol : class Download
location: class org.apache.jsp.resources.downl
oad_jsp

PWC6197: An error occurred at line: 14 in the jsp file: /res
ources/download.jsp
PWC6199: Generated servlet error:
string:///downl
oad_jsp.java:218: cannot find symbol
symbol : class StringInputStrea
m
location: class org.apache.jsp.resources.download_jsp

PWC6197: An
error occurred at line: 14 in the jsp file: /resources/download.jsp
P
WC6199: Generated servlet error:
string:///download_jsp.java:243: can
not find symbol
symbol : variable JMail
location: class org.apache.j
sp.resources.download_jsp

PWC6197: An error occurred at line: 14 in
the jsp file: /resources/download.jsp
PWC6199: Generated servlet erro
r:
string:///download_jsp.java:247: cannot find symbol
symbol : vari
able JMail
location: class org.apache.jsp.resources.download_jsp


PWC6033: Error in Javac compilation for JSP

PWC6199: Generated serv
let error:
string:///download_jsp.java:8: package com.portal.util doe
s not exist

PWC6199: Generated servlet error:
string:///download_jsp
.java:9: package com.portal.util does not exist

PWC6199: Generated s
ervlet error:
string:///download_jsp.java:12: package com.contshipita
lia.broker does not exist

PWC6199: Generated servlet error:
string:/
//download_jsp.java:13: package com.contshipitalia.persistence does n
ot exist

PWC6199: Generated servlet error:
string:///download_jsp.ja
va:14: package com.contshipitalia.persistence does not exist

PWC6199
: Generated servlet error:
string:///download_jsp.java:15: package co
m.contshipitalia.util does not exist

PWC6199: Generated servlet erro
r:
string:///download_jsp.java:16: package com.contshipitalia.net doe
s not exist

PWC6197: An error occurred at line: 13 in the jsp file:
/resources/download.jsp
PWC6199: Generated servlet error:
string:///d
ownload_jsp.java:21: cannot find symbol
symbol : class GenericServic
eBroker
location: class org.apache.jsp.resources.download_jsp

PWC619
7: An error occurred at line: 13 in the jsp file: /resources/download
.jsp
PWC6199: Generated servlet error:
string:///download_jsp.java:21
: cannot find symbol
symbol : class GenericServiceBroker
location: c
lass org.apache.jsp.resources.download_jsp

PWC6197: An error occurre
d at line: 13 in the jsp file: /resources/download.jsp
PWC6199: Gener
ated servlet error:
string:///download_jsp.java:58: package com.conts
hipitalia.net does not exist

PWC6197: An error occurred at line: 13
in the jsp file: /resources/download.jsp
PWC6199: Generated servlet e
rror:
string:///download_jsp.java:60: package com.contshipitalia.net
does not exist

PWC6197: An error occurred at line: 13 in the jsp fil
e: /resources/download.jsp
PWC6199: Generated servlet error:
string:/
//download_jsp.java:63: package com.contshipitalia.net does not exist

PWC6197: An error occurred at line: 14 in the jsp file: /resources/
download.jsp
PWC6199: Generated servlet error:
string:///download_jsp
.java:76: cannot find symbol
symbol : variable Form
location: class
org.apache.jsp.resources.download_jsp

PWC6197: An error occurred at
line: 14 in the jsp file: /resources/download.jsp
PWC6199: Generated
servlet error:
string:///download_jsp.java:89: cannot find symbol
sym
bol : class Download
location: class org.apache.jsp.resources.downlo
ad_jsp

PWC6197: An error occurred at line: 14 in the jsp file: /reso
urces/download.jsp
PWC6199: Generated servlet error:
string:///downlo
ad_jsp.java:95: cannot find symbol
symbol : variable Form
location:
class org.apache.jsp.resources.download_jsp

PWC6197: An error occurr
ed at line: 14 in the jsp file: /resources/download.jsp
PWC6199: Gene
rated servlet error:
string:///download_jsp.java:101: cannot find sym
bol
symbol : variable Environment
location: class org.apache.jsp.res
ources.download_jsp

PWC6197: An error occurred at line: 14 in the js
p file: /resources/download.jsp
PWC6199: Generated servlet error:
str
ing:///download_jsp.java:109: cannot find symbol
symbol : class Gene
ricData
location: class org.apache.jsp.resources.download_jsp

PWC619
7: An error occurred at line: 14 in the jsp file: /resources/download
.jsp
PWC6199: Generated servlet error:
string:///download_jsp.java:13
6: cannot find symbol
symbol : class Download
location: class org.ap
ache.jsp.resources.download_jsp

PWC6197: An error occurred at line:
14 in the jsp file: /resources/download.jsp
PWC6199: Generated servle
t error:
string:///download_jsp.java:165: cannot find symbol
symbol
: class Download
location: class org.apache.jsp.resources.download_js
p

PWC6197: An error occurred at line: 14 in the jsp file: /resources
/download.jsp
PWC6199: Generated servlet error:
string:///download_js
p.java:167: cannot find symbol
symbol : class Download
location: cla
ss org.apache.jsp.resources.download_jsp

PWC6197: An error occurred
at line: 14 in the jsp file: /resources/download.jsp
PWC6199: Generat
ed servlet error:
string:///download_jsp.java:184: cannot find symbol

symbol : class Download
location: class org.apache.jsp.resources.do
wnload_jsp

PWC6197: An error occurred at line: 14 in the jsp file: /
resources/download.jsp
PWC6199: Generated servlet error:
string:///do
wnload_jsp.java:205: cannot find symbol
symbol : class Download
loca
tion: class org.apache.jsp.resources.download_jsp

PWC6197: An error
occurred at line: 14 in the jsp file: /resources/download.jsp
PWC6199
: Generated servlet error:
string:///download_jsp.java:218: cannot fi
nd symbol
symbol : class StringInputStream
location: class org.apach
e.jsp.resources.download_jsp

PWC6197: An error occurred at line: 14
in the jsp file: /resources/download.jsp
PWC6199: Generated servlet e
rror:
string:///download_jsp.java:243: cannot find symbol
symbol : v
ariable JMail
location: class org.apache.jsp.resources.download_jsp

PWC6197: An error occurred at line: 14 in the jsp file: /resources/do
wnload.jsp
PWC6199: Generated servlet error:
string:///download_jsp.j
ava:247: cannot find symbol
symbol : variable JMail
location: class
org.apache.jsp.resources.download_jsp

name_value: CSIPortal-J2EE6
name_name: name
keys: name
use-main-children-attribute: false
exit-code: FAILURE

Command deploy failed.

Comment by Hong Zhang [ 15/Jul/11 ]

From the error message, the precompilejsp flag is passed to the web container, but there are some issues in compiling the jsps. Assign to kinman for further evaluation.

Comment by cistox [ 18/Jul/11 ]

Hello,
I extend the issue to servlets.

If I do not precompile JSPs but I just deploy the EAR, then I found that I cannot access either JSPs and Servlets.

a) JSPs are not accessible as they are not compiled even dynamically on request.

b) Servlets are not reachable... thus this seems the servlet container is not able to read the web.xml

We have a distributable WAR inside the EAR along with some EJB modules and JPA entities.

The same EAR is working fine when deployed on a Glassfish 3.1 installed for development (default install option)

Hope this helps, but I please ask you if you could provide a workaround.

I mean a manual way to fix the deployment on a cluster.

Thank you in advance

Roberto Cisternino

Comment by kchung [ 20/Jul/11 ]

When try deploying the ear file, I got the following error:

./asadmin deploy --precompilejsp=true ~/d/CSIPortal-J2EE6.ear
remote failure: Error occurred during deployment: Exception while preparing the app : Invalid resource : jdbc/AS400_MCT__pm. Please see server.log for more details.
Exception while invoking class org.glassfish.persistence.jpa.JPADeployer prepare method : java.lang.RuntimeException: Invalid resource : jdbc/AS400_MCT__pm
Invalid resource : jdbc/AS400_MCT__pm
Command deploy failed.

Comment by cistox [ 20/Jul/11 ]

Well,
I have not mentioned that this is an enterprise application that is using 13 databases, so for a test I would suggest to install the following glassfish-resources.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE resources PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Resource Definitions//EN" "http://glassfish.org/dtds/glassfish-resources_1_5.dtd">
<resources>
<jdbc-resource enabled="true" jndi-name="jdbc/WEBCDB" object-type="user" pool-name="DB2-UDB_WEBCDB">
<description>CSI Portal Central Index DB</description>
</jdbc-resource>
<jdbc-resource enabled="true" jndi-name="jdbc/WEBDBLSCT" object-type="user" pool-name="SQLServer_LSCT">
<description>CSI Portal LSCT Remote DB</description>
</jdbc-resource>
<jdbc-resource enabled="true" jndi-name="jdbc/WEBDBCICT" object-type="user" pool-name="SQLServer_CICT">
<description>CSI Portal CICT Remote DB</description>
</jdbc-resource>
<jdbc-resource enabled="true" jndi-name="jdbc/WEBDBTCR" object-type="user" pool-name="SQLServer_TCR">
<description>CSI Portal TCR Remote DB</description>
</jdbc-resource>
<jdbc-resource enabled="true" jndi-name="jdbc/WEBDBEGATE" object-type="user" pool-name="SQLServer_EGT">
<description>CSI Portal EGT Remote DB</description>
</jdbc-resource>
<jdbc-resource enabled="true" jndi-name="jdbc/WEBDBMCT" object-type="user" pool-name="SQLServer_MCT">
<description>CSI Portal MCT Remote DB</description>
</jdbc-resource>
<jdbc-resource enabled="true" jndi-name="jdbc/WEBDBSOGEMAR" object-type="user" pool-name="ORACLE_SOGEMAR">
<description>CSI Portal SOGEMAR Remote DB</description>
</jdbc-resource>
<jdbc-resource enabled="true" jndi-name="jdbc/MCTSTAPDB" object-type="user" pool-name="SQLServer_Stap_MCT">
<description>MCT Stap DB</description>
</jdbc-resource>
<jdbc-resource enabled="true" jndi-name="jdbc/MCTSrvAcc" object-type="user" pool-name="SQLServer_AccServ_MCT">
<description>MCT Accessorial Services DB</description>
</jdbc-resource>
<jdbc-resource enabled="true" jndi-name="jdbc/MCT_LASHING" object-type="user" pool-name="SQLServer_Lashing_MCT">
<description>MCT Lashing DB</description>
</jdbc-resource>
<jdbc-resource enabled="true" jndi-name="jdbc/AS400_LSCT" object-type="user" pool-name="DB2-AS400_LSCT">
<description>LSCT AS400 DB</description>
</jdbc-resource>
<jdbc-resource enabled="true" jndi-name="jdbc/AS400_MCT" object-type="user" pool-name="DB2-AS400_MCT">
<description>MCT AS400 DB</description>
</jdbc-resource>
<mail-resource debug="false" enabled="true" from="CSIPortal@contshipitalia.com" host="w2kspeexc2.contship.net" jndi-name="mail/mailer" object-type="user" store-protocol="imap" store-protocol-class="com.sun.mail.imap.IMAPStore" transport-protocol="smtp" transport-protocol-class="com.sun.mail.smtp.SMTPTransport" user="CSIPortal">
<description/>
<property name="mail.password" value="SuPerpippox.68"/>
</mail-resource>
<jdbc-connection-pool allow-non-component-callers="true" associate-with-thread="false" connection-creation-retry-attempts="0" connection-creation-retry-interval-in-seconds="10" connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0" connection-validation-method="table" datasource-classname="com.ibm.db2.jcc.DB2ConnectionPoolDataSource" fail-all-connections="true" idle-timeout-in-seconds="300" is-connection-validation-required="true" is-isolation-level-guaranteed="true" lazy-connection-association="false" lazy-connection-enlistment="false" match-connections="false" max-connection-usage-count="0" max-pool-size="50" max-wait-time-in-millis="60000" name="DB2-UDB_WEBCDB" non-transactional-connections="false" pool-resize-quantity="2" res-type="javax.sql.ConnectionPoolDataSource" statement-timeout-in-seconds="-1" steady-pool-size="5" validate-atmost-once-period-in-seconds="0" validation-table-name="DUMMY" wrap-jdbc-objects="true">
<description>WEBCDB - DB2 8.2 Universal JDBC Driver Provider</description>
<property name="serverName" value="10.5.1.77"/>
<property name="portNumber" value="50004"/>
<property name="databaseName" value="WEBCDB"/>
<property name="driverType" value="4"/>
<property name="User" value="addb2"/>
<property name="Password" value="addb2"/>
</jdbc-connection-pool>
<jdbc-connection-pool allow-non-component-callers="false" associate-with-thread="false" connection-creation-retry-attempts="0" connection-creation-retry-interval-in-seconds="10" connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0" connection-validation-method="auto-commit" datasource-classname="com.ibm.as400.access.AS400JDBCConnectionPoolDataSource" fail-all-connections="true" idle-timeout-in-seconds="300" is-connection-validation-required="false" is-isolation-level-guaranteed="true" lazy-connection-association="false" lazy-connection-enlistment="false" match-connections="false" max-connection-usage-count="0" max-pool-size="15" max-wait-time-in-millis="60000" name="DB2-AS400_LSCT" non-transactional-connections="false" pool-resize-quantity="2" res-type="javax.sql.ConnectionPoolDataSource" statement-timeout-in-seconds="-1" steady-pool-size="2" validate-atmost-once-period-in-seconds="0" wrap-jdbc-objects="true">
<description>LSCT - AS400 Toolbox JDBC Driver</description>
<property name="User" value="EDI"/>
<property name="Password" value="vermentino"/>
<property name="serverName" value="10.5.1.21"/>
<property name="databaseName" value="S650514C"/>
<property name="dateFormat" value="ISO"/>
<property name="driver" value="toolbox"/>
<property name="access" value="all"/>
<property name="blockSize" value="32"/>
<property name="blockCriteria" value="2"/>
<property name="dataTruncation" value="true"/>
<property name="dataCompression" value="true"/>
<property name="lazyClose" value="false"/>
<property name="fullOpen" value="false"/>
<property name="extendedMetaData" value="false"/>
<property name="extendedDynamic" value="false"/>
<property name="bigDecimal" value="true"/>
<property name="cursorHold" value="false"/>
</jdbc-connection-pool>
<jdbc-connection-pool allow-non-component-callers="false" associate-with-thread="false" connection-creation-retry-attempts="0" connection-creation-retry-interval-in-seconds="10" connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0" connection-validation-method="auto-commit" datasource-classname="com.ibm.as400.access.AS400JDBCConnectionPoolDataSource" fail-all-connections="true" idle-timeout-in-seconds="300" is-connection-validation-required="false" is-isolation-level-guaranteed="true" lazy-connection-association="false" lazy-connection-enlistment="false" match-connections="false" max-connection-usage-count="0" max-pool-size="20" max-wait-time-in-millis="60000" name="DB2-AS400_MCT" non-transactional-connections="false" pool-resize-quantity="2" res-type="javax.sql.ConnectionPoolDataSource" statement-timeout-in-seconds="-1" steady-pool-size="2" validate-atmost-once-period-in-seconds="0" wrap-jdbc-objects="true">
<description>MCT - AS400 Toolbox JDBC Driver</description>
<property name="User" value="LSCT_WEB"/>
<property name="Password" value="WEB_LSCT"/>
<property name="serverName" value="10.20.1.5"/>
<property name="databaseName" value="TESTDB"/>
<property name="libraries" value="BLOCCOAB"/>
<property name="dateFormat" value="ISO"/>
<property name="driver" value="toolbox"/>
<property name="access" value="all"/>
<property name="blockSize" value="32"/>
<property name="blockCriteria" value="2"/>
<property name="dataTruncation" value="true"/>
<property name="dataCompression" value="true"/>
<property name="lazyClose" value="false"/>
<property name="fullOpen" value="false"/>
<property name="extendedMetaData" value="false"/>
<property name="extendedDynamic" value="false"/>
<property name="bigDecimal" value="true"/>
<property name="cursorHold" value="false"/>
</jdbc-connection-pool>
<jdbc-connection-pool allow-non-component-callers="false" associate-with-thread="false" connection-creation-retry-attempts="0" connection-creation-retry-interval-in-seconds="10" connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0" connection-validation-method="table" datasource-classname="com.inet.tds.PDataSource" fail-all-connections="false" idle-timeout-in-seconds="300" is-connection-validation-required="true" is-isolation-level-guaranteed="true" lazy-connection-association="false" lazy-connection-enlistment="false" match-connections="false" max-connection-usage-count="0" max-pool-size="35" max-wait-time-in-millis="60000" name="SQLServer_LSCT" non-transactional-connections="false" pool-resize-quantity="2" res-type="javax.sql.ConnectionPoolDataSource" statement-timeout-in-seconds="-1" steady-pool-size="5" validate-atmost-once-period-in-seconds="0" validation-table-name="TERMINAL" wrap-jdbc-objects="true">
<description>WEBDB LSCT - Merlia I-NET JDBC Driver for MS SQLServer</description>
<property name="serverName" value="w2kspesql01"/>
<property name="portNumber" value="1433"/>
<property name="databaseName" value="WEBDB_LSCT"/>
<property name="User" value="nodo"/>
<property name="Password" value="nodo"/>
</jdbc-connection-pool>
<jdbc-connection-pool allow-non-component-callers="false" associate-with-thread="false" connection-creation-retry-attempts="0" connection-creation-retry-interval-in-seconds="10" connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0" connection-validation-method="table" datasource-classname="com.inet.tds.PDataSource" fail-all-connections="false" idle-timeout-in-seconds="300" is-connection-validation-required="true" is-isolation-level-guaranteed="true" lazy-connection-association="false" lazy-connection-enlistment="false" match-connections="false" max-connection-usage-count="0" max-pool-size="30" max-wait-time-in-millis="60000" name="SQLServer_MCT" non-transactional-connections="false" pool-resize-quantity="2" res-type="javax.sql.ConnectionPoolDataSource" statement-timeout-in-seconds="-1" steady-pool-size="5" validate-atmost-once-period-in-seconds="0" validation-table-name="TERMINAL" wrap-jdbc-objects="true">
<description>WEBDB MCT - Merlia I-NET JDBC Driver for MS SQLServer</description>
<property name="serverName" value="10.20.1.38"/>
<property name="portNumber" value="1433"/>
<property name="databaseName" value="WEBDB"/>
<property name="User" value="lsct"/>
<property name="Password" value="lsct"/>
</jdbc-connection-pool>
<jdbc-connection-pool allow-non-component-callers="false" associate-with-thread="false" connection-creation-retry-attempts="0" connection-creation-retry-interval-in-seconds="10" connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0" connection-validation-method="table" datasource-classname="com.inet.tds.PDataSource" fail-all-connections="false" idle-timeout-in-seconds="300" is-connection-validation-required="true" is-isolation-level-guaranteed="true" lazy-connection-association="false" lazy-connection-enlistment="false" match-connections="false" max-connection-usage-count="0" max-pool-size="15" max-wait-time-in-millis="60000" name="SQLServer_CICT" non-transactional-connections="false" pool-resize-quantity="2" res-type="javax.sql.ConnectionPoolDataSource" statement-timeout-in-seconds="-1" steady-pool-size="3" validate-atmost-once-period-in-seconds="0" validation-table-name="TERMINAL" wrap-jdbc-objects="true">
<description>WEBDB CICT - Merlia I-NET JDBC Driver for MS SQLServer</description>
<property name="serverName" value="10.80.1.84"/>
<property name="portNumber" value="1433"/>
<property name="databaseName" value="WEBDB_CICT"/>
<property name="User" value="nodo"/>
<property name="Password" value="nodo"/>
</jdbc-connection-pool>
<jdbc-connection-pool allow-non-component-callers="false" associate-with-thread="false" connection-creation-retry-attempts="0" connection-creation-retry-interval-in-seconds="10" connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0" connection-validation-method="table" datasource-classname="com.inet.tds.PDataSource" fail-all-connections="false" idle-timeout-in-seconds="300" is-connection-validation-required="true" is-isolation-level-guaranteed="true" lazy-connection-association="false" lazy-connection-enlistment="false" match-connections="false" max-connection-usage-count="0" max-pool-size="15" max-wait-time-in-millis="60000" name="SQLServer_TCR" non-transactional-connections="false" pool-resize-quantity="2" res-type="javax.sql.ConnectionPoolDataSource" statement-timeout-in-seconds="-1" steady-pool-size="3" validate-atmost-once-period-in-seconds="0" validation-table-name="TERMINAL" wrap-jdbc-objects="true">
<description>WEBDB TCR - Merlia I-NET JDBC Driver for MS SQLServer</description>
<property name="serverName" value="10.0.2.46"/>
<property name="portNumber" value="1433"/>
<property name="databaseName" value="WEBDB_TCR"/>
<property name="User" value="nodo"/>
<property name="Password" value="nodo"/>
</jdbc-connection-pool>
<jdbc-connection-pool allow-non-component-callers="false" associate-with-thread="false" connection-creation-retry-attempts="0" connection-creation-retry-interval-in-seconds="10" connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0" connection-validation-method="table" datasource-classname="com.inet.tds.PDataSource" fail-all-connections="false" idle-timeout-in-seconds="300" is-connection-validation-required="true" is-isolation-level-guaranteed="true" lazy-connection-association="false" lazy-connection-enlistment="false" match-connections="false" max-connection-usage-count="0" max-pool-size="15" max-wait-time-in-millis="60000" name="SQLServer_EGT" non-transactional-connections="false" pool-resize-quantity="2" res-type="javax.sql.ConnectionPoolDataSource" statement-timeout-in-seconds="-1" steady-pool-size="3" validate-atmost-once-period-in-seconds="0" validation-table-name="TERMINAL" wrap-jdbc-objects="true">
<description>WEBDB EGT - Merlia I-NET JDBC Driver for MS SQLServer</description>
<property name="serverName" value="10.60.1.33"/>
<property name="portNumber" value="1433"/>
<property name="databaseName" value="WEBDB_EGT"/>
<property name="User" value="nodo"/>
<property name="Password" value="nodo"/>
</jdbc-connection-pool>
<jdbc-connection-pool allow-non-component-callers="false" associate-with-thread="false" connection-creation-retry-attempts="0" connection-creation-retry-interval-in-seconds="10" connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0" connection-validation-method="table" datasource-classname="oracle.jdbc.pool.OracleConnectionPoolDataSource" fail-all-connections="false" idle-timeout-in-seconds="300" is-connection-validation-required="true" is-isolation-level-guaranteed="true" lazy-connection-association="false" lazy-connection-enlistment="false" match-connections="false" max-connection-usage-count="0" max-pool-size="15" max-wait-time-in-millis="60000" name="ORACLE_SOGEMAR" non-transactional-connections="false" pool-resize-quantity="2" res-type="javax.sql.ConnectionPoolDataSource" statement-timeout-in-seconds="-1" steady-pool-size="3" validate-atmost-once-period-in-seconds="0" validation-table-name="TERMINAL" wrap-jdbc-objects="true">
<description>WEBDB SOGEMAR - ORACLE JDBC Driver</description>
<property name="User" value="dbaportale"/>
<property name="Password" value="sogemar"/>
<property name="url" value="jdbc:oracle:thin:@//10.10.5.14:1521/POS10"/>
</jdbc-connection-pool>
<jdbc-connection-pool allow-non-component-callers="false" associate-with-thread="false" connection-creation-retry-attempts="0" connection-creation-retry-interval-in-seconds="10" connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0" connection-validation-method="auto-commit" datasource-classname="com.inet.tds.PDataSource" fail-all-connections="true" idle-timeout-in-seconds="300" is-connection-validation-required="true" is-isolation-level-guaranteed="true" lazy-connection-association="false" lazy-connection-enlistment="false" match-connections="false" max-connection-usage-count="0" max-pool-size="10" max-wait-time-in-millis="60000" name="SQLServer_Lashing_MCT" non-transactional-connections="false" pool-resize-quantity="2" res-type="javax.sql.ConnectionPoolDataSource" statement-timeout-in-seconds="-1" steady-pool-size="3" validate-atmost-once-period-in-seconds="0" wrap-jdbc-objects="true">
<description>LASHING MCT - Merlia I-NET JDBC Driver for MS SQLServer</description>
<property name="serverName" value="10.20.1.36"/>
<property name="portNumber" value="1433"/>
<property name="databaseName" value="TerminalMonitor"/>
<property name="User" value="lsct"/>
<property name="Password" value="lashing"/>
</jdbc-connection-pool>
<jdbc-connection-pool allow-non-component-callers="false" associate-with-thread="false" connection-creation-retry-attempts="0" connection-creation-retry-interval-in-seconds="10" connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0" connection-validation-method="auto-commit" datasource-classname="com.inet.tds.PDataSource" fail-all-connections="true" idle-timeout-in-seconds="300" is-connection-validation-required="true" is-isolation-level-guaranteed="true" lazy-connection-association="false" lazy-connection-enlistment="false" match-connections="false" max-connection-usage-count="0" max-pool-size="10" max-wait-time-in-millis="60000" name="SQLServer_Stap_MCT" non-transactional-connections="false" pool-resize-quantity="2" res-type="javax.sql.ConnectionPoolDataSource" statement-timeout-in-seconds="-1" steady-pool-size="2" validate-atmost-once-period-in-seconds="0" wrap-jdbc-objects="true">
<description>STAP MCT - Merlia I-NET JDBC Driver for MS SQLServer</description>
<property name="serverName" value="10.20.1.37"/>
<property name="portNumber" value="1433"/>
<property name="databaseName" value="STAP"/>
<property name="User" value="webstap"/>
<property name="Password" value="lsct"/>
</jdbc-connection-pool>
<jdbc-connection-pool allow-non-component-callers="false" associate-with-thread="false" connection-creation-retry-attempts="0" connection-creation-retry-interval-in-seconds="10" connection-leak-reclaim="false" connection-leak-timeout-in-seconds="0" connection-validation-method="auto-commit" datasource-classname="com.inet.tds.PDataSource" fail-all-connections="true" idle-timeout-in-seconds="300" is-connection-validation-required="true" is-isolation-level-guaranteed="true" lazy-connection-association="false" lazy-connection-enlistment="false" match-connections="false" max-connection-usage-count="0" max-pool-size="10" max-wait-time-in-millis="60000" name="SQLServer_AccServ_MCT" non-transactional-connections="false" pool-resize-quantity="2" res-type="javax.sql.ConnectionPoolDataSource" statement-timeout-in-seconds="-1" steady-pool-size="2" validate-atmost-once-period-in-seconds="0" wrap-jdbc-objects="true">
<description>Accessorial Services MCT - Merlia I-NET JDBC Driver for MS SQLServer</description>
<property name="serverName" value="10.20.1.14"/>
<property name="portNumber" value="1433"/>
<property name="databaseName" value="ServiziAccessori"/>
<property name="User" value="lsct2"/>
<property name="Password" value="lsct2"/>
</jdbc-connection-pool>
</resources>

Comment by kchung [ 21/Jul/11 ]

I added your glassfish-resources.xml to META-INF but still have the same error when deployed. Please attach another ear file with this file added. Thanks.

Comment by cistox [ 25/Jul/11 ]

Sorry I do not understand why you put glassfish resources under META-INF as I think you cannot have jndi resources automatically installed on the cluster.

I used this command to install all JNDI and references:

asadmin add-resources --target CSIPortal-cluster glassfish-resources.xml





[GLASSFISH-17178] [UB]Glassfish 3.1.1 with JK Listener enabled throws exception of NoSuchThreadPool when EJB is deployed Created: 10/Aug/11  Updated: 07/Mar/12

Status: Open
Project: glassfish
Component/s: docs, web_container
Affects Version/s: 3.1.1
Fix Version/s: not determined

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

OS X Lion, Windows 7 32bit



 Description   

Glassfish 3.1.1 build12 with a JK Listener enabled and set to thread-pool-1 throws NoSuchThreadPool exception when EJB is deploy individually or as part of an EAR.

Tested on multiple environments standalone and via Eclipse plugin. Same results each time. Reproducible every time.
Deploying applications with no EJBs has no issue.
Removing JK Listener resolves the problem.

Steps to reproduce.
1) New Glassfish 3.1.1 (build 12) install from zip.
2) Configure JK Listener on port 8009 on address 0.0.0.0 with thread-pool-1 as thread pool on server "server".
3) Create test EJB Project in Eclipse with one Hello World type method with both local and remote interfaces.
4) Export test EJB Project to JAR.
5) Deploy from web interface Applications menu.

Exception details below:
WARNING: No default ThreadPool defined
com.sun.corba.ee.spi.orbutil.threadpool.NoSuchThreadPoolException
at org.glassfish.enterprise.iiop.util.S1ASThreadPoolManager.getThreadPool(S1ASThreadPoolManager.java:246)
at org.glassfish.enterprise.iiop.util.S1ASThreadPoolManager.getDefaultThreadPool(S1ASThreadPoolManager.java:276)
at org.glassfish.enterprise.iiop.impl.PEORBConfigurator.configure(PEORBConfigurator.java:138)
at com.sun.corba.ee.impl.orb.ORBConfiguratorImpl.runUserConfigurators(ORBConfiguratorImpl.java:185)
at com.sun.corba.ee.impl.orb.ORBConfiguratorImpl.configure(ORBConfiguratorImpl.java:170)
at com.sun.corba.ee.impl.orb.ORBImpl.postInit(ORBImpl.java:625)
at com.sun.corba.ee.impl.orb.ORBImpl.set_parameters(ORBImpl.java:704)
at com.sun.corba.ee.impl.orb.ORBImpl.setParameters(ORBImpl.java:691)
at com.sun.corba.ee.spi.osgi.ORBFactory.initialize(ORBFactory.java:107)
at org.glassfish.enterprise.iiop.impl.GlassFishORBManager.initORB(GlassFishORBManager.java:581)
at org.glassfish.enterprise.iiop.impl.GlassFishORBManager.getORB(GlassFishORBManager.java:263)
at org.glassfish.enterprise.iiop.impl.GlassFishORBFactoryImpl.createORB(GlassFishORBFactoryImpl.java:93)
at org.glassfish.enterprise.iiop.api.GlassFishORBHelper.getORB(GlassFishORBHelper.java:152)
at org.glassfish.enterprise.iiop.api.GlassFishORBHelper.getProtocolManager(GlassFishORBHelper.java:219)
at com.sun.ejb.containers.BaseContainer.initializeProtocolManager(BaseContainer.java:818)
at com.sun.ejb.containers.BaseContainer.<init>(BaseContainer.java:566)
at com.sun.ejb.containers.StatelessSessionContainer.<init>(StatelessSessionContainer.java:155)
at com.sun.ejb.containers.StatelessSessionContainer.<init>(StatelessSessionContainer.java:149)
at com.sun.ejb.containers.ContainerFactoryImpl.createContainer(ContainerFactoryImpl.java:105)
at org.glassfish.ejb.startup.EjbApplication.loadContainers(EjbApplication.java:230)
at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:290)
at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:101)
at org.glassfish.internal.data.ModuleInfo.load(ModuleInfo.java:186)
at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:257)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:382)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:355)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:370)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1064)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:96)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1244)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1232)
at org.glassfish.admin.rest.ResourceUtil.runCommand(ResourceUtil.java:202)
at org.glassfish.admin.rest.ResourceUtil.runCommand(ResourceUtil.java:195)
at org.glassfish.admin.rest.resources.TemplateListOfResource.createResource(TemplateListOfResource.java:148)
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.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)
at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:288)
at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:134)
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:134)
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1469)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1400)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1349)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1339)
at com.sun.jersey.server.impl.container.grizzly.GrizzlyContainer._service(GrizzlyContainer.java:182)
at com.sun.jersey.server.impl.container.grizzly.GrizzlyContainer.service(GrizzlyContainer.java:147)
at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:184)
at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:168)
at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:117)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:238)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:828)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:725)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1019)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
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:680)



 Comments   
Comment by Hong Zhang [ 10/Aug/11 ]

Not sure if it's an ejb issue or orb issue, assign to ejb team for initial evaluation.

Comment by Cheng Fang [ 10/Aug/11 ]

Can you try not specifying threadpool option when creating the listener? Or use "http-thread-pool".

thread-pool-1 is for servicing IIOP requests and for resource adapters to service work management requests.

Comment by vin4bacchus [ 10/Aug/11 ]

"thread-pool-1" was chosen because default "http-thread-pool" only has a max of 5 threads and choosing this pool threw a warning in the logs about not large enough max thread pool for AJP listener.

Upped "http-thread-pool" max threads to 50 and assigned the AJP JK Listener to it and tested on sample EJB project ok.
This appears to have solved the issue by using a different thread pool than "thread-pool-1".

Comment by Cheng Fang [ 10/Aug/11 ]

transfer to doc team to clarify. The following is what I observed. You may want to check with web container team:

do not use the build-in thread-pool-1 for any network-listener;

if users do not specify a threadpool for the jk listener, the default threadpool used is http-thread-pool. And users also need to up the max size for http-thread-pool from 5 to a bigger number.

users can also create a new thread pool with create-threadpool command with decent max size, for jk listener.

Comment by vin4bacchus [ 10/Aug/11 ]

Only one clarification. The default thread pool for a new JK Listener is actually the "admin" thread pool.

Comment by Tom Mueller [ 07/Mar/12 ]

Bulk update to set Fix Version to "not determined" for issues that had it set to a version that has already been released.





[GLASSFISH-17323] Unsupported deployment descriptors element library-name in weblogic.xml Created: 20/Sep/11  Updated: 26/Mar/13

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

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

Attachments: File gradeschool.war    
Tags: 3_1_2-exclude

 Description   

*report the bug for backward compatibility requirement for future BG product*

I tried to deploy the attached Weblogic QA test application to Glassfish v3.1.1, the deployment was successful. However, in the server.log it displayed the following messages:

"[#|2011-09-20T10:25:45.812-0700|INFO|glassfish3.1.1|org.glassfish.admingui|_Thre
adID=19;_ThreadName=Thread-2;|uploadFileName=gradeschool.war|#]

[#|2011-09-20T10:25:45.968-0700|WARNING|glassfish3.1.1|javax.enterprise.system.t
ools.deployment.org.glassfish.deployment.common|_ThreadID=17;_ThreadName=Thread-
2;|DPL8007: Unsupported deployment descriptors element library-name value playgr
ound|#]

[#|2011-09-20T10:25:45.968-0700|WARNING|glassfish3.1.1|javax.enterprise.system.t
ools.deployment.org.glassfish.deployment.common|_ThreadID=17;_ThreadName=Thread-
2;|DPL8007: Unsupported deployment descriptors element library-name value cafete
ria|#]"

The following is the snapshot of the weblogic.xml of the test app.
<weblogic-web-app>

<library-ref>
<library-name>playground</library-name>
</library-ref>

<library-ref>
<library-name>cafeteria</library-name>
</library-ref>

</weblogic-web-app>

We might have to make sure we will support the above elements in weblogic.xml in the future BG release. Thanks.



 Comments   
Comment by sonialiu [ 20/Sep/11 ]

add fix version 4.0

Comment by sonialiu [ 21/Sep/11 ]

changed affects version to 4.0





[GLASSFISH-18352] Nested tags that export variable whose "variable-class" value was not "java.lang.String" would result in compilation error. Created: 13/Feb/12  Updated: 14/Feb/12

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

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

Operating System: All
Platform: All


Tags: 3_1_2-exclude

 Description   

I've found a new bug which is caused by the modification of
Issue4266(Revision20269).
And the issue4266 is descripted on http://java.net/jira/browse
/GLASSFISH-4266
The detail of the new bug is following:
When nesting tags that export the same variable name,and if the value
of the "variable-class" is not "java.lang.String",a
compilation error occurs.
for example:
----------------------------------
taglib.tld

<tag>
<name>test</name>
<tag-class>com.sample.TestTag</tag-class>
<body-content>scriptless</body-content>
<variable>
<name-given>va</name-given>
<variable-class>java.util.Integer</variable-class>
</variable>
</tag>

test.jspx

<t:one>
<jsp:attribute name="a">
<t:test va="2012">
<t:test va="2012">
<jsp:text>blah</jsp:text>
</t:test>
</t:test>
</jsp:attribute>
</t:one>
---------------------------------

the following is the main error message:
----------
HTTP Status 500 - message description The server encountered an
internal error () that prevented it from
fulfilling this request.exception org.apache.jasper.JasperException
...Unable to compile class for JSP
... Generated servlet error:
rtexprvalue : java.lang.Integer
required : java.lang.String
-----------

I think the following source(★
)results in the new bug.
--------
・The class:
org.pache.jasper.compiler.Generator
・The method:
private void saveScriptingVars(Node.CustomTag n, int scope)
・The part of source:
=======
String tmpVarName = JspUtil.nextTemporaryVariableName();
n.setTempScriptingVar(varName, tmpVarName);
out.printin("String "); ★
out.print(tmpVarName);
out.print(" = ");
out.print(varName);
out.println(";");
=======
--------

Will the bug be resolved on glassFish.
And When the bug be resolved on glassFish.



 Comments   
Comment by Joe Di Pol [ 14/Feb/12 ]

Excluding from 3.1.2 – filed against 9.1.1





[GLASSFISH-18830] JSPCompiler#compile ignore delegate flag Created: 23/Jun/12  Updated: 23/Jun/12

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

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


 Description   

The JSPCompiler#compile ignore delegate flag.

The current implementation is as follows:

        boolean delegate = true;
        com.sun.enterprise.deployment.runtime.web.ClassLoader clBean =
                wbd.getSunDescriptor().getClassLoader();

        // so far, this is not segragated per web bundle, all web-bundles will get the
        // same sysClassPath
        String sysClassPath = ASClassLoaderUtil.getModuleClassPath(
            serverContext.getDefaultServices(), appName, null);
        jspc.setSystemClassPath(sysClassPath);
        // END SJSAS 6311155

Note that the delegate is not used in the above code snapshot.
The seems to be related to change 24871.






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-18901] Redirect to originating page fails after authentication Created: 13/Jul/12  Updated: 24/Apr/14

Status: Open
Project: glassfish
Component/s: security, web_container
Affects Version/s: 3.1.2_b23
Fix Version/s: future release

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

SUSE Linux Enterprise Server 11 (i586)
VERSION = 11
PATCHLEVEL = 1


Attachments: Java Source File AS400LoginModule.java     Text File GF-Test-Log-2012-07-13.txt     Text File jaas-login-form.txt     Zip Archive jaas-vendor-adapters.zip    
Tags: JSR196, authentication, jaas

 Description   

I have tried every permutation of the SAM that I can find and still can not get the GF container to accept the completed authentication and redirect/forward back to the originally requested resource. The container continues to return with the j_security_check page.

The authentication module (ServerModule based) completes successfully and it works under Tomcat without an issue.

The authentication module currently uses the NameCallback, PasswordCallback, ChoiceCallback, and TextOutputCallback. Those callbacks are not handled under the GF container default callback handler but instead (from what I can gather) uses the GroupPrincipalCallback and the PasswordValidationCallback.

I have created a custom CalllbackHandler to enable handling both sets of callbacks as appropriate and so as not to have to change the authentication module which currently works in the Websphere and Tomcat environments.

I am obviously missing some setting because the container will not redirect/forward to the requested resource after completing the authentication.

The application is using filters, but the filters don't appear to be the problem as they are manipulating the URL returned from the container (j_security_check).

I have attached the project files containing my last attempt to resolve this issue.

If the files provided don't provide sufficient information to identify the piece I am missing, please let me know and I will include any omitted



 Comments   
Comment by gerrycata [ 13/Jul/12 ]

I should note that the login form is a custom form and not using the basic form authentication scheme. I have attached the login form html to this ticket.

Comment by gerrycata [ 13/Jul/12 ]

Login form

Comment by gerrycata [ 08/Apr/13 ]

Is this issue still projected to be addressed in the 4.x release as I have not seen any activity on it? I see that the 4.x release is in beta testing but I have not seen any JAAS related activity mentioned in the release notes.





[GLASSFISH-18994] Impossible to use a CUSTOM session manager Created: 11/Aug/12  Updated: 15/Aug/12

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

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

Linux 3.2.0-3-amd64 x86_64 GNU/Linux (debian wheezy)


Attachments: Text File distributable.log     Text File non-distributable.log    

 Description   

I am trying to implement a couchbase session manager for glassfish (see https://github.com/rickyepoderi/couchbase-manager) and it is absolutely impossible to add it as a CUSTOM type (which seems to be the more reasonable way of integrating).

The following link http://docs.oracle.com/cd/E18930_01/html/821-2415/gkmhr.html explains how to include a new manager but it does not work. You have to follow one of the specified persistence types defined by this class: http://java.net/projects/glassfish/sources/svn/content/trunk/main/appserver/web/web-glue/src/main/java/com/sun/enterprise/web/session/PersistenceType.java. So, at first time, I decided to use "custom" type (I repeat that it seems the more reasonable way) but again it was impossible. If you set your PersistenceStrategyBuilder as "custom" the class http://java.net/projects/glassfish/sources/svn/content/trunk/main/appserver/web/web-glue/src/main/java/com/sun/enterprise/web/SessionManagerConfigurationHelper.java backs the application to "meemory" type (no matter the application was distributable or not).

I'm going to attach some logs with javax.enterprise.system.container.web.level=FINEST that shows that that class fails back to memory type (setting the application to <distributable/> and not setting).

Now I am re-using the "coherence-web" type but I think is not the proper way (besides it gives me another problems). Please it would be possible that the "custom" tag could just pass through this class with no interference (custom means custom, so let me do whatever I want).






[GLASSFISH-18694] sessionCreated of @WebListener class called on failover Created: 06/May/12  Updated: 08/May/12

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

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

Linux, jdk 7u4, 2 local linstances of GF 3.1.2



 Description   

In HA configuration, sessionCreated of @WebListener is called on every failover. Simple output to log files (shown below), informs container that new session was created (even it has the same id).

sessionCreated: 336cd4f4ee8ed1d714ba01330547
sessionCreated2: org.apache.catalina.session.StandardSessionFacade@7d22aadd
sessionCreated: 336cd4f4ee8ed1d714ba01330547
sessionCreated2: org.apache.catalina.session.StandardSessionFacade@4e9f32ec
sessionCreated: 336cd4f4ee8ed1d714ba01330547
sessionCreated2: org.apache.catalina.session.StandardSessionFacade@1180775e
sessionCreated: 336cd4f4ee8ed1d714ba01330547
sessionCreated2: org.apache.catalina.session.StandardSessionFacade@7331693f

Spec is not clear about it, but when we assume, that sessionCreated is supposed to be called on failover, sessionDestroyed should also be called on failover, but it is not.

My Listener looks like that:

@WebListener
public class DebugHttpSessionListener implements HttpSessionListener {

    private static final Log LOG = LogFactory.getLog(DebugHttpSessionListener.class);

    @Override
    public void sessionCreated(HttpSessionEvent se) {
        LOG.info("sessionCreated: " + se.getSession().getId());
        LOG.info("sessionCreated2: " + se.getSession());
        
    }

    @Override
    public void sessionDestroyed(HttpSessionEvent se) {
        LOG.info("sessionDestroyed" + se.getSession().getId());
    }
}





[GLASSFISH-16049] implement CORS support Created: 18/Feb/11  Updated: 18/Oct/12

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

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

Tags: ee7ri_cleanup_deferred

 Description   

I was talking to a community member and he asked if we had any plans to implement CORS on the server side. All browsers including IE8, android and iOS already support CORS but it needs support on the server side.

http://www.w3.org/TR/cors/



 Comments   
Comment by Tom Mueller [ 18/Oct/12 ]

Marking the fix version field as "future-release". This is based on an evaluation by John, Michael, and Tom WRT to the PRD for the Java EE 7 RI/SDK. This issue was deemed to not be a P1 for that release. If this is in error or there are other reasons why this RFE should be targeted for the Java EE 7 RI/SDK release, then change the fix version field back to an appropriate build.





[GLASSFISH-16252] Virtual server alternate docroot with a web module with context root / does not work properly after server restart Created: 23/Mar/11  Updated: 12/May/14

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

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

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

 Description   

If one specify the alternate docroot in the virtual server and then deploy a web module with context-root /, then it does not work properly after restart.

This is related to
http://forums.java.net/node/783831

Per discussion with Jan, the following should be the expected behavior.
1. set alt docroot in virtual server
2. check that it works
3. deploy a web app with context root /
4. check that the web app works, but the alt docroot should not.

This is the case right now.
But if the server is restarted, then we find that both the web app and alt docroot work.



 Comments   
Comment by rob1213 [ 23/Mar/11 ]

Note that if one restart the server, then it works.??

you means Application server? i have try to restart my Glassfish application server, it seems not work.

Comment by Shing Wai Chan [ 25/Mar/11 ]

I find that if I set three alternate docroot properties, then the first one will work after restart, but not the second and third one. So, there is an issue even for restart. Need further investigations.

Comment by Amy Roh [ 12/Apr/11 ]

Here's what I tried.

bash-3.2$ bin/asadmin start-domain
Command start-domain executed successfully.

bash-3.2$ bin/asadmin set server.http-service.virtual-server.server.property.alternatedocroot_1="from=*.jsp dir=/Users/Amy/tests/hello"
server.http-service.virtual-server.server.property.alternatedocroot_1=from=*.jsp dir=/Users/Amy/tests/hello
Command set executed successfully.

bash-3.2$ bin/asadmin deploy /Users/Amy/tests/hello.war
Application deployed with name hello.
Command deploy executed successfully.

bash-3.2$ ls domains/domain1/applications/hello/
WEB-INF __MACOSX index.html index.jsp

Accessing http://localohst:8080/test.jsp correctly displays from /Users/Amy/tests/hello/test.jsp

bash-3.2$ bin/asadmin deploy --contextroot "/" /Users/Amy/tests/test.war
Application deployed with name test.
Command deploy executed successfully.

Accessing http://localohst:8080/test.jsp correctly displays 404

bash-3.2$ bin/asadmin restart-domain

Accessing http://localohst:8080/test.jsp correctly displays 404

Isn't this what is expected?

If I undeploy the webapp with contextroot "/", http://localhost:8080/test.jsp correctly displays from /Users/Amy/tests/hello/test.jsp again.

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

asadmin --host localhost --port 4848 --user admin --passwordfile /export/gfv3/src/v2/appserv-tests/config/adminpassword.txt --interactive=false --echo=true --terse=true set "server.http-service.virtual-server.server.property.alternatedocroot_1=from=/domain.xml dir=/export/gfv3/src/v3/install/glassfish3/glassfish/domains/domain1/config"

Deploy a war with context root /.

Access http://localhost:8080/domain.xml correctly display 404.

asadmin stop-domain domain1
asadmin start-domain domain1

Access http://localhost:8080/domain.xml return the page incorrectly.

Comment by Amy Roh [ 13/Apr/11 ]

If I use "from=*.xml" instead of "from=/domain.xml" everything works as expected even after restart. The issue appears to be isolated in the exact matching scenario.

Comment by Amy Roh [ 31/May/11 ]

The server is now correctly returning "Not Found" as expected even after restart.

However, instead of normal GlassFish 404 Not Found error page, Grizzly internal error page is returned.

Assigning to Alexey so the error page is customized for GlassFish.

Comment by oleksiys [ 12/May/14 ]

Looks like it works fine now.
The only issue I see now is 500 response returned for "http://host:port/domain.xml", when alternate docroot is pointing to a non-existing folder.

Shing Wai, can you pls. take a look at it?





[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-16901] tcp-no-delay attribute in Http is not working Created: 23/Jun/11  Updated: 24/Apr/14

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

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

Sub-Tasks:
Key
Summary
Type
Status
Assignee
GLASSFISH-16902 [UB]Need to document that tcp-no-dela... Sub-task Resolved Rebecca Parks  
Tags: 3_1_1-next, 3_1_1-scrubbed, 3_1_2-exclude

 Description   

The tcp-no-delay attribute in Http is not processed.
Instead the tcpNoDelay property in http-service is processed.
Note that the tcpNoDelay property is not documented.






[GLASSFISH-16871] Refactoring DefaultServlet.serveResource Created: 16/Jun/11  Updated: 01/Dec/11

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

Type: Improvement Priority: Major
Reporter: Eirik Bjørsnøs Assignee: Shing Wai Chan
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File GLASSFISH-16871-lookup-validation.patch    

 Description   

In trying to add a features to DefaultServlet.serveResource I've found the method in it's current form extremely hard to work with.

I'm counting 346 lines, 46 branches (some nested 7 levels deep), 9 return/exception points and mixed concerns including multiple resource location strategies (war file, META-INF/resources, alternate doc base..), directory listing / redirection handling, resource caching, error reporting, range handling, content type resolution and finally several seemingly different strategies for actually serving content.

Before adding any new features, this method needs some refactoring.

What to do? I mainly see two things:

1) We need to separating the concerns of looking up the resource, validating and handling errors for the resource and actually serving the resource.
2) The resource is served in different ways depending on content and use of ranges. The same "type" checks are done repeatedly using if statements.This could probably be split into one class per strategy using basic polymorphism.



 Comments   
Comment by Eirik Bjørsnøs [ 16/Jun/11 ]

The attached patch (GLASSFISH-16871-lookup-validation.patch) is an attempt at refactoring DefaultServlet.serveResource by:

  • Separating the concern of locating a CacheEntry into its own method lookupCacheEntry
  • Separating the validation and error handling into its own method hasValidationErrors

To do this, I had to do a couple of tweaks (in addtion to extract the methods):

  • The redirect if a directory is requested without a "/" in case of resources inside META-INF/lib/ jars was moved to the error handling method.
  • The write to the proxyHandler local variable when a META-INF/lib/ directory resource is requested has been replaced with setting the cacheEntry.context to be the FileDirContext. The creation of a ProxyDirContext wrapper around the FileContext was moved to the call of the render() method (which handles directory listings)
  • The check and handling for the situation where directory listings are suppressed was moved into the hasValidationErrors method.

This patch does not change the actual serving of the resource.

Comment by Eirik Bjørsnøs [ 23/Jun/11 ]

I also found the whole mixing of resource lookup and resource caching to be confusing.

The use of CacheEntry seems to indicate that the resource or at least its representation is cached in some way. However, when debugging I noticed that ProxyDirContext's cache field is only optional. By default, there seems to be no cache. Still, a CacheEntry is created and returned.

When implementing support for META-INF/resources lookups, the lookup results in an instance of the same CacheEntry class, without there ever being caching involved in the lookup. This really confused me.

A refactoring of this method should consider separating the lookup of a resource from the caching. That way, resources could be cached regardless of where they're looked up from (given that the source is cacheable, that is)





[GLASSFISH-16766] keep-state directive for web archives (WAR) not working when using OSGi redeployment Created: 31/May/11  Updated: 18/Oct/12

Status: Open
Project: glassfish
Component/s: OSGi-JavaEE, web_container
Affects Version/s: 3.1
Fix Version/s: future release

Type: New Feature Priority: Major
Reporter: asemt Assignee: Sanjeeb Sahoo
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: ee7ri_cleanup_deferred

 Description   

Environment:

  • Java EE6 Web Application (JSF 2)
  • Deployed as an OSGi bundle to Felix (into "GF_ROOT/domains/domain1/autodeploy/bundles")
  • Build by Maven Bundle Plug-In

When trying to preserve the HTTP session state in a JSF web application while redeploying the application as described in

http://download.oracle.com/docs/cd/E18930_01/html/821-2417/gkhtr.html
and
http://download.oracle.com/docs/cd/E18930_01/html/821-2418/beaha.html

there is always a javax.faces.application.ViewExpiredException thrown by the web container.
So I assume the keep-state directive is ignored by the web container.



 Comments   
Comment by Sanjeeb Sahoo [ 31/May/11 ]

Yes, this is known to us. I have turned your issue to an enhancement request and will look into it in release after 3.1.1. I understand this issue makes one spend more time in rapid development/deployment/testing cycle, but I hope this is not stopping you from making progress.

Comment by Tom Mueller [ 18/Oct/12 ]

Marking the fix version field as "future-release". This is based on an evaluation by John, Michael, and Tom WRT to the PRD for the Java EE 7 RI/SDK. This issue was deemed to not be a P1 for that release. If this is in error or there are other reasons why this RFE should be targeted for the Java EE 7 RI/SDK release, then change the fix version field back to an appropriate build.





[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-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-21160] Expose option to prevent Server header being set in the admin console Created: 07/Aug/14  Updated: 07/Aug/14

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

Type: Improvement Priority: Major
Reporter: smillidge-c2b2 Assignee: Shing Wai Chan
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

All


Tags: Fishcat

 Description   

Currently GlassFish exposes the Server: Header on all web requests with the value GlassFish Server Open Source Edition 4.1. This can only be disabled by setting the system property product.name to an empty value. Disabling of this option should be available in the administration console just like for x-PoweredBy






[GLASSFISH-21183] Web container still does not call AsynContext.complete() on timeout/exception Created: 03/Sep/14  Updated: 08/Jun/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!!



 Comments   
Comment by Vinay Vishal [ 05/Jun/15 ]

Hi,

If we look at the contract for AsyncContext.complete() method, it states that "Any listeners of type AsyncListener that were registered with the ServletRequest for which this AsyncContext was created will be invoked at their onComplete method." .

This indeed is happening right now :
from server.log

[2015-06-05T17:38:27.426+0530] [glassfish 4.1] [INFO] [] [] [tid: _ThreadID=139 _ThreadName=Thread-8] [timeMillis: 1433506107426] [levelValue: 800] [[
onError]]

[2015-06-05T17:38:27.426+0530] [glassfish 4.1] [INFO] [] [] [tid: _ThreadID=139 _ThreadName=Thread-8] [timeMillis: 1433506107426] [levelValue: 800] [[
onComplete]]

Is there any specific issue you are seeing here if AsyncContext.complete() is not being called. Can you please share the test case if any in that case?

Comment by patson [ 08/Jun/15 ]

Hi,

Many thanks for your reply!

It is certainly correct that onComplete methods of listeners are being called.

The problem for us however, is that we inject AOP calls around AsyncContext.complete() which we expect all java servlet containers would adhere to - http://docs.oracle.com/javaee/7/api/javax/servlet/AsyncContext.html.

Many thanks again!





[GLASSFISH-21085] Secure flag is missing from availability cookies JSESSIONIDVERSION and JREPLICA Created: 11/Jun/14  Updated: 11/Jun/14

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

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

glassfish running on debian linux with nginx frontend.



 Description   

This only happens with the cookies when availability is enabled. Otherwise those cookies aren't shown at all.

Secure flag is correct when the first query is made:

$ curl -ki https://localhost:8443/TestingTool1/

HTTP/1.1 200 OK
X-Powered-By: JSP/2.2
Server: GlassFish Server Open Source Edition 3.1.2.2
Set-Cookie: JSESSIONID=af5568c7921b8990e1273ef1e5c1; Path=/TestingTool1; Secure; HttpOnly
Set-Cookie: JSESSIONIDVERSION=2f54657374696e67546f6f6c31:0; Path=/TestingTool1; Secure; HttpOnly
Set-Cookie: JREPLICA=i1; Path=/TestingTool1; Secure; HttpOnly
Content-Type: text/html;charset=UTF-8
Content-Language: en
Transfer-Encoding: chunked
Date: Wed, 11 Jun 2014 12:44:32 GMT

but when the JSESSIONID is given in request, it is no longer in the response headers but the JSESSIONIDVERSION and JREPLICA are and without Secure-flag:

$ curl -ki -b "JSESSIONID=af5568c7921b8990e1273ef1e5c1; JSESSIONIDVERSION=2f54657374696e67546f6f6c31:0; JREPLICA=i1;" https://localhost:8443/TestingTool1/

HTTP/1.1 200 OK
X-Powered-By: JSP/2.2
Server: GlassFish Server Open Source Edition 3.1.2.2
Set-Cookie: JSESSIONIDVERSION=2f54657374696e67546f6f6c31:1; Path=/TestingTool1; HttpOnly
Set-Cookie: JREPLICA=i1; Path=/TestingTool1; HttpOnly
Content-Type: text/html;charset=UTF-8
Content-Language: en
Transfer-Encoding: chunked
Date: Wed, 11 Jun 2014 12:46:20 GMT

Could it be that when the cookie comes in request, the object is not created correctly so that it is marked isSecure (we've put in the cookie-properties that all cookies should be secure)?

if I remember correctly from OutputBuffer, there's a check on JSESSIONIDVERSION that if JSESSIONID is secure, then JSESSIONIDVERSION is also secured, but in this case I suppose that as it came from browser/in request it is not marked secure.

Not sure if this is major bug or not as it doesn't affect the applications but this does affect Security of applications.






[GLASSFISH-21084] Call to HttpServletResponse.flushBuffer() has no effect on GFv4 b89 Created: 10/Jun/14  Updated: 10/Jun/14

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

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

Tags: HttpServletResponse

 Description   

Calling HttpServletResponse#flushBuffer does not flush the Buffer to the Client.






[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-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-21067] ClassCastException: org.glassfish.web.ha.session.management.ReplicationWebEventPersistentManager cannot be cast to org.apache.catalina.session.StandardManager Created: 18/May/14  Updated: 18/May/14

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

Type: Bug Priority: Major
Reporter: Eng.Fouad Assignee: kshitiz_saxena
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

I have a cluster with 2 instances. When I deploy a web module on the cluster level and enable the option "Availability", the following exception occurs:

java.lang.Exception: java.lang.ClassCastException: org.glassfish.web.ha.session.management.ReplicationWebEventPersistentManager cannot be cast to org.apache.catalina.session.StandardManager
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:168)
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.enable(ApplicationLifecycle.java:2169)
at com.sun.enterprise.v3.server.ApplicationLifecycle.enable(ApplicationLifecycle.java:113)
at com.sun.enterprise.v3.server.ApplicationConfigListener.enableApplication(ApplicationConfigListener.java:272)
at com.sun.enterprise.v3.server.ApplicationConfigListener.handleOtherAppConfigChanges(ApplicationConfigListener.java:223)
at com.sun.enterprise.v3.server.ApplicationConfigListener.transactionCommited(ApplicationConfigListener.java:170)
at org.jvnet.hk2.config.Transactions$TransactionListenerJob.process(Transactions.java:365)
at org.jvnet.hk2.config.Transactions$TransactionListenerJob.process(Transactions.java:356)
at org.jvnet.hk2.config.Transactions$ListenerNotifier$1.call(Transactions.java:213)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at org.jvnet.hk2.config.Transactions$Notifier$1$1.run(Transactions.java:167)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
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:744)

It seems that the webapp cannot be started because of this line (com.sun.enterprise.web.WebModule:1752):

StandardManager manager = (StandardManager) getManager();

http://grepcode.com/file/maven.java.net/content/groups/promoted/org.glassfish.main.web/web-glue/4.0.1-b01/com/sun/enterprise/web/WebModule.java#WebModule.loadSessions%28java.util.Properties%29

`getManager()` returns a reference of type `org.glassfish.web.ha.session.management.ReplicationWebEventPersistentManager`, whereas it doesn't inherit from `org.apache.catalina.session.StandardManager`.






[GLASSFISH-21069] Clustered application does not work without web.xml Created: 23/May/14  Updated: 23/May/14

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

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

glassfish 4, AWS Linux


Tags: cluster, clustered, web-xml

 Description   

I was testing out a cluster setup on AWS and was getting errors trying to run bare bones application on the cluster. I was getting 200 OK responses, but no content for any request to my application:

[ec2-user@ip-10-0-0-248 glassfish]$ curl -v http://10.0.0.248:28080/simple/

  • Hostname was NOT found in DNS cache
  • Trying 10.0.0.248...
  • Connected to 10.0.0.248 (10.0.0.248) port 28080 (#0)
    > GET /simple/ HTTP/1.1
    > User-Agent: curl/7.36.0
    > Host: 10.0.0.248:28080
    > Accept: /
    >
    < HTTP/1.1 200 OK
    < X-Powered-By: Servlet/3.1 JSP/2.3 (GlassFish Server Open Source Edition 4.0 Java/Oracle Corporation/1.7)
  • Server GlassFish Server Open Source Edition 4.0 is not blacklisted
    < Server: GlassFish Server Open Source Edition 4.0
    < Date: Fri, 23 May 2014 18:47:44 GMT
    < Content-Length: 0

Looking at the logs for the node instances, I saw these for every request to the application:
[2014-05-23T18:41:16.728+0000] [glassfish 4.0] [WARNING] [realmAdapter.noWebSecMgr] [javax.enterprise.system.container.web.com.sun.web.security] [tid: _ThreadID=21 _ThreadName=http-listener-1(4)] [timeMillis: 1400870476728] [levelValue: 900] [[
WEB9100: No WebSecurityManager found for context simple-1.0-SNAPSHOT/simple-1_0-SNAPSHOT]

No errors during deployment or any other warnings. I could access the root context welcome page for both cluster instances fine. In order for the application to work I needed to add a (basically empty) web.xml. After that, and a redeploy it worked on the clustered instances fine.

Also, I was able to deploy this to non-clustered instance (the DAS managing the cluster) and it worked fine.



 Comments   
Comment by ender01 [ 23/May/14 ]

Also, I can't seem to create an attachment, but the example application was a new Maven based web application created through Netbeans 8.0. It was simply created and built, no changes or anything else added to it. Going to the context should bring up 'Hello World'.





[GLASSFISH-21057] CLONE -Provider a way to access SSO Session ID right after login using HttpServletRequest.login Created: 01/May/14  Updated: 01/May/14

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

Type: New Feature Priority: Major
Reporter: anjinappa Assignee: Shing Wai Chan
Resolution: Unresolved Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: SSOSessionID

 Description   

When SSO enabled. Sometime we need to get SSO Session ID right after we call HttpServletRequest.login(username, password). This method will change SSO Session ID internally but there is no way to access the new value of SSO session ID in Java code right after HttpServletRequest.login(username, password) called.

Suggested solution: use request attribute name "javax.servlet.request.sso_session_id" to store new SSO session id when login method called.






[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-20988] session replication occasionally not work on different physical machine Created: 18/Feb/14  Updated: 18/Feb/14

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

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

JDK1.7, Glassfish 3.1.2,apache 2.4.4



 Description   

I create a cluster using above mentioned enviroment. In this cluster, we have two different physical machine. We name them instance1 and instance2.
But the session replication between the two physical machine occasionally doesn't work. When the login request is sent to instance1, a session is created and the authentication information is stored in this session. When another new request for query data is forwarded by apache server to the instance2, the ssesion of instance1 is not correctly replicated from instance1. So there is no authentication information in instance2. Then the new request cannot query data from instance2.

I read before reported bugs for GF 3.1.1, and it indicates that this session replication lost bug has been fixed in GF 3.1.2. But for us, this bug is still exist. How can we fix this issue.

This is our glassfih-web.xml

<glassfish-web-app error-url="">
<context-root>/</context-root>

<session-config>
<session-manager persistence-type="replicated">
<manager-properties>
<property name="persistenceFrequency" value="time-based"/>
<property name="reapIntervalSeconds" value="30"/>
<property name="relaxCacheVersionSemantics" value="true"/>
</manager-properties>
<store-properties>
<property name="persistenceScope" value="session"/>
</store-properties>
</session-manager>
</session-config>
</glassfish-web-app>






[GLASSFISH-21055] Provider a way to access SSO Session ID right after login using HttpServletRequest.login Created: 01/May/14  Updated: 01/May/14

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

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

Tags: SSOSessionID

 Description   

When SSO enabled. Sometime we need to get SSO Session ID right after we call HttpServletRequest.login(username, password). This method will change SSO Session ID internally but there is no way to access the new value of SSO session ID in Java code right after HttpServletRequest.login(username, password) called.

Suggested solution: use request attribute name "javax.servlet.request.sso_session_id" to store new SSO session id when login method called.






[GLASSFISH-21410] Invalidating Session using POST via JAX-RS creates IOException Created: 09/Aug/15  Updated: 09/Aug/15

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

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


 Description   

Given the following sample code

@Path("session")
@Stateless
public class Resource2 {

@GET
@Path("create")
public Response create(@Context HttpServletRequest req)

{ req.getSession().setAttribute("foo", "bar"); return Response.ok(req.getSession().getAttribute("foo")).build(); }

@POST
@Path("invalidate")
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
public Response invalidate(@Context HttpServletRequest req,
@FormParam("foo") String foo)

{ HttpSession session = req.getSession(false); Object foox = session.getAttribute(foo); session.invalidate(); return Response.temporaryRedirect(URI.create("http://slashdot.org/")).build(); }

}

I get the following stack trace

java.io.IOException
at org.glassfish.grizzly.http.io.InputBuffer.skip(InputBuffer.java:721)
at org.glassfish.grizzly.http.server.Request.skipPostBody(Request.java:2078)
at org.glassfish.grizzly.http.server.Request.parseRequestParameters(Request.java:2032)
at org.glassfish.grizzly.http.server.Request.getParameter(Request.java:1066)
at org.apache.catalina.connector.Request.getParameter(Request.java:1552)
at org.apache.catalina.connector.RequestFacade.getParameter(RequestFacade.java:448)
at org.jboss.weld.servlet.ConversationContextActivator.determineConversationId(ConversationContextActivator.java:182)
at org.jboss.weld.context.http.LazyHttpConversationContextImpl.checkContextInitialized(LazyHttpConversationContextImpl.java:93)
at org.jboss.weld.context.http.LazyHttpConversationContextImpl.destroy(LazyHttpConversationContextImpl.java:85)
at org.jboss.weld.context.http.HttpSessionContextImpl.destroy(HttpSessionContextImpl.java:59)
at org.jboss.weld.servlet.HttpContextLifecycle.sessionDestroyed(HttpContextLifecycle.java:152)
at org.jboss.weld.servlet.WeldInitialListener.sessionDestroyed(WeldInitialListener.java:133)
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 net.trajano.test.Resource2.invalidate(Resource2.java:44)

The invalidation seems to be asynchronous since the redirect still works. And it seems that the POST content stream was already closed by the time it reaches InputBuffer.skip.

Perhaps it shouldn't throw an IOException and instead if it is closed just silently not read any more data?






[GLASSFISH-21409] Encoding mapping key search error Created: 07/Aug/15  Updated: 07/Aug/15

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

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

Linux Fedora 22, jdk8, glassfish-4.1, LC_NAME="ru_RU.UTF-8"


Tags: config, encoding

 Description   

Method getCharset of class org.apache.catalina.util.CharsetMapper does mot recognise locale string if it consists of parts separated by "-". As a result <locale-encoding-mapping-list> setting of web.xml is not working properly.






[GLASSFISH-21405] Redirect Location: header is not url-encoded Created: 06/Aug/15  Updated: 06/Aug/15

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

Type: Bug Priority: Major
Reporter: mahairod Assignee: Shing Wai Chan
Resolution: Unresolved Votes: 0
Labels: encoding, location, redirect, url
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: encoding, redirect, url

 Description   

Location: header of redirect is not url-encoded. As a result symbols are truncated in transport layer to prevent invalid MIME-header format.






[GLASSFISH-21390] The message of 「PWC4011: Unable to set request character encoding」 does not output. Created: 08/Jul/15  Updated: 21/Jul/15

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

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

linux



 Description   

Access the servlet which contains the following source.


String param1 = request.getParameter("KEY");
request.setCharacterEncoding("UTF-8");


The result of GlassfishV3:
① The Exception of「PWC4011: Unable to set request character encoding」happens.
②"UTF-8" has not been set suceesssfully.

The result of GlassfishV4:
① The Exception of「PWC4011: Unable to set request character encoding」does not happen. ★
② "UTF-8" has not been set suceesssfully.

★ is V4 different from V3

Reason:
requestParametersParsed has been deleted in V4 source.

The source of V4

Class:web\web-core\src\main\java\org\apache\catalina\connector\Request.java
method: setCharacterEncoding
        if (usingReader) {
            String contextName =
                getContext() != null ? getContext().getName() : "UNKNOWN";
            log.log(Level.WARNING, UNABLE_SET_REQUEST_CHARS, new Object[] {enc, contextName});
            return;
        }

The source of V3

Class:web\web-core\src\main\java\org\apache\catalina\connector\Request.java
method: setCharacterEncoding
        if (requestParametersParsed || usingReader) {
            String contextName =
                    (getContext() != null ? getContext().getName() : "UNKNOWN");
            log.warning(sm.getString("coyoteRequest.setCharacterEncoding.ise",
                    enc, contextName));
            return;
        }

The message of 「PWC4011: Unable to set request character encoding」 does not output.
It is mistake? It is pattern changed?



 Comments   
Comment by Vinay Vishal [ 21/Jul/15 ]

Servlet spec 3.1 in section 3.11 does mention that "setCharacterEncoding(String enc) must be called prior to parsing any post data or reading any input from the request. Calling this method once data has been read will not affect the encoding." , there is no explicit mention about warning message to be logged in such case. Will further analyse and update in due course.





[GLASSFISH-21386] Asynchronous servlet API gives a user HTTP listener threads Created: 07/Jul/15  Updated: 07/Jul/15

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

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


 Description   

Servet ReadListener#onDataAvailable and possibly other asynchronous Servlet APIs are invoked on HTTP listener threads. If a user blocks those threads (for instance by calling JDBC), Glassfish freezes.






[GLASSFISH-21374] Custom Valve added without context Created: 11/Jun/15  Updated: 11/Jun/15

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

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

Tags: valve

 Description   

Adding a custom valve (via the glassfish-web.xml) in which the custom class implements both org.apache.catalina.Valve and org.glassfish.web.valve.GlassFishValve results in the custom class being erroneously wrapped in the GlassFishValveAdapter. This means that the valve no longer implements any interfaces since the Adapter doesn't implement any interfaces. In particular the interfaces Contained and Lifecycle are lost when wrapped. If for example you are attempting to use the org.apache.catalina.authenticator.SpnegoAuthenticator from Tomcat (modified slightly) in GlassFish the valve will fail to invoke with a NullPointerException due to the context not being set. The context isn't set because the Contained interface is masked once the class is wrapped in the adapter.

There are actually two things going wrong, any one of which would solve the problem:

1. There are two addValve methods in org.apache.catalina.core.StandardPipeline, one for Valve and one for GlassFishValve. If the Valve method is called it will result in wrapping in an adapter. The com.sun.enterprise.web.WebModule.addValve(String className) is responsible for loading custom valves and it first checks if the valve is a Valve then calls the addValve(Valve) method, and only uses the addValve(GlassFishValve) if the first check fails. The order of these if statements should be reversed.

2. The addValve(Valve) method should check if the Valve is a GlassFishValve and call the addValve(GlassFishValve) method. It actually does a check using reflection and method signature to determined if the Valve is a legacy GlassFish specific version of org.apache.catalina.Valve (different than current version - yes apparently they changed the interface in the past!) and wraps in an adapter if it is. However, that legacy version of Valve looks like the new GlassFishValve (in my case it looks like it because it actually is it – the check does not check if the class actually IS GlassFishValve).



 Comments   
Comment by slominskir [ 11/Jun/15 ]

The title of this should be "Custom Valve Erroneously Wrapped in GlassFishValveAdaptor". However, looks like editing is not available. Also the sentence that reads "doesn't implement any interfaces" should read "doesn't implement any interfaces except GlassFishValve".

Comment by slominskir [ 11/Jun/15 ]

The "work around" is to create another custom valve that wraps the real valve and the custom valve wrapper implements all interfaces except org.apache.catalina.Valve.

Comment by slominskir [ 11/Jun/15 ]

See https://java.net/jira/browse/GLASSFISH-21373 about how this came about.





[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-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-21303] A class annotated with both WebService and WebServlet causes deployment failure. Created: 09/Feb/15  Updated: 28/Jul/15

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

Type: Bug Priority: Major
Reporter: jjsnyder83 Assignee: Vinay Vishal
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.



 Comments   
Comment by Vinay Vishal [ 30/Jun/15 ]

Can you please attach sample war?

Comment by Vinay Vishal [ 01/Jul/15 ]

I wrote a sample application with the same annotations as specified in the bug description and I am getting following exception:

Servlet [TranslatorEndpoint] and Servlet [org.jboss.cdi.tck.tests.lookup.injection.non.contextual.TranslatorEndpoint] have the same url pattern: [/Translator]. Related annotation information: annotation [@javax.jws.WebService(wsdlLocation=, endpointInterface=org.jboss.cdi.tck.tests.lookup.injection.non.contextual.Translator, targetNamespace=, portName=, name=, serviceName=Translator)] on annotated element [class org.jboss.cdi.tck.tests.lookup.injection.non.contextual.TranslatorEndpoint] of type [TYPE].

This is happening because there already exist a class with the same name as TranslatorEndPoint having same url pattern as specified in the bug.

Here is the sample class written to reproduce this issue:

TranslatorEndPoint.java
@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 {

@WebMethod
public String translate(){

System.out.println("translate");
return "translate";
}

maven dependency:

cdi-tck-impl / version 1.2.5.Final

Please provide the sample war and error log from server.log file to be able to reproduce and debug this issue.

Comment by jjsnyder83 [ 01/Jul/15 ]

It appears that this has been fixed somehow. The cdi tck test that was failing due to this is now passing. Perhaps this was fixed by some other change. In any case I cannot reproduce the issue anymore.

Comment by Vinay Vishal [ 02/Jul/15 ]

Ok, thanks for the update. Please open a new bug or re-open the same if you happen to see this issue again.

Comment by tremes [ 27/Jul/15 ]

I can still reproduce this bug (at least partially) with CDI TCK. and glassfish-4.1-b13-03_18_2015. Unfortunately I cannot attach anything to this issue.

Caused by: java.io.IOException: Server returned HTTP response code: 405 for URL: http://localhost:8080/2a1f6f6da8c03555e9ff54777d4beaf8489c3d7/translator?wsdl
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1839)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1440)
	at java.net.URL.openStream(URL.java:1038)
	at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.createReader(RuntimeWSDLParser.java:984)
	at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.resolveWSDL(RuntimeWSDLParser.java:385)
	at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:216)
Comment by jjsnyder83 [ 27/Jul/15 ]

You need to use a relatively new build. the one you're using is from 3/18/2015 which apparently doesn't contain the fixes.

Comment by tremes [ 28/Jul/15 ]

Sorry but it doesn't matter. I copy/paste just bad version. In fact I was using glassfish-4.1-b14-07_26_2015. The TCK test is passing now but when you remove servlet definition from web.xml and you use @WebServlet then you will see the error above.

Comment by jjsnyder83 [ 28/Jul/15 ]

If you feel this is still a bug please reopen the issue or enter a new one and assign the component to web_container and web_services. This is not a CDI issue.

Comment by tremes [ 28/Jul/15 ]

Yes it's not a CDI issue. Unfortunately I don't have permissions to reopen it.

Comment by jjsnyder83 [ 28/Jul/15 ]

Ok I reopened it for you.





[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-21295] Some EE7 APIs missing during JSP compilation Created: 03/Feb/15  Updated: 26/Jun/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: