You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Joerg Latteier <la...@online.de> on 2005/05/02 22:47:50 UTC

ClassCastException in setupForRequest() [HELP...]

Hi ,

we are facing a serious problem at a customer's production site, which makes
it hard 
for us to debug. We are getting a ClassCastException in setupForRequest at

            _propertySource = (IPropertySource)
servletContext.getAttribute(name);

The message is "Tapestry unable to begin processing request." The problem is
that 
from that point on all requests from all sessions do fail.
I am 99,99% sure this is a problem in our application and not in tapestry,
but 
any hint what could cause this would be greatly appreciated as at the moment
we 
don't have any idea... Could a problem with our handling of the Global
object
be the cause ?

Thanks
Joerg


Source Extract from : org.apache.tapestry.engine.AbstractEngine

    protected void setupForRequest(RequestContext context)
    ...
        if (_propertySource == null)
        {
            String name = PROPERTY_SOURCE_NAME + ":" + servletName;

            _propertySource = (IPropertySource)
servletContext.getAttribute(name);

            if (_propertySource == null)
            {
                _propertySource = createPropertySource(context);

                servletContext.setAttribute(name, _propertySource);
            }
        }

Log file Extract :

...
2005-05-02 09:56:10,112 DEBUG [ExecuteThread: '12' for queue:
'weblogic.kernel.Default'] org.apache.tapestry.engine.AbstractEngine(808) -
Begin service /app
2005-05-02 09:56:10,116 WARN  [ExecuteThread: '12' for queue:
'weblogic.kernel.Default'] org.apache.tapestry.engine.AbstractEngine(491) -
Tapestry unable to begin processing request.
java.lang.ClassCastException
	at
org.apache.tapestry.engine.AbstractEngine.setupForRequest(AbstractEngine.jav
a:1244)
	at
org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:824)
	at
org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.java:197
)
	at
org.apache.tapestry.ApplicationServlet.doGet(ApplicationServlet.java:158)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at
weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(Servle
tStubImpl.java:971)
	at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:402)
	at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
	at
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
	at
org.apache.tapestry.RedirectFilter.doFilter(RedirectFilter.java:106)
	at
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
	at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(W
ebAppServletContext.java:6356)
	at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubjec
t.java:317)
	at
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
	at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
ntext.java:3635)
	at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
:2585)
	at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
	at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)


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


Tapestry unable to begin processing request.


      Session id:
C2FzsJk5Sdn2yI1J1sQ2r8wUb9EFKn3QZQl9oT7miNbM0mbL2Dc2!1122732954!111504734767
8
  Client address: 57.22.241.144

Exceptions:

java.lang.ClassCastException
org.apache.tapestry.engine.AbstractEngine.setupForRequest(AbstractEngine.jav
a:1244)
org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:824)
org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.java:197
)
org.apache.tapestry.ApplicationServlet.doGet(ApplicationServlet.java:158)
javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(Servle
tStubImpl.java:971)
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:402)
weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
org.apache.tapestry.RedirectFilter.doFilter(RedirectFilter.java:106)
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(W
ebAppServletContext.java:6356)
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubjec
t.java:317)
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
ntext.java:3635)
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
:2585)
weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)

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

<May 2, 2005 9:56:10 AM MDT> <Error> <HTTP> <BEA-101046>
<[ServletContext(id=24193336,name=mymint,context-path=)] MyMint:
ServletException
javax.servlet.ServletException
	at
org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:834)
	at
org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.java:197
)
	at
org.apache.tapestry.ApplicationServlet.doGet(ApplicationServlet.java:158)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at
weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(Servle
tStubImpl.java:971)
	at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:402)
	at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
	at
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
	at
org.apache.tapestry.RedirectFilter.doFilter(RedirectFilter.java:106)
	at
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
	at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(W
ebAppServletContext.java:6356)
	at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubjec
t.java:317)
	at
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
	at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
ntext.java:3635)
	at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
:2585)
	at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
	at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
> 


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


javax.servlet.ServletException

java.lang.ClassCastException
org.apache.tapestry.engine.AbstractEngine.setupForRequest(AbstractEngine.jav
a:1244)
org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:824)
org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.java:197
)
org.apache.tapestry.ApplicationServlet.doGet(ApplicationServlet.java:158)
javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(Servle
tStubImpl.java:971)
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:402)
weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
org.apache.tapestry.RedirectFilter.doFilter(RedirectFilter.java:106)
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(W
ebAppServletContext.java:6356)
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubjec
t.java:317)
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
ntext.java:3635)
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
:2585)
weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)

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

<May 2, 2005 9:56:10 AM MDT> <Error> <HTTP> <BEA-101017>
<[ServletContext(id=24193336,name=mymint,context-path=)] Root cause of
ServletException.
java.lang.ClassCastException
	at
org.apache.tapestry.engine.AbstractEngine.setupForRequest(AbstractEngine.jav
a:1244)
	at
org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:824)
	at
org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.java:197
)
	at
org.apache.tapestry.ApplicationServlet.doGet(ApplicationServlet.java:158)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at
weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(Servle
tStubImpl.java:971)
	at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:402)
	at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
	at
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
	at
org.apache.tapestry.RedirectFilter.doFilter(RedirectFilter.java:106)
	at
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
	at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(W
ebAppServletContext.java:6356)
	at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubjec
t.java:317)
	at
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
	at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
ntext.java:3635)
	at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
:2585)
	at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
	at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: ClassCastException in setupForRequest() [HELP...]

Posted by Michael Musson <mu...@gmail.com>.
Debugging class loader problems is not fun. Keep in mind that if the
same class is loaded by two different class loaders, the two instances
of the class are not considered the same by Java even though they are
literally the same class. This is easier to do than it may seem on the
surface.

So in this case if the object was created through one class loader and
the cast occurs in the context of a different class loader, you will
get the cast exception.

Mike

On 5/2/05, Johan Maasing <jo...@zoom.nu> wrote:
> I do not have any good ideas but I recognize the situation (non-tapestry
> app). In our case the web application was unloaded, replaced with a new
> version and then re-deployed. Since weblogic was running the whole time
> the JVM was never interrupted. This caused problems with our property
> classes. They were static singletons so they were not unloaded when the
> web application was unloaded. However, the new version of the
> application changed the property classes. This meant that that the
> classloader considered the old live instances not the same class as the
> new versions. So, I guess that a question would be if your problems
> occurs on a newly started server or only when you have restarted an
> application?

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: ClassCastException in setupForRequest() [HELP...]

Posted by Johan Maasing <jo...@zoom.nu>.
> Hi ,
> 
> we are facing a serious problem at a customer's production site, which makes
> it hard 
> for us to debug. We are getting a ClassCastException in setupForRequest at
> 
>             _propertySource = (IPropertySource)
> servletContext.getAttribute(name);

I do not have any good ideas but I recognize the situation (non-tapestry 
app). In our case the web application was unloaded, replaced with a new 
version and then re-deployed. Since weblogic was running the whole time 
the JVM was never interrupted. This caused problems with our property 
classes. They were static singletons so they were not unloaded when the 
web application was unloaded. However, the new version of the 
application changed the property classes. This meant that that the 
classloader considered the old live instances not the same class as the 
new versions. So, I guess that a question would be if your problems 
occurs on a newly started server or only when you have restarted an 
application?

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org