Mogration from JBoss 4 to 7 --> problem with @RemoteBinding/@LocalBinding
seameddie Mar 31, 2014 6:35 AMHello.
We are trying to migrate from JBoss 4.3.0.GA to JBoss 7.2.0.Final. In our session beans, we use annotations as '@RemoteBinding' and '@LocalBinding' like this:
--------------------------------------------------------------->snip
...
import org.jboss.annotation.ejb.LocalBinding;
import org.jboss.annotation.ejb.RemoteBinding;
...
@Stateless(name = "UserDAO")
@Remote(UserDAORemote.class)
@RemoteBinding(jndiBinding = "xyz/remote/UserDAO")
@LocalBinding(jndiBinding = "xyz/UserDAO")
public class UserDAOBean extends AbstractGenericDAO implements UserDAO {
...
}
---------------------------------------------------------------<snap
These annos come from the jar 'jboss-annotations-ejb3-4.3.0.GA.EAP'. We need this annotations in order to use our beans in JBoss 4. When i try to build an ear containing session beans like the one described above in an ejb module and deploy it to JBoss 7, i get the following error on start up:
--------------------------------------------------------------->snip
12:02:06,105 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-9) MSC00001: Failed to start service jboss.deployment.unit."bpm-process-ref-1.0-SNAPSHOT.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."bpm-process-ref-1.0-SNAPSHOT.war".POST_MODULE: JBAS0
18733: Failed to process phase POST_MODULE of deployment "bpm-process-ref-1.0-SNAPSHOT.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:127) [jboss-as-server-7.2.0.Final.jar:7.2.0.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA.jar:1.0.4.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA.jar:1.0.4.GA]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_10]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_10]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_10]
Caused by: java.lang.annotation.AnnotationFormatError: Invalid default: public abstract java.lang.Class org.jboss.annotation.ejb.RemoteBinding.factory()
at java.lang.reflect.Method.getDefaultValue(Method.java:732) [rt.jar:1.7.0_10]
at sun.reflect.annotation.AnnotationType.<init>(AnnotationType.java:117) [rt.jar:1.7.0_10]
at sun.reflect.annotation.AnnotationType.getInstance(AnnotationType.java:84) [rt.jar:1.7.0_10]
at sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:221) [rt.jar:1.7.0_10]
at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:88) [rt.jar:1.7.0_10]
at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:70) [rt.jar:1.7.0_10]
at java.lang.Class.initAnnotationsIfNecessary(Class.java:3089) [rt.jar:1.7.0_10]
at java.lang.Class.getAnnotation(Class.java:3048) [rt.jar:1.7.0_10]
at org.jboss.as.ejb3.deployment.processors.BusinessViewAnnotationProcessor.getRemoteBusinessInterfaces(BusinessViewAnnotationProcessor.java:140)
at org.jboss.as.ejb3.deployment.processors.BusinessViewAnnotationProcessor.processViewAnnotations(BusinessViewAnnotationProcessor.java:113)
at org.jboss.as.ejb3.deployment.processors.BusinessViewAnnotationProcessor.deploy(BusinessViewAnnotationProcessor.java:88)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:120) [jboss-as-server-7.2.0.Final.jar:7.2.0.Final]
... 5 more
---------------------------------------------------------------<snap
If i just copy+paste a bean like the one above and remove the lines with the pointed out annotations, it works fine in JBoss 7. That means, that JBoss 7 does not need those annotations, but nevertheless fails on deployment if i deploy beans containing them. As the error message i get talks about a default, my idea is to just implement something like an empty default for the 'RemoteBinding' class in my jar/ear. Is that possible? Or can i use some dependency containing a 'RemoteBinding' class which is compatible with JBoss 7 just to suppress the error?
Thank you in advance.
Cheers,
Stefan