6 Replies Latest reply on Dec 15, 2006 12:28 PM by kabirkhan

    Obscure error message

    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


        • 1. Re: Obscure error message
          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>
          
          
          
          


          • 2. Re: Obscure error message
            flavia.rainone.old

            You need to remove the wildcard from the pointcut expression. When JBoss AOP sees this wildcard, it thinks it is the return type value. And then it doesn't validate the "new" keyword, because this cannot be used with return type values.

            • 3. Re: Obscure error message
              fabiocsilva

              How I inform that the class can be public or private?

              • 4. Re: Obscure error message
                flavia.rainone.old

                I don't think there is a way to do this. Currently, the class expressions are all based on the name of the class, and not on its accessibility from other classes.
                However, you can specify the constructor to be private or public. But you put a wildcard in the place of the constructor accessibility constraint, since this will be interpreted as a return type, as I've told you.

                • 5. Re: Obscure error message
                  fabiocsilva

                  ok, I will not use modifier of access in pointcut

                  • 6. Re: Obscure error message
                    kabirkhan

                     

                    "flavia.rainone" wrote:
                    I don't think there is a way to do this. Currently, the class expressions are all based on the name of the class, and not on its accessibility from other classes.


                    Yes, we do not care if the class is private/public