[JBoss AOP] - Re: Can't read parameter annotations through reflection
by dwl8
Thank you both for your replies.
flavia, all my annotations are set to RetentionPolicy.RUNTIME. If only that was the issue... :)
stalep, I created a unit test and it read the annotation correctly. It seems that when I deploy it to my app server (Tomcat) the annotation can't be read. Here's a simple class I was using to recreate the issue.
| public class Person {
| private static HashMap<Integer,Person> peopleMap = new HashMap<Integer,Person>();
|
| @ReadLock
| public static Person getPerson(@FirmId Integer firmId) {
| try {
| Method m = Person.class.getMethod("getPerson",Integer.class);
| Annotation[][] paramAnnot = m.getParameterAnnotations();
| for(Annotation[] a : paramAnnot) {
| System.out.println("# of Annotations Found: " + a.length);
| //log.debug("# of Annotations Found: " + a.length);
| }
| } catch(NoSuchMethodException e) {
| System.out.println("Method not found");
| //log.debug("No Such Method");
| }
| return peopleMap.get(firmId);
| }
|
| public static void main(String[] args) {
| try {
| Method m = Person.class.getMethod("getPerson",Integer.class);
| Annotation[][] paramAnnot = m.getParameterAnnotations();
| for(Annotation[] a : paramAnnot) {
| System.out.println("# of Annotations Found: " + a.length);
| //log.debug("# of Annotations Found: " + a.length);
| }
| } catch(NoSuchMethodException e) {
| System.out.println("Method not found");
| //log.debug("No Such Method");
| }
| }
| }
|
when main is run, i get "# of Annotations Found: 1". However, when I make a call to getPerson after it's been deployed to Tomcat, I get "# of Annotations Found: 0". Strange.
Could anyone give this code a whirl and keep me from losing my sanity?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3991174#3991174
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3991174
19 years, 5 months
[JBoss AOP] - Re: Obscure error message
by fabiocsilva
Only to complement (xml complete):
|
| <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
| <aop>
| <aspect class="aspects.distribution.HealthWatcherServerSideAspect"
| scope="PER_VM" />
|
| <aspect class="aspects.distribution.HealthWatcherClientSideAspect"
| scope="PER_VM" />
|
|
|
| <aspect class="aspects.dataManagement.nonpersistent.DataCollectionNonPersistent"
| scope="PER_VM" />
|
|
|
| <aspect class="aspects.dataManagement.persistent.DataCollectionPersistent"
| scope="PER_VM" />
|
|
|
|
| <aspect class="aspects.dataManagement.persistent.PersistenceControlHealthWatcher"
| scope="PER_VM" />
|
| <pointcut
| expr="execution(public void gui.servlets.ServletWebServer->init(javax.servlet.ServletConfig))"
| name="facadeMainExecution" />
|
| <bind pointcut="facadeMainExecution">
| <advice
| aspect="aspects.distribution.HealthWatcherServerSideAspect"
| name="beforeFacadeMainExecution" />
| </bind>
|
|
| <pointcut name="facadeCallers"
| expr="within($instanceof{javax.servlet.http.HttpServlet})" />
|
| <!--
| <pointcut name="facadeCalls"
| expr="call(* controllers.HealthWatcherFacade->*(..)) AND !call(static * controllers.HealthWatcherFacade->*(..))" />
|
| -->
|
| <pointcut name="facadeCalls"
| expr="call(* $instanceof{aspects.distribution.rmi.IRemoteFacade}->*(..)) AND !call(static * $instanceof{aspects.distribution.rmi.IRemoteFacade}->*(..))" />
|
| <bind pointcut="facadeCallers AND facadeCalls">
| <advice
| aspect="aspects.distribution.HealthWatcherClientSideAspect"
| name="aroundFacadeLocalCalls" />
| </bind>
|
|
| <pointcut name="recordsCreation"
| expr="within($instanceof{aspects.dataManagement.util.SystemRecord}) AND !within($instanceof{AbstractDataCollectionCustomization})" />
|
| <introduction
| expr="class(complaint.ComplaintRecord)
| OR class(healthGuide.HealthUnitRecord)
| OR class(healthGuide.MedicalSpecialtyRecord)
| OR class(employee.EmployeeRecord)
| OR class(complaint.DiseaseRecord)">
| <mixin>
| <interfaces>
| aspects.dataManagement.util.SystemRecord
| </interfaces>
| <class>aspects.dataManagement.util.SystemRecordImpl</class>
| <construction>
| new aspects.dataManagement.util.SystemRecordImpl()
| </construction>
| </mixin>
| </introduction>
|
| <bind pointcut="recordsCreation">
| <advice
| aspect="aspects.dataManagement.nonpersistent.DataCollectionNonPersistent"
| name="aroundRecordsCreation" />
|
| <advice
| aspect="aspects.dataManagement.persistent.DataCollectionPersistent"
| name="aroundRecordsCreation" />
| </bind>
|
|
| <!--
| <pointcut name="connectionOperations"
| expr="call(void IPersistenceMechanism->connect()) OR
| call(void IPersistenceMechanism->disconnect())" />
|
| -->
|
| <pointcut name="initSystem"
| expr="call(* controllers.HealthWatcherFacade->new(..))" />
|
|
| <pointcut name="obtainPmInstance"
| expr="call(* aspects.dataManagement.dataCollections.rdbms.PersistenceMechanismRDBMS->getInstance(..))" />
|
| <bind pointcut="initSystem">
| <advice
| aspect="aspects.dataManagement.persistent.PersistenceControlHealthWatcher"
| name="aroundRecordsCreation" />
| </bind>
|
| </aop>
|
|
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3991171#3991171
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3991171
19 years, 5 months
[JBoss AOP] - Obscure error message
by fabiocsilva
The pointcut
| <pointcut name="initSystem"
| expr="call(* controllers.HealthWatcherFacade->new(..))" />
|
generates the error
| org.jboss.aop.pointcut.ast.PointcutExpressionParser$LookaheadSuccess
| at org.jboss.aop.pointcut.ast.PointcutExpressionParser.<init>(PointcutExpressionParser.java:3126)
| at org.jboss.aop.pointcut.PointcutExpression.<init>(PointcutExpression.java:61)
| at org.jboss.aop.AspectXmlLoader.deployPointcut(AspectXmlLoader.java:639)
| at org.jboss.aop.AspectXmlLoader.deployTopElements(AspectXmlLoader.java:1030)
| at org.jboss.aop.AspectXmlLoader.deployXML(AspectXmlLoader.java:886)
| at org.jboss.aop.AspectXmlLoader.deploy(AspectXmlLoader.java:1206)
| at org.jboss.aop.AspectXmlLoader.deployXML(AspectXmlLoader.java:1232)
| at org.jboss.aop.deployment.AspectDeployer.create(AspectDeployer.java:167)
| at org.jboss.deployment.MainDeployer.create(MainDeployer.java:969)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:818)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
| 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 org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy8.deploy(Unknown Source)
| at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
| at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
| at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
| at $Proxy0.start(Unknown Source)
| at org.jboss.system.ServiceController.start(ServiceController.java:417)
| at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy4.start(Unknown Source)
| at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
| at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
| 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 org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy5.deploy(Unknown Source)
| at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
| at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
| at org.jboss.Main.boot(Main.java:200)
| at org.jboss.Main$1.run(Main.java:490)
|
|
I don't understand the problem
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3991169#3991169
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3991169
19 years, 5 months
[Installation, Configuration & Deployment] - No ejb-relationship-role-name element found
by jain_prabhat
I was trying to migrate from weblogic to Jboss 3.2.7 I have added all the Jboss related xdoclet tags and also checked the generated jboss.xml and the jbosscmp-jdbc.xml and everything is looking fine. But whenever I try to deploy I get the above mentioned error though this element is configured in the jbosscmp-jdbc.xml, I am not finding any clues regarding it. Any information about this would be appreciated.
(I updated my xdoclet version to 1.2.3 from 1.2.1 thinking it might be the reason but to no avail ...)
Stack Trace:
2006-12-04 10:00:58,407 ERROR [org.jboss.ejb.EntityContainer] Starting failed jboss.j2ee:jndiName=ejb/xmcs/ReportLocal,service=EJB
org.jboss.deployment.DeploymentException: No ejb-relationship-role-name element found
at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationMetaData.getEJBRelationshipRoleElement(JDBCRelationMetaData.java:442)
at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCRelationMetaData.(JDBCRelationMetaData.java:347)
at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCApplicationMetaData.(JDBCApplicationMetaData.java:471)
at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCXmlFileLoader.load(JDBCXmlFileLoader.java:75)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadJDBCEntityMetaData(JDBCStoreManager.java:721)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.initStoreManager(JDBCStoreManager.java:409)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:353)
at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:155)
at org.jboss.ejb.EntityContainer.startService(EntityContainer.java:337)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)
at sun.reflect.GeneratedMethodAccessor82.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:198)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:899)
at $Proxy18.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:415)
at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:198)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
at $Proxy658.start(Unknown Source)
at org.jboss.ejb.EjbModule.startService(EjbModule.java:367)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)
at sun.reflect.GeneratedMethodAccessor82.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:198)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:899)
at $Proxy18.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:415)
at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:198)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
at $Proxy15.start(Unknown Source)
at org.jboss.ejb.EJBDeployer.start(EJBDeployer.java:570)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:829)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:821)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:641)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:604)
at sun.reflect.GeneratedMethodAccessor37.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:198)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
at $Proxy8.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:304)
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:460)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:201)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:212)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:191)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3991168#3991168
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3991168
19 years, 5 months
[Tomcat, HTTPD, Servlets & JSP] - cookies browser problem with ajax
by enazareno
Hi,
I have a recurring problem regarding cookies. We always have our users accept/unblock cookies in the browser otherwise it can't access especially our ajax routines. It's quite annoying because users might think the application sucks. In our development, even if we block cookies, it works. But when we put it in production, the problem occurs. Our setup is like this - We run Jboss 4.03 in Linux Fedora. Our DNS is hosted in Yahoo and points to our server. This setup is maintained by somebody else, so we can't figure out where the problem is. I was assuming when I would check say, www.mysite.com, it would return the IP of our server. Instead it returns a Yahoo IP address. Is there a problem with that setup? Also I noticed when browsing pages, our url does not change. It steadies at www.mysite.com. I was thinking it should have been www.mysite.com/index.htm for example. Thanks a lot. Would appreciate any reply.
Regards,
Elmo
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3991165#3991165
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3991165
19 years, 5 months
[JBoss Seam] - Re: Using textInput inside a dataTable inside a form?
by SmokingAPipe
Ok, following your suggestion, I removed all the Tomahawk components. Somehow they were working when they shouldn't have been. I removed all of them, and made it only one column, to just display (no input) the field I want to display, and I get an exception with this cause:
"value of context variable is not an instance of the component bound to the context variable"
So I am doing something wrong, I just need to figure out what it is. If I can figure that out, I can probably go back to the Tomahawk components, or whatever, but at least it will be working.
This whole system has so many pitfalls. Right now, if there's any error in a Servlet / JSP type of system, I can look at it and know where the error is within five minutes, because I'm so familiar with it. I feel like with the Seam world right now there are so many new things I'm unsure of where to begin to track bugs down.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3991163#3991163
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3991163
19 years, 5 months