[JBoss AOP] - Constructor Execution Pointcut Causing ArrayOutOfBounds
by Nicholas Whitehead
Nicholas Whitehead [http://community.jboss.org/people/nwhitehead] created the discussion
"Constructor Execution Pointcut Causing ArrayOutOfBounds"
To view the discussion, visit: http://community.jboss.org/message/564607#564607
--------------------------------------------------------------
Hello;
Java 1.6
JBoss AOP 2.1.8.GA
I have been wrestling with this for a while now. I have defined a pointcut for the execution of private constructors on classes annotated with *@EntityTXAttribute*. However, while the weaving is going on, an ArrayOutOfBounds exception occurs, and having run it through the debugger, it seems to make sense why, but I am noit sure how to fix it.
The pointcut expression is:
*execution(public !static * @entitypojo.annotations.EntityTXAttribute->*(..))
*
*OR execution(protected !static * @entitypojo.annotations.EntityTXAttribute->*(..))
*
*OR execution(private @entitypojo.annotations.EntityTXAttribute->new(..))*
*
*
or +*all public non-static methods in annotated classes, and all private constructors*.+
The method invocation interceptions work perfectly, btw.
My bean has 2 ctors, on parameterized and one not. I set a debugger break point on org.jboss.aop.Advisor line 1870 where the error occurs.
What I see is this:
The instance has an array called *constructors* which has 4 constructors in it, 2 of which I defined and 2 of which appear to be synthetic. They broadly look like this:
1. private Bean() (mine)
2. Bean(javassist.runtime.Inner) (synthetic)
3. private Bean(String, String) (mine)
4. Bean(String, String, javassist.runtime.Inner) (synthetic)
However, the array of *constructorInfos* only has 2 entries in it which are
1. private Bean() (mine)
2. private Bean(String, String) (mine)
The method code looks like this:
*protected void resolveConstructorPointcut(AdviceBinding binding)
{
for (int i = 0; i < constructors.length; i++)
{
Constructor<?> constructor = constructors[i];
if (binding.getPointcut().matchesExecution(this, constructor))
{
if (AspectManager.verbose) logger.debug("constructor matched binding: " + constructor);
adviceBindings.add(binding);
binding.addAdvisor(this);*
* // this is where the error occurs. Line 1870.
pointcutResolved(constructorInfos[i], binding, new ConstructorJoinpoint(constructor));
// if we must keep track of deprecated fields and the field is already initialized
if (AspectManager.maintainAdvisorMethodInterceptors && constructorInterceptors != null)
{
constructorInterceptors[i] = constructorInfos[i].getInterceptors();
}
}
}
}*
This code assumes the number of *constructorInfos* is at least the same as the number of *constructors*, but since it is not, it throws an array out of bounds exception.
Am I doing something wrong here, or is it a bug ?
Much appreciated.
//Nicholas
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/564607#564607]
Start a new discussion in JBoss AOP at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 3 months
[EJB 3.0] - jboss6 M4 Hibernate @Any annotation
by Pieter Martin
Pieter Martin [http://community.jboss.org/people/pieter.martin] created the discussion
"jboss6 M4 Hibernate @Any annotation"
To view the discussion, visit: http://community.jboss.org/message/564601#564601
--------------------------------------------------------------
Hi,
I am trying to deploy a entity with hibernate's @Any annotation and am getting the following exception
19:33:31,552 ERROR [AbstractKernelController] Error installing to Start: name=persistence.unit:unitName=#primary state=Create: java.lang.UnsupportedOperationException: any not supported yet
at org.hibernate.ejb.metamodel.AttributeFactory.determineAttributeMetadata(AttributeFactory.java:452) [:3.5.2-Final]
at org.hibernate.ejb.metamodel.AttributeFactory.buildAttribute(AttributeFactory.java:93) [:3.5.2-Final]
at org.hibernate.ejb.metamodel.MetadataContext.wrapUp(MetadataContext.java:183) [:3.5.2-Final]
at org.hibernate.ejb.metamodel.MetamodelImpl.buildMetamodel(MetamodelImpl.java:66) [:3.5.2-Final]
at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:83) [:3.5.2-Final]
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:887) [:3.5.2-Final]
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:73) [:3.5.2-Final]
at org.jboss.jpa.builder.DefaultCEMFBuilder.build(DefaultCEMFBuilder.java:47) [:1.0.2-alpha-1]
at org.jboss.as.jpa.scanner.HackCEMFBuilder.build(HackCEMFBuilder.java:49) [:6.0.0.20100721-M4]
at org.jboss.jpa.deployment.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:275) [:1.0.2-alpha-1]
What is required to make @Any work.
The hibernate-annotations.jar in jboss/client directory does contain the @Any annotation.
Thanks
Pieter
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/564601#564601]
Start a new discussion in EJB 3.0 at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 3 months
[jBPM] - jBPM 3.2.7 / WebSphere 7.0 / Oracle 10g - Timer not working
by Rohit Raghuwanshi
Rohit Raghuwanshi [http://community.jboss.org/people/rohit_r] created the discussion
"jBPM 3.2.7 / WebSphere 7.0 / Oracle 10g - Timer not working"
To view the discussion, visit: http://community.jboss.org/message/564445#564445
--------------------------------------------------------------
Hi all,
first post here. I have deployed jBPM 3.2.7 on webpshere 7.0 and oracle 10g as database. A simple process works fine for me. But when I deploy a process which contains a state with timer on it I get the error shown below. Would really appreciate some help here.
Thanks!
Error below >>>>
[9/30/10 19:58:34:977 EDT] 00000094 ProxyWarnLog W org.hibernate.engine.StatefulPersistenceContext narrowProxy Narrowing proxy to class org.jbpm.graph.node.State - this operation breaks ==
[9/30/10 19:58:35:008 EDT] 00000094 EntitySchedul E org.jbpm.scheduler.ejbtimer.EntitySchedulerService createTimer failed to retrieve entity for Timer(Wait2Min,2010-09-30 20:00:34,992,Token(/))
javax.ejb.ObjectNotFoundException: 308
at com.ibm.ejs.container.EJSHome.activateBean_Common(EJSHome.java:2097)
at com.ibm.ejs.container.EJSHome.activateBean_Local(EJSHome.java:1954)
at org.jbpm.ejb.EJSCMPTimerEntityBeanHomeBean_a0ee9f83.findByPrimaryKey_Local(Unknown Source)
at org.jbpm.ejb.EJSLocalCMPTimerEntityBeanHome_a0ee9f83.findByPrimaryKey(Unknown Source)
at org.jbpm.scheduler.ejbtimer.EntitySchedulerService.createTimer(EntitySchedulerService.java:44)
at org.jbpm.scheduler.def.CreateTimerAction.execute(CreateTimerAction.java:80)
at org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:280)
at org.jbpm.graph.def.GraphElement.executeActions(GraphElement.java:237)
at org.jbpm.graph.def.GraphElement.fireAndPropagateEvent(GraphElement.java:207)
at org.jbpm.graph.def.GraphElement.fireEvent(GraphElement.java:190)
at org.jbpm.graph.def.Node.enter(Node.java:358)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:600)
at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$de44cfb4.enter(<generated>)
at org.jbpm.graph.def.Transition.take(Transition.java:151)
at org.jbpm.graph.def.Node.leave(Node.java:453)
at org.jbpm.graph.def.Node.leave(Node.java:415)
at org.jbpm.graph.def.Node.execute(Node.java:407)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:600)
at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$de44cfb4.execute(<generated>)
at org.jbpm.job.ExecuteNodeJob.execute(ExecuteNodeJob.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:600)
at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
at org.jbpm.job.Job$$EnhancerByCGLIB$$72c1f597.execute(<generated>)
at org.jbpm.ejb.impl.ExecuteJobCommand.executeJob(ExecuteJobCommand.java:78)
at org.jbpm.ejb.impl.ExecuteJobCommand.execute(ExecuteJobCommand.java:53)
at org.jbpm.ejb.impl.CommandServiceBean.execute(CommandServiceBean.java:147)
at org.jbpm.ejb.EJSLocalStatelessCommandServiceBean_04d87f85.execute(Unknown Source)
at org.jbpm.ejb.impl.CommandListenerBean.onMessage(CommandListenerBean.java:111)
at com.ibm.ejs.container.MessageEndpointHandler.invokeMdbMethod(MessageEndpointHandler.java:1092)
at com.ibm.ejs.container.MessageEndpointHandler.invoke(MessageEndpointHandler.java:777)
at $Proxy97.onMessage(Unknown Source)
at com.ibm.ws.sib.api.jmsra.impl.JmsJcaEndpointInvokerImpl.invokeEndpoint(JmsJcaEndpointInvokerImpl.java:233)
at com.ibm.ws.sib.ra.inbound.impl.SibRaDispatcher.dispatch(SibRaDispatcher.java:900)
at com.ibm.ws.sib.ra.inbound.impl.SibRaSingleProcessListener$SibRaWork.run(SibRaSingleProcessListener.java:550)
at com.ibm.ejs.j2c.work.WorkProxy.run(WorkProxy.java:399)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1550)
[9/30/10 19:58:34:977 EDT] 00000094 ProxyWarnLog W org.hibernate.engine.StatefulPersistenceContext narrowProxy Narrowing proxy to class org.jbpm.graph.node.State - this operation breaks ==
[9/30/10 19:58:35:008 EDT] 00000094 EntitySchedul E org.jbpm.scheduler.ejbtimer.EntitySchedulerService createTimer failed to retrieve entity for Timer(Wait2Min,2010-09-30 20:00:34,992,Token(/))
javax.ejb.ObjectNotFoundException: 308
at com.ibm.ejs.container.EJSHome.activateBean_Common(EJSHome.java:2097)
at com.ibm.ejs.container.EJSHome.activateBean_Local(EJSHome.java:1954)
at org.jbpm.ejb.EJSCMPTimerEntityBeanHomeBean_a0ee9f83.findByPrimaryKey_Local(Unknown Source)
at org.jbpm.ejb.EJSLocalCMPTimerEntityBeanHome_a0ee9f83.findByPrimaryKey(Unknown Source)
at org.jbpm.scheduler.ejbtimer.EntitySchedulerService.createTimer(EntitySchedulerService.java:44)
at org.jbpm.scheduler.def.CreateTimerAction.execute(CreateTimerAction.java:80)
at org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:280)
at org.jbpm.graph.def.GraphElement.executeActions(GraphElement.java:237)
at org.jbpm.graph.def.GraphElement.fireAndPropagateEvent(GraphElement.java:207)
at org.jbpm.graph.def.GraphElement.fireEvent(GraphElement.java:190)
at org.jbpm.graph.def.Node.enter(Node.java:358)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:600)
at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$de44cfb4.enter(<generated>)
at org.jbpm.graph.def.Transition.take(Transition.java:151)
at org.jbpm.graph.def.Node.leave(Node.java:453)
at org.jbpm.graph.def.Node.leave(Node.java:415)
at org.jbpm.graph.def.Node.execute(Node.java:407)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:600)
at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$de44cfb4.execute(<generated>)
at org.jbpm.job.ExecuteNodeJob.execute(ExecuteNodeJob.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:600)
at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:157)
at org.jbpm.job.Job$$EnhancerByCGLIB$$72c1f597.execute(<generated>)
at org.jbpm.ejb.impl.ExecuteJobCommand.executeJob(ExecuteJobCommand.java:78)
at org.jbpm.ejb.impl.ExecuteJobCommand.execute(ExecuteJobCommand.java:53)
at org.jbpm.ejb.impl.CommandServiceBean.execute(CommandServiceBean.java:147)
at org.jbpm.ejb.EJSLocalStatelessCommandServiceBean_04d87f85.execute(Unknown Source)
at org.jbpm.ejb.impl.CommandListenerBean.onMessage(CommandListenerBean.java:111)
at com.ibm.ejs.container.MessageEndpointHandler.invokeMdbMethod(MessageEndpointHandler.java:1092)
at com.ibm.ejs.container.MessageEndpointHandler.invoke(MessageEndpointHandler.java:777)
at $Proxy97.onMessage(Unknown Source)
at com.ibm.ws.sib.api.jmsra.impl.JmsJcaEndpointInvokerImpl.invokeEndpoint(JmsJcaEndpointInvokerImpl.java:233)
at com.ibm.ws.sib.ra.inbound.impl.SibRaDispatcher.dispatch(SibRaDispatcher.java:900)
at com.ibm.ws.sib.ra.inbound.impl.SibRaSingleProcessListener$SibRaWork.run(SibRaSingleProcessListener.java:550)
at com.ibm.ejs.j2c.work.WorkProxy.run(WorkProxy.java:399)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1550)
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/564445#564445]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 3 months
Probem with the same name for persistence unit with separate wars in JBOSS 5.1.0
by Alexander Vaysberg
Hi,
I have a problem with 2 wars (a.war and b.war), which have the
persistence jar with persistence.xml. The persistence xml for both jars
has persistence unit with same name <persistence-unit name=/"default"…
/(The Datasource for each persistence unit aren’t the same). But if I
deploy on the JBOSS AS 5.1.0 the both war, only the first war deploy on
the second I have a problem (Exception):
2010-10-01 09:51:26,477 ERROR
[org.jboss.kernel.plugins.dependency.AbstractKernelController] (main)
Error installing to Real:
name=vfszip:/usr/local/jboss-5.1.0.GA-jdk5/server/rb_std_dev/deploy/b.war
/ state=PreReal mode=Manual requiredState=Real
org.jboss.deployers.spi.DeploymentException: Error deploying:
persistence.unit:unitName=#default
at
org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
at
org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:125)
at
org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:51)
at
org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
at
org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
at
org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
at
org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
at
org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
at
org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)
at
org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
at
org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
In SPEC for EJB 3.0 I have read:
“*6.2.2 Persistence Unit Scope*
…
When referencing a persistence unit using the unitName annotation
element or persistence-
unit-name deployment descriptor element, the visibility scope of the
persistence unit is
determined by its point of definition. A persistence unit that is
defined at the level of an EJB-JAR,WAR,
or application client jar is scoped to that EJB-JAR, WAR, or application
jar respectively and is visible to
the components defined in that jar or war…”
What is wrong?
14 years, 3 months