Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0003564 [Resin] minor always 06-17-09 15:54 06-18-09 12:14
Reporter ferg View Status public  
Assigned To ferg
Priority normal Resolution fixed  
Status closed   Product Version 4.0.1
Summary 0003564: CanDI wrapping issue with scope
Description (rep by wesley)


Environment:
Resin 4.0.0
JDK: Sun JDK 1.6.0_14 x64 or JRockit 1.6.0_11 x64

================ test.TestServlet ===============================
package test;

import javax.servlet.*;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.inject.Current;
import java.io.IOException;

public class TestServlet extends HttpServlet {
@Current
TestBean bean;

@Override
protected void doGet(HttpServletRequest req, HttpServletResponse res)
 throws ServletException, IOException {
res.getWriter().write("Hello world");
}
}

================ test.TestBean ===============================
package test;

import javax.context.RequestScoped;

@RequestScoped
public class TestBean {

public String evilMethod(int a, int b, String c, int d) {
return "I'm evil";
}

public String evilMethod2(int a, int b, int d, String c) {
return "I'm evil too";
}

public String goodMethod(int a, int b, String c) {
return "I'm good";
}
}

=================================================
When running this servlet at http://localhost:8080/TestServlet [^] (mapped to /TestServlet in web.xml)

Resin generate exceptions:

error stack 1:

javax.servlet.ServletException: java.lang.VerifyError: (class: test/TestBean$ScopeProxy, method: evilMethod signature: (IILjava/lang/String;I)Ljava/lang/String;) Register 0 contains wrong type
at com.caucho.server.dispatch.ServletConfigImpl.createServlet(ServletConfigImpl.java:848)
at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:95)
at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:452)
at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:87)
at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:87)
at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:185)
at com.caucho.server.cache.CacheFilterChain.doFilter(CacheFilterChain.java:201)
at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:264)
at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:275)
at com.caucho.server.port.TcpConnection.handleRequests(TcpConnection.java:644)
at com.caucho.server.port.TcpConnection$AcceptTask.doAccept(TcpConnection.java:1311)
at com.caucho.server.port.TcpConnection$AcceptTask.run(TcpConnection.java:1252)
at com.caucho.util.ThreadPool$PoolThread.runTasks(ThreadPool.java:866)
at com.caucho.util.ThreadPool$PoolThread.run(ThreadPool.java:779)
Caused by: java.lang.VerifyError: (class: test/TestBean$ScopeProxy, method: evilMethod signature: (IILjava/lang/String;I)Ljava/lang/String;) Register 0 contains wrong type
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
at java.lang.Class.getConstructors(Class.java:1459)
at com.caucho.config.bytecode.ScopeAdapter.generateProxy(ScopeAdapter.java:163)
at com.caucho.config.bytecode.ScopeAdapter.<init>(ScopeAdapter.java:59)
at com.caucho.config.bytecode.ScopeAdapter.create(ScopeAdapter.java:64)
at com.caucho.config.inject.SimpleBean.getScopeAdapter(SimpleBean.java:450)
at com.caucho.config.inject.InjectManager.getInstanceToInject(InjectManager.java:1454)
at com.caucho.config.program.FieldComponentProgram.inject(FieldComponentProgram.java:91)
at com.caucho.config.inject.ComponentImpl.createNoInit(ComponentImpl.java:316)
at com.caucho.server.dispatch.ServletConfigImpl.createServletImpl(ServletConfigImpl.java:895)
at com.caucho.server.dispatch.ServletConfigImpl.createServlet(ServletConfigImpl.java:810)
... 14 more


error stack 2 (with evilMethod commented):

javax.servlet.ServletException: java.lang.VerifyError: (class: test/TestBean$ScopeProxy, method: evilMethod2 signature: (IIILjava/lang/String;)Ljava/lang/String;) Expecting to find object/array on stack
at com.caucho.server.dispatch.ServletConfigImpl.createServlet(ServletConfigImpl.java:848)
at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:95)
at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:452)
at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:87)
at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:87)
at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:185)
at com.caucho.server.cache.CacheFilterChain.doFilter(CacheFilterChain.java:201)
at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:264)
at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:275)
at com.caucho.server.port.TcpConnection.handleRequests(TcpConnection.java:644)
at com.caucho.server.port.TcpConnection$AcceptTask.doAccept(TcpConnection.java:1311)
at com.caucho.server.port.TcpConnection$AcceptTask.run(TcpConnection.java:1252)
at com.caucho.util.ThreadPool$PoolThread.runTasks(ThreadPool.java:866)
at com.caucho.util.ThreadPool$PoolThread.run(ThreadPool.java:779)
Caused by: java.lang.VerifyError: (class: test/TestBean$ScopeProxy, method: evilMethod2 signature: (IIILjava/lang/String;)Ljava/lang/String;) Expecting to find object/array on stack
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
at java.lang.Class.getConstructors(Class.java:1459)
at com.caucho.config.bytecode.ScopeAdapter.generateProxy(ScopeAdapter.java:163)
at com.caucho.config.bytecode.ScopeAdapter.<init>(ScopeAdapter.java:59)
at com.caucho.config.bytecode.ScopeAdapter.create(ScopeAdapter.java:64)
at com.caucho.config.inject.SimpleBean.getScopeAdapter(SimpleBean.java:450)
at com.caucho.config.inject.InjectManager.getInstanceToInject(InjectManager.java:1454)
at com.caucho.config.program.FieldComponentProgram.inject(FieldComponentProgram.java:91)
at com.caucho.config.inject.ComponentImpl.createNoInit(ComponentImpl.java:316)
at com.caucho.server.dispatch.ServletConfigImpl.createServletImpl(ServletConfigImpl.java:895)
at com.caucho.server.dispatch.ServletConfigImpl.createServlet(ServletConfigImpl.java:810)
... 14 more


servlet is good when evilMethod and evilMethod2 were both commented.

I believe this is due to a bug in com.caucho.bytecode.JavaClass.

Additional Information
Attached Files

- Relationships

- Notes
(0004080)
ferg
06-18-09 12:14

ioc/0516
 

- Issue History
Date Modified Username Field Change
06-17-09 15:54 ferg New Issue
06-18-09 12:14 ferg Note Added: 0004080
06-18-09 12:14 ferg Assigned To  => ferg
06-18-09 12:14 ferg Status new => closed
06-18-09 12:14 ferg Resolution open => fixed
06-18-09 12:14 ferg Fixed in Version  => 4.0.1


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
28 total queries executed.
25 unique queries executed.
Powered by Mantis Bugtracker