Mantis Bugtracker
  

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0004467 [Resin] major always 03-01-11 07:10 04-04-11 18:04
Reporter andreaskaltenbach View Status public  
Assigned To emil
Priority normal Resolution unable to reproduce Platform
Status closed   OS
Projection none   OS Version
ETA none Fixed in Version Product Version 4.0.16
  Product Build
Summary 0004467: Resin unable to compile typed interfaces for stateless session beans
Description Assume the following setup:

public interface Importer<T> {
  void doImport(T t);
}

@Stateless
public ImporterImpl implements Importer<String> {
  public void doImport(String t);
}

---

When setting up the EJBs, Resin fails with the following message:

java.lang.IllegalStateException: AnnotatedMethodImpl[public abstract void Importer.doImport(java.lang.Object)] does not have a matching base method in {1}

Internally, AnnotatedTypeUtil compares the two parameter lists but returns that doImport(T t) and doImport(String t) do not match. Reason is that a comparison of the java.lang.Class 'String' with a java.lang.reflect.TypeVariable is done (AnnotatedTypeUtil.isMatch(List<AnnotatedParameter<?>>, List<AnnotatedParameter<?>>)). Instead for comparing those types, the TypeVariable's bounds have to compared.

A workaround is to not use typed interfaces, but this a big limitiation in designing services.

Steps To Reproduce
Additional Information Full stack trace:

at com.caucho.ejb.gen.SessionGenerator.introspectMethod(SessionGenerator.java:244)
                                   at com.caucho.ejb.gen.SessionGenerator.introspectType(SessionGenerator.java:226)
                                   at com.caucho.ejb.gen.SessionGenerator.introspect(SessionGenerator.java:206)
                                   at com.caucho.ejb.gen.StatelessGenerator.introspect(StatelessGenerator.java:177)
                                   at com.caucho.ejb.session.AbstractSessionManager.bind(AbstractSessionManager.java:251)
                                   at com.caucho.ejb.manager.EjbManager.bind(EjbManager.java:540)
                                   at com.caucho.ejb.manager.EjbManager.environmentBind(EjbManager.java:662)
                                   at com.caucho.loader.EnvironmentClassLoader.bind(EnvironmentClassLoader.java:864)
                                   at com.caucho.loader.EnvironmentClassLoader.start(EnvironmentClassLoader.java:883)
                                   at com.caucho.server.webapp.WebApp.start(WebApp.java:3109)
                                   at com.caucho.env.deploy.DeployController.startImpl(DeployController.java:630)
                                   at com.caucho.env.deploy.StartAutoRedeployAutoStrategy.startOnInit(StartAutoRedeployAutoStrategy.java:77)
                                   at com.caucho.env.deploy.DeployController.startOnInit(DeployController.java:493)
                                   at com.caucho.env.deploy.DeployContainer.start(DeployContainer.java:171)
                                   at com.caucho.server.webapp.WebAppContainer.start(WebAppContainer.java:713)
                                   at com.caucho.server.host.Host.start(Host.java:676)
                                   at com.caucho.env.deploy.DeployController.startImpl(DeployController.java:630)
                                   at com.caucho.env.deploy.StartAutoRedeployAutoStrategy.startOnInit(StartAutoRedeployAutoStrategy.java:77)
                                   at com.caucho.env.deploy.DeployController.startOnInit(DeployController.java:493)
                                   at com.caucho.env.deploy.DeployContainer.start(DeployContainer.java:171)
                                   at com.caucho.server.host.HostContainer.start(HostContainer.java:542)
                                   at com.caucho.server.cluster.Server.start(Server.java:1225)
                                   at com.caucho.server.cluster.ServletService.start(ServletService.java:72)
                                   at com.caucho.env.service.ResinSystem.startServices(ResinSystem.java:508)
                                   at com.caucho.env.service.ResinSystem.start(ResinSystem.java:476)
                                   at com.caucho.server.resin.Resin.start(Resin.java:892)
                                   at com.caucho.server.resin.Resin.initMain(Resin.java:1020)
                                   at com.caucho.server.resin.Resin.main(Resin.java:1297)
                                   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)
Attached Files  quickfix_for_resin_issue_#4467.patch [^] (19,799 bytes) 03-02-11 06:29

- Relationships

- Notes
(0005144)
andreaskaltenbach
03-02-11 06:30

Uploaded a quickfix:
-differentiate between generic types and ordinary types
-identify all matching method candidates and return the closest one (the one which has a more narrow type parameter than java.lang.Object).
 
(0005149)
ferg
04-04-11 17:50

ejb/40c4

This example works fine with 4.0.16. There must be some other difference in the test (for example different classloaders, .jar vs .ear etc.)

The proposed patch is incorrect.
 

- Issue History
Date Modified Username Field Change
03-01-11 07:10 andreaskaltenbach New Issue
03-01-11 07:21 andreaskaltenbach Note Added: 0005142
03-02-11 06:28 andreaskaltenbach Note Deleted: 0005142
03-02-11 06:29 andreaskaltenbach File Added: quickfix_for_resin_issue_#4467.patch
03-02-11 06:30 andreaskaltenbach Note Added: 0005144
04-04-11 17:50 ferg Note Added: 0005149
04-04-11 17:50 ferg Assigned To  => emil
04-04-11 17:50 ferg Status new => assigned
04-04-11 17:50 ferg Resolution open => unable to reproduce
04-04-11 18:04 ferg Status assigned => closed


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