You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2013/10/02 14:57:30 UTC

[Bug 55618] New: Possible class loading issue in tomcat 8 RC3..?

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

            Bug ID: 55618
           Summary: Possible class loading issue in tomcat 8 RC3..?
           Product: Tomcat 8
           Version: 8.0.0-RC3
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: regression
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: sander.sonajalg@gmail.com

Hi,

I'm looking at the Tomcat 8.0.0-RC3 release and trying to make sure that our
product (ZeroTurnaround's JRebel) still works nicely against it.

While testing out framework integrations, I came across an issue with JBoss
Seam 2 (present for all 2.0, 2.1 and 2.2). Yes, sorry, of course you are not
Seam support forum, but I have reasons to believe that the error I'm getting is
a symptom of some sort of a regression in Tomcat 8 as compared to Tomcat 7..
something not specific to Seam, although I cannot put my finger on it right
now.

The application I'm attaching is basically our integration test that we run for
numerous containers. It is a very simple maven build.. you'll get it deployed
in 60 seconds. Yes, Seam is mainly meant to be run on JBoss itself, but it has
been running quite well across a whole bunch of containers. This application
works in our integration test suite against numerous webspheres, glassfishes,
weblogics, etc, and also on various versions of Tomcat 6.x and 7.x. If you run
it on Tomcat 8 RC3, you'll get

/../

02-Oct-2013 15:30:09.879 WARNING [localhost-startStop-2]
org.jboss.seam.jsf.SeamPhaseListener.<init> There should only be one Seam phase
listener per application

/../


02-Oct-2013 15:30:12.539 WARNING [http-nio-8080-exec-2]
org.jboss.seam.jsf.SeamPhaseListener.afterPhase uncaught exception, passing to
exception handler
 java.lang.IllegalStateException: No phase id bound to current thread (make
sure you do not have two SeamPhaseListener instances installed)
    at org.jboss.seam.contexts.PageContext.getPhaseId(PageContext.java:163)
        ...


It is a Seam-specific error that happens quite typically (if you google for
it).. when people forget 2 seam libraries into the classpath or something like
that. In current case, you can obviously see that there is just 1 seam library
in classpath.

Yes this is just a symptom, but I have a feeling that something in the way
classes get loaded or in your class loader hierarchies is .. at least not how
it used to be. Maybe your implementation is 100% compatible with the JEE spec
and maybe just Seam guys are taking advantage of something non-standard. But..
maybe not, as this application is not suffering from this issue in 20+ other
web containers we test against in our company.

I'd be happy if you could take a quick look into this or at least give me some
hint where to start from... have you changed something in the way classes get
loaded since tomcat 7? (Read changelog, didn't find much). Thanks if you can
look into this! :)

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 55618] Listener in web.xml leads to duplicate Listener start in tomcat 8 RC3..?

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55618

Sander Sõnajalg <sa...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Possible class loading      |Listener in web.xml leads
                   |issue in tomcat 8 RC3..?    |to duplicate Listener start
                   |                            |in tomcat 8 RC3..?

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 55618] Listener in web.xml leads to duplicate Listener start in tomcat 8 RC3..?

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55618

--- Comment #8 from Christopher Schultz <ch...@christopherschultz.net> ---
Then there's the fun case where your application behaves completely differently
based upon which (maximum) version of the servlet spec your container supports.
No annotation support? Then you need to use web.xml. Uses Tomcat 8's SCI
strategy? Need to remove from web.xml. Want to deploy anywhere? Forget it.

I really think the servlet EG made a terrible mistake when they didn't let the
deployment descriptor (i.g. web.xml) direct the features that would be
available/enabled for a webapp. </soapbox>

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 55618] Possible class loading issue in tomcat 8 RC3..?

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55618

--- Comment #3 from Sander Sõnajalg <sa...@gmail.com> ---
Hi,
Thanks for suggestion,
This is indeed possible, but would this also explain the different behavior on
Tomcat8-RC3 vs Tomcat 7.x? This same app is okay elsewhere.

Sander.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 55618] Possible class loading issue in tomcat 8 RC3..?

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55618

--- Comment #4 from Mark Thomas <ma...@apache.org> ---
Tomcat 8 has refactored the SCI discovery process.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 55618] Possible class loading issue in tomcat 8 RC3..?

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55618

--- Comment #1 from Sander Sõnajalg <sa...@gmail.com> ---
Created attachment 30900
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=30900&action=edit
maven seam2.2 test app that fails on request to "/" on tomcat 8 rc3

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 55618] Listener in web.xml leads to duplicate Listener start in tomcat 8 RC3..?

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55618

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #7 from Mark Thomas <ma...@apache.org> ---
This is the change that caused this:
http://svn.apache.org/viewvc?view=revision&revision=1492307

Prior to this change, duplicate listeners with the same name were ignored. Now,
only duplicate instances are ignored.

Arguably, no duplicates should be ignored. The specification discusses how
duplicates should be handled when merging fragments but makes no comment on
deliberate duplicate listener definition (e.g. same listener twice in web.xml,
listener once in web.xml and once via an SCI)

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 55618] Possible class loading issue in tomcat 8 RC3..?

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55618

--- Comment #2 from Mark Thomas <ma...@apache.org> ---
I haven't looked at this yet but what are the chances that you are seeing a
double initialization because the library ships with an
ServletContainerInitializer that does one init and the web.xml has configured a
ServletContextListener that attempts to do a second init?

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 55618] Listener in web.xml leads to duplicate Listener start in tomcat 8 RC3..?

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55618

--- Comment #9 from Sebb <se...@apache.org> ---
(In reply to Mark Thomas from comment #7)
> This is the change that caused this:
> http://svn.apache.org/viewvc?view=revision&revision=1492307
> 
> Prior to this change, duplicate listeners with the same name were ignored.
> Now, only duplicate instances are ignored.

Would it be worth logging a warning when the behaviour is different from
before?

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 55618] Possible class loading issue in tomcat 8 RC3..?

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55618

--- Comment #6 from Sander Sõnajalg <sa...@gmail.com> ---
Hi,
I'm now quite sure that it is the <listener> definition in web.xml. I'll do
some more research.. it seems that tomcat 6.x/7.x detected the duplicate
Listener instance and didn't execute it, while tomcat 8.x starts a duplicate
Listener (I'm far from being competent enough here to say which approach is
more desired.. you probably know it better). I'll test some more on my own... I
just hope that the situation is not that old containers *require* <listener>
element to be there and new ones *require it not to be there*, which would lead
to a backwards compatibility problem. I'll research some more ..

Thanks!

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 55618] Possible class loading issue in tomcat 8 RC3..?

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55618

--- Comment #5 from Sander Sõnajalg <sa...@gmail.com> ---
Hi,
yeah that sounds like a possible explanation.. I'll look into this. Thanks!

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org