Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0004467 [Resin] major always 03-30-11 07:10 04-04-11 18:04
Reporter andreaskaltenbach View Status public  
Assigned To emil
Priority normal Resolution unable to reproduce  
Status closed   Product Version 4.0.16
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);

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.

Additional Information Full stack trace:

at com.caucho.ejb.gen.SessionGenerator.introspectMethod(
                                   at com.caucho.ejb.gen.SessionGenerator.introspectType(
                                   at com.caucho.ejb.gen.SessionGenerator.introspect(
                                   at com.caucho.ejb.gen.StatelessGenerator.introspect(
                                   at com.caucho.ejb.session.AbstractSessionManager.bind(
                                   at com.caucho.ejb.manager.EjbManager.bind(
                                   at com.caucho.ejb.manager.EjbManager.environmentBind(
                                   at com.caucho.loader.EnvironmentClassLoader.bind(
                                   at com.caucho.loader.EnvironmentClassLoader.start(
                                   at com.caucho.server.webapp.WebApp.start(
                                   at com.caucho.env.deploy.DeployController.startImpl(
                                   at com.caucho.env.deploy.StartAutoRedeployAutoStrategy.startOnInit(
                                   at com.caucho.env.deploy.DeployController.startOnInit(
                                   at com.caucho.env.deploy.DeployContainer.start(
                                   at com.caucho.server.webapp.WebAppContainer.start(
                                   at com.caucho.env.deploy.DeployController.startImpl(
                                   at com.caucho.env.deploy.StartAutoRedeployAutoStrategy.startOnInit(
                                   at com.caucho.env.deploy.DeployController.startOnInit(
                                   at com.caucho.env.deploy.DeployContainer.start(
                                   at com.caucho.server.cluster.Server.start(
                                   at com.caucho.server.cluster.ServletService.start(
                                   at com.caucho.env.service.ResinSystem.startServices(
                                   at com.caucho.env.service.ResinSystem.start(
                                   at com.caucho.server.resin.Resin.start(
                                   at com.caucho.server.resin.Resin.initMain(
                                   at com.caucho.server.resin.Resin.main(
                                   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                   at sun.reflect.NativeMethodAccessorImpl.invoke(
                                   at sun.reflect.DelegatingMethodAccessorImpl.invoke(
                                   at java.lang.reflect.Method.invoke(
Attached Files  quickfix_for_resin_issue_#4467.patch [^] (19,799 bytes) 03-31-11 06:29

- Relationships

- Notes
03-31-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).
04-04-11 17:50


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-30-11 07:10 andreaskaltenbach New Issue
03-30-11 07:21 andreaskaltenbach Note Added: 0005142
03-31-11 06:28 andreaskaltenbach Note Deleted: 0005142
03-31-11 06:29 andreaskaltenbach File Added: quickfix_for_resin_issue_#4467.patch
03-31-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