Annotation inheritance

I just started playing with annotations (thank you Eclipse 3.1m6) and I'm puzzled by something. The docs for java.lang.annotation.Inherited say it only applies to classes. You can't inherit annotations from interfaces, and you can't make method annotation inherit. Does anyone know why this is? The first thing I wanted to do with annotations was add them to interface methods and find them via reflection on class methods.

Java annotation is a new toy for everyone here. If you are looking for a guru,
it is a nai mono dedari in Japanese, a cry for the moon. You yourself
should become THE moon.

Similar Messages

  • Java inherited annotations

    Dear colleagues.
    There is some inconvenience concerning using of java annotations. I annotated some interfaces and methods within them. Then I made some derived interfaces and classes and tried to get my annotations here. Unfortunately annotations whose had been made for base classes were inaccessible from derived classes. It was very critical for me because I used some automated wrappers over my classes and couldn�t add annotations manually. Anyway as a result the library was elaborated that helps to solve inheritance task.
    The annotations being inherited are of classes, interfaces, or their methods. It uses the consistent inheritance model: inheritance proceeds only if the same annotation is not present on the same element (class, interface or method) within superclasses or superinterfaces. Annotations can be overridden within descendants. The library is open-source and free and can be downloaded from here:
    http://www.fusionsoft-online.com/annotation.php.
    Will be great to hear your opinion here�
    Best Regards,
    Michael.

    Dear colleagues.
    There is some inconvenience concerning using of java
    annotations. I annotated some interfaces and methods
    within them. Then I made some derived interfaces and
    classes and tried to get my annotations here.
    Unfortunately annotations whose had been made for
    base classes were inaccessible from derived classes.Your document's assertions that the platform does not support inheriting annotations are false. Indeed, the @Inherited annotation, included as part of JSR 175, is meant exactly for that purpose:
    http://java.sun.com/j2se/1.5.0/docs/api/java/lang/annotation/Inherited.html
    (This only allows inheritance along the superclass chain, not interfaces.)

  • Build-time access to declarations and annotations

    This is a couple of yes/no questions to confirm that I got it right. I'm in the context of build-time annotation processing where the AnnotationProcessor analyses each specified annotated class as well as their ancestors.
    Let's assume barClassType is a com.sun.mirror.type.ClassType instance representing the type named foo.Bar.
    Would barClassType.getDeclaration() return a non-null ClassDeclaration instance,
    even though: foo.Bar was not specified when the annotation processing tool was invoked,
    provided that: foo.Bar can be found somewhere in the class path?
    If so, let's assume barDeclaration was assigned to the said return value and Qux is an annotation type.
    Would barDeclaration.getAnnotation(Qux.class) return a non-null Annotation instance,
    provided that: the Qux retention policy was set to either Retention.CLASS or Retention.RUNTIME?

    j.d.darcy wrote:
    Robert.Bossy wrote:
    This is a couple of yes/no questions to confirm that I got it right. I'm in the context of build-time annotation processing where the AnnotationProcessor analyses each specified annotated class as well as their ancestors.
    Let's assume barClassType is a com.sun.mirror.type.ClassType instance representing the type named foo.Bar.
    Would barClassType.getDeclaration() return a non-null ClassDeclaration instance,
    even though: foo.Bar was not specified when the annotation processing tool was invoked,
    provided that: foo.Bar can be found somewhere in the class path?Yes.
    If so, let's assume barDeclaration was assigned to the said return value and Qux is an annotation type.
    Would barDeclaration.getAnnotation(Qux.class) return a non-null Annotation instance,
    provided that: the Qux retention policy was set to either Retention.CLASS or Retention.RUNTIME?If the Bar type declaration included the Qux annotation (either directly or by annotation inheritance), yes.Yeah, that was implicit. Thanks a lot.

  • Build time

    Is there a way to change the default build speed? All builds open with 1 second and I prefer .5 second.

    j.d.darcy wrote:
    Robert.Bossy wrote:
    This is a couple of yes/no questions to confirm that I got it right. I'm in the context of build-time annotation processing where the AnnotationProcessor analyses each specified annotated class as well as their ancestors.
    Let's assume barClassType is a com.sun.mirror.type.ClassType instance representing the type named foo.Bar.
    Would barClassType.getDeclaration() return a non-null ClassDeclaration instance,
    even though: foo.Bar was not specified when the annotation processing tool was invoked,
    provided that: foo.Bar can be found somewhere in the class path?Yes.
    If so, let's assume barDeclaration was assigned to the said return value and Qux is an annotation type.
    Would barDeclaration.getAnnotation(Qux.class) return a non-null Annotation instance,
    provided that: the Qux retention policy was set to either Retention.CLASS or Retention.RUNTIME?If the Bar type declaration included the Qux annotation (either directly or by annotation inheritance), yes.Yeah, that was implicit. Thanks a lot.

  • Java persistence API

    Hi! I am trying to learn to use the http://www.devx.com/Java/Article/33650/ api manually, i tried using netbeans 6.0 for it but i'm not very sure what it does so i am going to try it manually now. I've read these 2 articles by Antonio Goncalves
    (http://www.devx.com/Java/Article/33650/ && http://www.devx.com/Java/Article/33906/) it doesn't look very difficult at first but the thing is in netbeans 6.0 when i try to use the annotations,@Inheritance for example, It autocompletes but i don't see the javadoc it says ("Javadoc not found"). I already added the javaee5 documentation to the javaplataform manager but it doesn't do the trick.
    Anybody can help? Also if you know any kind of tutorial for the persistence api if you could point me towards there it would be nice.
    And finally sorry if i have misplaced this post, I couldn't find a better place.
    Thanks, Joaquin

    Hi! I am trying to learn to use the http://www.devx.com/Java/Article/33650/ api manually, i tried using netbeans 6.0 for it but i'm not very sure what it does so i am going to try it manually now. I've read these 2 articles by Antonio Goncalves
    (http://www.devx.com/Java/Article/33650/ && http://www.devx.com/Java/Article/33906/) it doesn't look very difficult at first but the thing is in netbeans 6.0 when i try to use the annotations,@Inheritance for example, It autocompletes but i don't see the javadoc it says ("Javadoc not found"). I already added the javaee5 documentation to the javaplataform manager but it doesn't do the trick.
    Anybody can help? Also if you know any kind of tutorial for the persistence api if you could point me towards there it would be nice.
    And finally sorry if i have misplaced this post, I couldn't find a better place.
    Thanks, Joaquin

  • The annotation symbol inheritance is not supported.

    Hi techies...
    I am using JDK 1.5.0_12
    And Applications server GlassFish V2 UR2
    and The application is related to SEAM using seam2.0.1 Sp1
    and in this at the time of building there was no errors at the time of deploying to server only this errors are rising...
    And no application is there just a simple generation from DB using seam An Welcome page only...
    I hope its a configuration issue..and I am new for GlassFish...If any body gies reply or solution..its a great help to go through further
    Thanks in advance..
    Venkat
    this is the console log...
    [#|2008-07-08T12:51:41.872+0530|WARNING|sun-appserver9.1|javax.enterprise.system.tools.deployment|_ThreadID=19;_ThreadName=Thread-31;_RequestID=371f6e2a-11a8-45de-b180-9a0eafb8f865;|The annotation symbol inheritance is not supported.
    symbol: TYPE
    location: class org.jboss.seam.async.TimerServiceDispatcher
    |#]
    [#|2008-07-08T12:51:42.137+0530|INFO|sun-appserver9.1|javax.enterprise.system.tools.deployment|_ThreadID=19;_ThreadName=Thread-31;|deployed with moduleid = V|#]
    [#|2008-07-08T12:51:42.762+0530|INFO|sun-appserver9.1|javax.enterprise.resource.webcontainer.jsf.config|_ThreadID=14;_ThreadName=httpWorkerThread-4848-0;/V;|Initializing Sun's JavaServer Faces implementation (1.2_04-b20-p03) for context '/V'|#]
    [#|2008-07-08T12:51:43.262+0530|SEVERE|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=14;_ThreadName=httpWorkerThread-4848-0;_RequestID=d46b1167-cd74-43f2-9e4e-a951518e0c38;|WebModule[/V]PWC1275: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener
    java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
         at org.ajax4jsf.application.DebugLifecycleFactory.<clinit>(DebugLifecycleFactory.java:39)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
         at javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java:549)
         at javax.faces.FactoryFinder.getImplementationInstance(FactoryFinder.java:448)
         at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:249)
         at com.sun.faces.config.ConfigureListener.configure(ConfigureListener.java:805)
         at com.sun.faces.config.ConfigureListener.configure(ConfigureListener.java:486)
         at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:381)
         at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4523)
         at org.apache.catalina.core.StandardContext.start(StandardContext.java:5184)
         at com.sun.enterprise.web.WebModule.start(WebModule.java:326)
         at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:973)
         at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:957)
         at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:688)
         at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1584)
         at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1222)
         at com.sun.enterprise.server.WebModuleDeployEventListener.moduleDeployed(WebModuleDeployEventListener.java:182)
         at com.sun.enterprise.server.WebModuleDeployEventListener.moduleDeployed(WebModuleDeployEventListener.java:278)
         at com.sun.enterprise.admin.event.AdminEventMulticaster.invokeModuleDeployEventListener(AdminEventMulticaster.java:974)
         at com.sun.enterprise.admin.event.AdminEventMulticaster.handleModuleDeployEvent(AdminEventMulticaster.java:961)
         at com.sun.enterprise.admin.event.AdminEventMulticaster.processEvent(AdminEventMulticaster.java:464)
         at com.sun.enterprise.admin.event.AdminEventMulticaster.multicastEvent(AdminEventMulticaster.java:176)
         at com.sun.enterprise.admin.server.core.DeploymentNotificationHelper.multicastEvent(DeploymentNotificationHelper.java:308)
         at com.sun.enterprise.deployment.phasing.DeploymentServiceUtils.multicastEvent(DeploymentServiceUtils.java:226)
         at com.sun.enterprise.deployment.phasing.ServerDeploymentTarget.sendStartEvent(ServerDeploymentTarget.java:298)
         at com.sun.enterprise.deployment.phasing.ApplicationStartPhase.runPhase(ApplicationStartPhase.java:132)
         at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:108)
         at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:919)
         at com.sun.enterprise.deployment.phasing.PEDeploymentService.start(PEDeploymentService.java:591)
         at com.sun.enterprise.deployment.phasing.PEDeploymentService.start(PEDeploymentService.java:635)
         at com.sun.enterprise.admin.mbeans.ApplicationsConfigMBean.start(ApplicationsConfigMBean.java:744)
         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:585)
         at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:375)
         at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:358)
         at com.sun.enterprise.admin.config.BaseConfigMBean.invoke(BaseConfigMBean.java:464)
         at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:213)
         at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220)
         at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:815)
         at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784)
         at sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.sun.enterprise.admin.util.proxy.ProxyClass.invoke(ProxyClass.java:90)
         at $Proxy1.invoke(Unknown Source)
         at com.sun.enterprise.admin.server.core.jmx.SunoneInterceptor.invoke(SunoneInterceptor.java:304)
         at com.sun.enterprise.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:174)
         at com.sun.enterprise.admin.jmx.remote.server.callers.InvokeCaller.call(InvokeCaller.java:69)
         at com.sun.enterprise.admin.jmx.remote.server.MBeanServerRequestHandler.handle(MBeanServerRequestHandler.java:155)
         at com.sun.enterprise.admin.jmx.remote.server.servlet.RemoteJmxConnectorServlet.processRequest(RemoteJmxConnectorServlet.java:122)
         at com.sun.enterprise.admin.jmx.remote.server.servlet.RemoteJmxConnectorServlet.doPost(RemoteJmxConnectorServlet.java:193)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
         at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:290)
         at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
         at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
         at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
         at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
         at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
         at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
         at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
         at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
         at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
         at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
         at com.sun.enterprise.web.connector.grizzly.WorkerThreadImpl.run(WorkerThreadImpl.java:116)
    |#]
    [#|2008-07-08T12:51:43.262+0530|INFO|sun-appserver9.1|javax.servlet.ServletContextListener|_ThreadID=14;_ThreadName=httpWorkerThread-4848-0;|Welcome to Seam 2.0.2.SP1|#]
    [#|2008-07-08T12:51:43.294+0530|SEVERE|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=14;_ThreadName=httpWorkerThread-4848-0;_RequestID=d46b1167-cd74-43f2-9e4e-a951518e0c38;|WebModule[/V]PWC1275: Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
    java.lang.NoClassDefFoundError: javassist/bytecode/ClassFile
         at org.jboss.seam.deployment.StandardDeploymentStrategy.<init>(StandardDeploymentStrategy.java:28)
         at org.jboss.seam.init.Initialization.create(Initialization.java:101)
         at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:34)
         at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4523)
         at org.apache.catalina.core.StandardContext.start(StandardContext.java:5184)
         at com.sun.enterprise.web.WebModule.start(WebModule.java:326)
         at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:973)
         at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:957)
         at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:688)
         at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1584)
         at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1222)
         at com.sun.enterprise.server.WebModuleDeployEventListener.moduleDeployed(WebModuleDeployEventListener.java:182)
         at com.sun.enterprise.server.WebModuleDeployEventListener.moduleDeployed(WebModuleDeployEventListener.java:278)
         at com.sun.enterprise.admin.event.AdminEventMulticaster.invokeModuleDeployEventListener(AdminEventMulticaster.java:974)
         at com.sun.enterprise.admin.event.AdminEventMulticaster.handleModuleDeployEvent(AdminEventMulticaster.java:961)
         at com.sun.enterprise.admin.event.AdminEventMulticaster.processEvent(AdminEventMulticaster.java:464)
         at com.sun.enterprise.admin.event.AdminEventMulticaster.multicastEvent(AdminEventMulticaster.java:176)
         at com.sun.enterprise.admin.server.core.DeploymentNotificationHelper.multicastEvent(DeploymentNotificationHelper.java:308)
         at com.sun.enterprise.deployment.phasing.DeploymentServiceUtils.multicastEvent(DeploymentServiceUtils.java:226)
         at com.sun.enterprise.deployment.phasing.ServerDeploymentTarget.sendStartEvent(ServerDeploymentTarget.java:298)
         at com.sun.enterprise.deployment.phasing.ApplicationStartPhase.runPhase(ApplicationStartPhase.java:132)
         at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:108)
         at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:919)
         at com.sun.enterprise.deployment.phasing.PEDeploymentService.start(PEDeploymentService.java:591)
         at com.sun.enterprise.deployment.phasing.PEDeploymentService.start(PEDeploymentService.java:635)
         at com.sun.enterprise.admin.mbeans.ApplicationsConfigMBean.start(ApplicationsConfigMBean.java:744)
         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:585)
         at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:375)
         at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:358)
         at com.sun.enterprise.admin.config.BaseConfigMBean.invoke(BaseConfigMBean.java:464)
         at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:213)
         at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220)
         at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:815)
         at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784)
         at sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.sun.enterprise.admin.util.proxy.ProxyClass.invoke(ProxyClass.java:90)
         at $Proxy1.invoke(Unknown Source)
         at com.sun.enterprise.admin.server.core.jmx.SunoneInterceptor.invoke(SunoneInterceptor.java:304)
         at com.sun.enterprise.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:174)
         at com.sun.enterprise.admin.jmx.remote.server.callers.InvokeCaller.call(InvokeCaller.java:69)
         at com.sun.enterprise.admin.jmx.remote.server.MBeanServerRequestHandler.handle(MBeanServerRequestHandler.java:155)
         at com.sun.enterprise.admin.jmx.remote.server.servlet.RemoteJmxConnectorServlet.processRequest(RemoteJmxConnectorServlet.java:122)
         at com.sun.enterprise.admin.jmx.remote.server.servlet.RemoteJmxConnectorServlet.doPost(RemoteJmxConnectorServlet.java:193)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
         at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:290)
         at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
         at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
         at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
         at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
         at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
         at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
         at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
         at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
         at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
         at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
         at com.sun.enterprise.web.connector.grizzly.WorkerThreadImpl.run(WorkerThreadImpl.java:116)
    |#]
    [#|2008-07-08T12:51:43.309+0530|SEVERE|sun-appserver9.1|org.apache.catalina.core.StandardContext|_ThreadID=14;_ThreadName=httpWorkerThread-4848-0;_RequestID=d46b1167-cd74-43f2-9e4e-a951518e0c38;|PWC1306: Startup of context /V failed due to previous errors|#]
    [#|2008-07-08T12:51:43.340+0530|SEVERE|sun-appserver9.1|javax.enterprise.system.container.web|_ThreadID=14;_ThreadName=httpWorkerThread-4848-0;_RequestID=d46b1167-cd74-43f2-9e4e-a951518e0c38;|WebModule[/V]PWC1277: Exception sending context destroyed event to listener instance of class org.jboss.seam.servlet.SeamListener
    java.lang.NoClassDefFoundError: javassist/util/proxy/MethodHandler
         at org.jboss.seam.core.Events.instance(Events.java:156)
         at org.jboss.seam.core.Events.exists(Events.java:151)
         at org.jboss.seam.contexts.Contexts.destroy(Contexts.java:236)
         at org.jboss.seam.contexts.Lifecycle.endApplication(Lifecycle.java:56)
         at org.jboss.seam.contexts.ServletLifecycle.endApplication(ServletLifecycle.java:118)
         at org.jboss.seam.servlet.SeamListener.contextDestroyed(SeamListener.java:39)
         at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4567)
         at org.apache.catalina.core.StandardContext.stop(StandardContext.java:5355)
         at com.sun.enterprise.web.WebModule.stop(WebModule.java:357)
         at org.apache.catalina.core.StandardContext.start(StandardContext.java:5211)
         at com.sun.enterprise.web.WebModule.start(WebModule.java:326)
         at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:973)
         at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:957)
         at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:688)
         at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1584)
         at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1222)
         at com.sun.enterprise.server.WebModuleDeployEventListener.moduleDeployed(WebModuleDeployEventListener.java:182)
         at com.sun.enterprise.server.WebModuleDeployEventListener.moduleDeployed(WebModuleDeployEventListener.java:278)
         at com.sun.enterprise.admin.event.AdminEventMulticaster.invokeModuleDeployEventListener(AdminEventMulticaster.java:974)
         at com.sun.enterprise.admin.event.AdminEventMulticaster.handleModuleDeployEvent(AdminEventMulticaster.java:961)
         at com.sun.enterprise.admin.event.AdminEventMulticaster.processEvent(AdminEventMulticaster.java:464)
         at com.sun.enterprise.admin.event.AdminEventMulticaster.multicastEvent(AdminEventMulticaster.java:176)
         at com.sun.enterprise.admin.server.core.DeploymentNotificationHelper.multicastEvent(DeploymentNotificationHelper.java:308)
         at com.sun.enterprise.deployment.phasing.DeploymentServiceUtils.multicastEvent(DeploymentServiceUtils.java:226)
         at com.sun.enterprise.deployment.phasing.ServerDeploymentTarget.sendStartEvent(ServerDeploymentTarget.java:298)
         at com.sun.enterprise.deployment.phasing.ApplicationStartPhase.runPhase(ApplicationStartPhase.java:132)
         at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:108)
         at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:919)
         at com.sun.enterprise.deployment.phasing.PEDeploymentService.start(PEDeploymentService.java:591)
         at com.sun.enterprise.deployment.phasing.PEDeploymentService.start(PEDeploymentService.java:635)
         at com.sun.enterprise.admin.mbeans.ApplicationsConfigMBean.start(ApplicationsConfigMBean.java:744)
         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:585)
         at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:375)
         at com.sun.enterprise.admin.MBeanHelper.invokeOperationInBean(MBeanHelper.java:358)
         at com.sun.enterprise.admin.config.BaseConfigMBean.invoke(BaseConfigMBean.java:464)
         at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke(DynamicMetaDataImpl.java:213)
         at com.sun.jmx.mbeanserver.MetaDataImpl.invoke(MetaDataImpl.java:220)
         at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:815)
         at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784)
         at sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.sun.enterprise.admin.util.proxy.ProxyClass.invoke(ProxyClass.java:90)
         at $Proxy1.invoke(Unknown Source)
         at com.sun.enterprise.admin.server.core.jmx.SunoneInterceptor.invoke(SunoneInterceptor.java:304)
         at com.sun.enterprise.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:174)
         at com.sun.enterprise.admin.jmx.remote.server.callers.InvokeCaller.call(InvokeCaller.java:69)
         at com.sun.enterprise.admin.jmx.remote.server.MBeanServerRequestHandler.handle(MBeanServerRequestHandler.java:155)
         at com.sun.enterprise.admin.jmx.remote.server.servlet.RemoteJmxConnectorServlet.processRequest(RemoteJmxConnectorServlet.java:122)
         at com.sun.enterprise.admin.jmx.remote.server.servlet.RemoteJmxConnectorServlet.doPost(RemoteJmxConnectorServlet.java:193)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
         at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:290)
         at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
         at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
         at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
         at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
         at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
         at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
         at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
         at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
         at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
         at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
         at com.sun.enterprise.web.connector.grizzly.WorkerThreadImpl.run(WorkerThreadImpl.java:116)
    |#]

    I had the same error too. Any solution on this?

  • Annotation's inheritance

    I think it would be wonderfull to have Annotation's inheritance,
    for example there is a javax.persistence.Entitiy and org.hibernate.annotations.Entity, the former is created for extending properties of the first; it would be nice to make second one extends the first one, don't you think so?

    I think it would be wonderfull to have Annotation's
    inheritance,
    for example there is a javax.persistence.Entitiy and
    org.hibernate.annotations.Entity, the former is
    created for extending properties of the first; it
    would be nice to make second one extends the first
    one, don't you think so?This capability was considered by the JSR 175 expert group (http://www.jcp.org/en/jsr/detail?id=175) but rejected . The question is addressed in their design FAQ:
    "Why don't you support annotation subtyping (where one annotation type extends another)?
    It complicates the annotation type system, and makes it much more difficult to write "Specific Tools" (per the taxonomy in Section VI). "
    There is also the general advice to favor composition over inheritance ("Effective Java" item 14).

  • Overriding inherited annotations

    Hi,
    I wish to use the “ParameterPriority” annotation to determine the order of the fields appearance when displaying these objects in a GUI.
    Both B and C classes extends class A. If B and C wish to change the appearance order of class A fields, is there a way to override class A annotation values? (or is there another way to obtain this functionality via annotations?)
    Bellow you can find a very stupid example for the situation I've described.
    Thanks!
    // annotation definition:
    @Retention(RetentionPolicy.RUNTIME)
    @Target({ElementType.FIELD})
    public @interface ParameterPriority {
          int rank();
    //class A
    Public class A {
    @ ParameterPriority (rank=1)
        private String name;
    @ ParameterPriority (rank=2)
        private int age;
    //class B
    Public class B extends A {
    @ ParameterPriority (rank=3)
        private boolean isFemale;
    //class C
    Public class C extends A {
    @ ParameterPriority (rank=3)
        private Boolean isStudent;
    }

    I don't thik you can achieve that on fields (though you should confirm with someone more knowledgeable) because fields cannot be overriden. A sensible workaround would be to annotate field getters rather than the fields themselves: when you override a method, you have the opportunity override its annotations. Another side advantage is that you annotate public things so they will be visible in the javadoc for instance.
    Btw, if you rename your annotation method from "rank" to "value", you're allowed to omit the method name:
    // annotation definition:
    @Retention(RetentionPolicy.RUNTIME)
    @Target({ElementType.METHOD})
    public @interface ParameterPriority {
          int value();
    //class A
    public class A {
        private String name;
        private int age;
        @ParameterPriority(5)
        public String getName() { return name; }
        @ParameterPriority(10)
        public int getAge() { return age; }
    public class B extends A {
        @Override
        @ParameterPriority(2)
        public int getAge() { return super.getAge(); }
        // instanceOfA.getMethod("getAge").getAnnotation(ParameterPriority.class).value() == 10
        // instanceOfC.getMethod("getAge").getAnnotation(ParameterPriority.class).value() == 2

  • EJB 3.0 Entity Bean Inheritance Table Mapping

    What I want to do (I think)...
    In a distilled example form...
    - class A defines field x
    - class B defines field y, extends A, inheriting field x
    - class C defines field z, extends A, inheriting field x
    - I want class B to map to tbl_b which has columns x, y
    - I want class C to map to tbl_c which has columns x, z
    What I **don't** want to do (I think)...
    - make a base table for class A that is joined to tbl_b and tbl_c
    - map class B and class C to a single table that has a discriminator column
    Questions...
    1) Is there a conceptual problem with what I want to do?
    2) Is there a way to do what I want to do? I've tried via annotations. Maybe via the XML mapping alternative to annotations?

    Thanks for the reply Simon.
    Just to re-word what I want to do... I want to use a single table **for each lineage** in the hierarchy. In my original example that would be two tables.
    Table per class is what I tried but couldn't get to work - at least using annotations. I want to map some columns in the single table to base fields and some to derived fields.
    It seems that only 'single table with discriminator', or the 'join table' methods are sanctioned ways to handle an inheritance hierarchy.
    I didn't yet try using the XML method. I might be able to use the single table method by mapping base class properties as if they were derived class properties. This approach would work with a native Hibernate mapping XML.
    Back to the conceptual question. Is there a reason why I shouldn't do what I want here?
    What I'm trying to avoid...
    1) joining tables for performance issues
    2) having one table with columns that only make sense for certain records - ugly and potentially database storage waste.

  • EJB 3.0 Inheritance problem

    I have to persist classes Cat, BullDog and StBernard:
    class Animal {
    private int animalId;
    private String name;
    private String dtype;
    class Dog extends Animal {
    private int dogId;
    private String furColor;
    class BullDog extends Dog {
    private int bullDogId;
    private int fightCount;
    class StBernard extends Dog {
    private int stbernardId;
    private int livesSaved;
    class Cat extends Animal {
    private int catId;
    private String preferredCatFood;
    }Planned inheritance strategy is joined table strategy. There is no problem mapping and persisting Cat and Dog tables into database, but I cannot find a way how to annotate StBernard and BullDog classes to persist them. Is it possible at all?

    do you know any official doc or reference where I can find statement, that such inheritance is not possible? i.e. only one level inheritance is allowed in JPA? Will check @SecondaryTable to see if it is helpful or not.
    @SecondaryTable This annotation is used to specify a secondary table for the annotated entity class. Specifying one or more secondary tables indicates that the data for the entity class is stored across multiple tables.@SecondaryTable is not for me :(
    Edited by: marekst on Feb 7, 2008 6:36 AM

  • Multiple inheritance in remote interfaces for EJB 3.0 session beans on Webl

    Hi All,
    We started migration from EJB 2.1(WLS 8.1) to EJB 3.0(WLS 10.3.2) and identified few serious problems. One of them is related with multiple business interfaces inheritance. I wrote simple example that presents point of the problem.
    we have session bean AImpl:
    +@Stateless(name="A")+
    +@Remote({A.class})+
    +@TransactionAttribute(TransactionAttributeType.REQUIRED)+
    +public class AImpl implements A {+
    +@Override+
    +public void writeA() {+
    System.out.println("A");
    +}+
    +@Override+
    +public void writeB() {+
    System.out.println("B");
    +}+
    +@Override+
    +public void writeC() {+
    System.out.println("C");
    +}+
    +}+
    with remote interface A:
    +@Remote+
    +@JNDIName(A.JNDI_NAME)+
    +public interface A extends B, C {+
    public static String JNDI_NAME = "A_JNDI_NAME";
    void writeA();
    +}+
    As you can see A extends B, and C. Definition of both interfaces is very simple:
    +public interface B {+
    void writeB();
    +}+
    +public interface C {+
    void writeC();
    +}+
    Everything looks nice until we want to invoke some method on AImpl bean. For above implementation code:
    A a = ctx.lookup(A. JNDI_NAME);
    a.writeA();
    a.writeB();
    a.writeC();
    writes down ”A \n B” and throws exception:
    caused by: java.lang.NoSuchMethodException: pl.gov.arimr.zszik.bazowe.slowniki.ejb.A_vt0zts_AImpl_1032_WLStub.*writeC()*
    at java.lang.Class.getMethod(Class.java:1605)
    at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.getTargetMethod(RemoteBusinessIntfProxy.java:165)
    at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:57)
    so.. in stub generated by WLS there is no method from interface C ! What more interesting after small change in interface A rely on change in interface implementation order from B, C to C, B (+public interface A extends C, B {+) server writes down only A and I have stack like below:
    Caused by: java.lang.NoSuchMethodException: pl.gov.arimr.zszik.bazowe.slowniki.ejb.A_vt0zts_AImpl_1032_WLStub.*writeB()*
    at java.lang.Class.getMethod(Class.java:1605)
    at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.getTargetMethod(RemoteBusinessIntfProxy.java:165)
    at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:57)
    After this experience I came up with suspicion that Weblogic 10.3 does not support inheritance from multiple interfaces in one “generation”. Instead of that it takes only the first interface from the list.
    Does anybody have some experience with such a situation? maybe someone have an idea how to work around this problem?

    This is Not Supported in WebLogic that the Remote Interface extends other Interfaces. Because Annotation Processor just looks up inside the implemented interface methods. The actual interface which is Implemented by the Bean Class. So the Methods declared inside the Interface B and Interface C will be ignored and will not be available as part of the generated Stubs. Thats why u are getting NoSuchMethodError.
    You can even contact Oracle Support on this...there are 3-4 Cases on it. And the Solution is Work As Designed.
    Workaround is : edit your interface A as following
    Declare all the Business Methods only in the Remote Interface and not inside it's Super Interfaces.
    Example:
    @Stateless(name="A")
    @Remote({A.class})
    @TransactionAttribute(TransactionAttributeType.REQUIRED)
    public class AImpl implements A {
    @Override
    public void writeA() {
    System.out.println("A");
    @Override
    public void writeB() {
    System.out.println("B");
    @Override
    public void writeC() {
    System.out.println("C");
    @Remote
    @JNDIName(A.JNDI_NAME)
    public interface A extends B, C {
    public static String JNDI_NAME = "A_JNDI_NAME";
    void writeA();
    void writeB();
    void writeC();
    Thanks
    Jay SenSharma
    http://jaysensharma.wordpress.com (WebLogic Wonders Are Here)

  • Annotations - InheritanceType.TABLE_PER_CLASS doesn't seem to work with GF

    Hi there,
    I'm using the toplink essentials jar file with a stand alone J2SE application. I'm using annotations for ORM with Toplink implementation
    What I want to achieve is to map the base class objects to one table, and sub class objects to a different table. Currently - both tables (and objects) have the exact same structure, but I use inheritence in order to identify where should the object be registered. Thus I'm trying to map an inhertiance using TABLE_PER_CLASS type.
    It doesn't seem to work:
    My classes look like this:
    Base class I want to map to REGION table:
    @Entity
    @Table(name="REGION")
    @Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)
    public class Region implements BaseBusinessObj
    @Id
    @Column(name = "REGION_ID", insertable = false, updatable = true)
    @GeneratedValue(generator = "regionSeq")
    @SequenceGenerator(name = "regionSeq",
    sequenceName = "GSM_REGION_ID_SEQ", allocationSize = 1)
    private int m_regionId;
    @Column(name = "REGION_NAME")
    private String m_regionName;
    Subclass with exact same structure I want to map to GFR_REGION table which has the exact same database table structure as REGION:
    @Entity
    @Table(name="GFR_REGION")
    public class GfrRegion extends Region
    This doesn't work. The Toplink adds entities of the GfrRegion to the REGION table and does not recognize it should go to the GFR_REGION table.
    What am I doing wrong?
    Thanks,
    Michael

    Hi all,
    Any news about the support for TABLE_PER_CLASS in TopLink/EclipseLink ?
    The main question is what was the reason for making this an optional strategy for mapping in the specs ? Both OpenJPA and Hibernate have it and there are cases when this is usefull.
    From EclipseLink perspective, how difficult would be to add this ? I didn't have a chance yet to closely examine the codebase for EclipseLink, but some architecture diagrams with some design decisions explained would help to community to better understand the product and make improvements.
    Thank you,
    Mircea

  • How to use annotation with GUI in swing

    hi,
    i am new to annotation. I know how to use this with classes, methods and java elements. I am developing a tool in applet to post comment on my notepad, but unable to find that how to use this with GUI of swing. I have gone through most of forums and tutorials but got no idea. Anyone could give me little idea.
    Thanks

    >
    i need to use the applet mousedown function in swing..>There is no such class as 'applet' in the JRE, Swing has an upper case 1st letter, functions in Java are generally referred to as methods, and there is no 'mousedown' method in the JRE.
    OTOH a Swing JApplet inherits the mouseDown method from Component, and it was deprecated in Java 1.1. The documentation (JavaDocs) provides instructions on what to use instead.
    >
    is there any way to use it or any other alternative is available for this?
    if can provide me a sample code.>If can provide me cash. Short of that, you might actually need to do some research/coding of your own.
    As an aside. What does any of this have to do with Java 2D?

  • Maven giving "annotations are not supported in -source 1.3" for  @Entity

    I m using maven for spring, hibernate with jpa . When i m running comman "mvn clean install" ,it is giving error in compilation of a bean class which is using jpa annotations.The error is :
    annotations are not supported in -source 1.3
    (use -source 5 or higher to enable annotations)
    @Entity
    Pom.xml is as below :
    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.niit.core</groupId>
    <artifactId>Spring3Example</artifactId>
    <packaging>jar</packaging>
    <version>1.0-SNAPSHOT</version>
    <name>Spring3Example</name>
    <url>http://maven.apache.org</url>
    <properties>
    <org.springframework-version>3.1.2.RELEASE</org.springframework-version>
    </properties>
    <repositories>
    <repository>
    <id>JBoss Repo</id>
    <url>https://repository.jboss.org/nexus/content/repositories/thirdparty-releases</url>
    </repository>
    </repositories>
    <build>
    <plugins>
    <plugin>
    <artifactId>maven-war-plugin</artifactId>
    <version>2.0</version>
    </plugin>
    </plugins>
    </build>
    <dependencies>
    <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-context</artifactId>
    <version>${org.springframework-version}</version>
    </dependency>
    <!-- <dependency>
    <groupId>hsqldb</groupId>
    <artifactId>hsqldb</artifactId>
    <version>1.8.0.2</version>
    </dependency>
    -->
    <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-core</artifactId>
    <version>${org.springframework-version}</version>
    </dependency>
    <dependency>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
    <version>3.8.1</version>
    <scope>test</scope>
    </dependency>
    <dependency>
    <groupId>javax</groupId>
    <artifactId>javaee-api</artifactId>
    <version>6.0</version>
    <scope>provided</scope>
    </dependency>
    <dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-core</artifactId>
    <version>3.6.10.Final</version>
    </dependency>
    <dependency>
    <groupId>org.hibernate.java-persistence</groupId>
    <artifactId>jpa-api</artifactId>
    <version>2.0-cr-1</version>
    </dependency>
    <dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-entitymanager</artifactId>
    <version>3.5.0-Beta-2</version>
    </dependency>
    <dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>servlet-api</artifactId>
    <version>2.5</version>
    </dependency>
    </dependencies>
    </project>
    And class is as below :
    package com.niit.form;
    import javax.persistence.Column;
    import javax.persistence.Entity;
    import javax.persistence.GeneratedValue;
    import javax.persistence.Id;
    import javax.persistence.Table;
    @Entity
    @Table(name="CONTACTS")
    public class Contact {
    @Id
    @Column(name="ID")
    @GeneratedValue
    private Integer id;
    @Column(name="FIRSTNAME")
    private String firstname;
    public String getFirstname() {
    return firstname;
    public void setFirstname(String firstname) {
    this.firstname = firstname;
    public void setLastname(String lastname) {
    this.lastname = lastname;
    public Integer getId() {
    return id;
    public void setId(Integer id) {
    this.id = id;
    }

    java version is 1.6.0_24
    There is no settings.xml in users/.m2
    I think , maven is using default settings.xml which is in M2_HOME\conf which has everything commented as below:
    <?xml version="1.0" encoding="UTF-8"?>
    <!--
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements. See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership. The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License. You may obtain a copy of the License at
    http://www.apache.org/licenses/LICENSE-2.0
    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied. See the License for the
    specific language governing permissions and limitations
    under the License.
    -->
    <!--
    | This is the configuration file for Maven. It can be specified at two levels:
    |
    | 1. User Level. This settings.xml file provides configuration for a single user,
    | and is normally provided in $HOME/.m2/settings.xml.
    |
    | NOTE: This location can be overridden with the system property:
    |
    | -Dorg.apache.maven.user-settings=/path/to/user/settings.xml
    |
    | 2. Global Level. This settings.xml file provides configuration for all maven
    | users on a machine (assuming they're all using the same maven
    | installation). It's normally provided in
    | ${maven.home}/conf/settings.xml.
    |
    | NOTE: This location can be overridden with the system property:
    |
    | -Dorg.apache.maven.global-settings=/path/to/global/settings.xml
    |
    | The sections in this sample file are intended to give you a running start at
    | getting the most out of your Maven installation. Where appropriate, the default
    | values (values used when the setting is not specified) are provided.
    |
    |-->
    <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
    <!-- localRepository
    | The path to the local repository maven will use to store artifacts.
    |
    | Default: ~/.m2/repository
    <localRepository>/path/to/local/repo</localRepository>
    -->
    <!-- interactiveMode
    | This will determine whether maven prompts you when it needs input. If set to false,
    | maven will use a sensible default value, perhaps based on some other setting, for
    | the parameter in question.
    |
    | Default: true
    <interactiveMode>true</interactiveMode>
    -->
    <!-- offline
    | Determines whether maven should attempt to connect to the network when executing a build.
    | This will have an effect on artifact downloads, artifact deployment, and others.
    |
    | Default: false
    <offline>false</offline>
    -->
    <!-- pluginGroups
    | This is a list of additional group identifiers that will be searched when resolving plugins by their prefix, i.e.
    | when invoking a command line like "mvn prefix:goal". Maven will automatically add the group identifiers
    | "org.apache.maven.plugins" and "org.codehaus.mojo" if these are not already contained in the list.
    |-->
    <pluginGroups>
    <!-- pluginGroup
    | Specifies a further group identifier to use for plugin lookup.
    <pluginGroup>com.your.plugins</pluginGroup>
    -->
    </pluginGroups>
    <!-- proxies
    | This is a list of proxies which can be used on this machine to connect to the network.
    | Unless otherwise specified (by system property or command-line switch), the first proxy
    | specification in this list marked as active will be used.
    |-->
    <proxies>
    <!-- proxy
    | Specification for one proxy, to be used in connecting to the network.
    |
    <proxy>
    <id>optional</id>
    <active>true</active>
    <protocol>http</protocol>
    <username>proxyuser</username>
    <password>proxypass</password>
    <host>proxy.host.net</host>
    <port>80</port>
    <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
    </proxy>
    -->
    </proxies>
    <!-- servers
    | This is a list of authentication profiles, keyed by the server-id used within the system.
    | Authentication profiles can be used whenever maven must make a connection to a remote server.
    |-->
    <servers>
    <!-- server
    | Specifies the authentication information to use when connecting to a particular server, identified by
    | a unique name within the system (referred to by the 'id' attribute below).
    |
    | NOTE: You should either specify username/password OR privateKey/passphrase, since these pairings are
    | used together.
    |
    <server>
    <id>deploymentRepo</id>
    <username>repouser</username>
    <password>repopwd</password>
    </server>
    -->
    <!-- Another sample, using keys to authenticate.
    <server>
    <id>siteServer</id>
    <privateKey>/path/to/private/key</privateKey>
    <passphrase>optional; leave empty if not used.</passphrase>
    </server>
    -->
    </servers>
    <!-- mirrors
    | This is a list of mirrors to be used in downloading artifacts from remote repositories.
    |
    | It works like this: a POM may declare a repository to use in resolving certain artifacts.
    | However, this repository may have problems with heavy traffic at times, so people have mirrored
    | it to several places.
    |
    | That repository definition will have a unique id, so we can create a mirror reference for that
    | repository, to be used as an alternate download site. The mirror site will be the preferred
    | server for that repository.
    |-->
    <mirrors>
    <!-- mirror
    | Specifies a repository mirror site to use instead of a given repository. The repository that
    | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
    | for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
    |
    <mirror>
    <id>mirrorId</id>
    <mirrorOf>repositoryId</mirrorOf>
    <name>Human Readable Name for this Mirror.</name>
    <url>http://my.repository.com/repo/path</url>
    </mirror>
    -->
    </mirrors>
    <!-- profiles
    | This is a list of profiles which can be activated in a variety of ways, and which can modify
    | the build process. Profiles provided in the settings.xml are intended to provide local machine-
    | specific paths and repository locations which allow the build to work in the local environment.
    |
    | For example, if you have an integration testing plugin - like cactus - that needs to know where
    | your Tomcat instance is installed, you can provide a variable here such that the variable is
    | dereferenced during the build process to configure the cactus plugin.
    |
    | As noted above, profiles can be activated in a variety of ways. One way - the activeProfiles
    | section of this document (settings.xml) - will be discussed later. Another way essentially
    | relies on the detection of a system property, either matching a particular value for the property,
    | or merely testing its existence. Profiles can also be activated by JDK version prefix, where a
    | value of '1.4' might activate a profile when the build is executed on a JDK version of '1.4.2_07'.
    | Finally, the list of active profiles can be specified directly from the command line.
    |
    | NOTE: For profiles defined in the settings.xml, you are restricted to specifying only artifact
    | repositories, plugin repositories, and free-form properties to be used as configuration
    | variables for plugins in the POM.
    |
    |-->
    <profiles>
    <!-- profile
    | Specifies a set of introductions to the build process, to be activated using one or more of the
    | mechanisms described above. For inheritance purposes, and to activate profiles via <activatedProfiles/>
    | or the command line, profiles have to have an ID that is unique.
    |
    | An encouraged best practice for profile identification is to use a consistent naming convention
    | for profiles, such as 'env-dev', 'env-test', 'env-production', 'user-jdcasey', 'user-brett', etc.
    | This will make it more intuitive to understand what the set of introduced profiles is attempting
    | to accomplish, particularly when you only have a list of profile id's for debug.
    |
    | This profile example uses the JDK version to trigger activation, and provides a JDK-specific repo.
    <profile>
    <id>jdk-1.4</id>
    <activation>
    <jdk>1.4</jdk>
    </activation>
    <repositories>
    <repository>
    <id>jdk14</id>
    <name>Repository for JDK 1.4 builds</name>
    <url>http://www.myhost.com/maven/jdk14</url>
    <layout>default</layout>
    <snapshotPolicy>always</snapshotPolicy>
    </repository>
    </repositories>
    </profile>
    -->
    <!--
    | Here is another profile, activated by the system property 'target-env' with a value of 'dev',
    | which provides a specific path to the Tomcat instance. To use this, your plugin configuration
    | might hypothetically look like:
    |
    | ...
    | <plugin>
    | <groupId>org.myco.myplugins</groupId>
    | <artifactId>myplugin</artifactId>
    |
    | <configuration>
    | <tomcatLocation>${tomcatPath}</tomcatLocation>
    | </configuration>
    | </plugin>
    | ...
    |
    | NOTE: If you just wanted to inject this configuration whenever someone set 'target-env' to
    | anything, you could just leave off the <value/> inside the activation-property.
    |
    <profile>
    <id>env-dev</id>
    <activation>
    <property>
    <name>target-env</name>
    <value>dev</value>
    </property>
    </activation>
    <properties>
    <tomcatPath>/path/to/tomcat/instance</tomcatPath>
    </properties>
    </profile>
    -->
    </profiles>
    <!-- activeProfiles
    | List of profiles that are active for all builds.
    |
    <activeProfiles>
    <activeProfile>alwaysActiveProfile</activeProfile>
    <activeProfile>anotherAlwaysActiveProfile</activeProfile>
    </activeProfiles>
    -->
    </settings>

  • Using inherited fields from a non entity super class in a compound PK class

    Hi,
    Suppose you have a POJO class called BaseClass, which is decorated with @MappedSuperclass, so that its sub classes can become EJB entities:
    @MappedSuperclass
    public class BaseClass implements Serializable {
    protected int field1;
    protected int field2;
    }EntityOne class is a sub class of BaseClass and an EJB 3.0 entity.
    @Entity
    public class EntityOne extends BaseClass {
    @Id
    protected int field3
    }Everything would be fine up to this point. The problem begins when the following situation is given:
    EntityOne shall have a compound primary key, which is a combination of filed1, field2 and field3!
    Off course, I can define a primary key class EntityOnePK:
    public class EntityOnePK implements Serializable {
      protected int filed1;
      protected int filed2;
      protected int filed3;
      public int hashCode(){...}
      public boolean equals(....){....}
    }But the fields 1 and 2 can not be decorated with @Id annotation, since they are not defined in an entity class!
    Any ideas of how to resolve this situation?
    I had a look in the specification and some articles. I have to admit that the new inheritance features in the EJB 3.0 framework are a real improvement . However, in a bigger scale application, where persistence is only one of many aspects of the system, the introduced methodology of inheritance is not sufficient, i.e. the BaseClass has a lot of subclasses and is used in many packets as a POJO.
    To be more concrete, in our case there are good reasons not define the base class as an entity, mainly to avoid a corresponding table in the used DB, which is also interfacing with other software systems.
    Thanks in advance for your help,
    Mehran

    JAZN is indeed supported for a standalone client. Make sure that the client JVM is also configured for JAAS and has jazn.jar in the classpath.
    Regards,
    -Lee

Maybe you are looking for