[Design of POJO Server] - Re: NPE in TransactionScopedEntityManager
by alesj
After my fix, I see this duplicate MBean registration:
| 11:32:41,500 WARN [AbstractDeploymentContext] Unable to register deployment mbean persistence.unit:unitName=jboss-seam-dvd.ear/jboss-seam-dvd.jar#dvdDatabase
| javax.management.InstanceAlreadyExistsException: jboss.deployment:id="persistence.unit:unitName=jboss-seam-dvd.ear/jboss-seam-dvd.jar#dvdDatabase",type=Component already registered.
| at org.jboss.mx.server.registry.BasicMBeanRegistry.add(BasicMBeanRegistry.java:767)
| at org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMBeanRegistry.java:236)
| at sun.reflect.GeneratedMethodAccessor74.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:157)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:138)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
| at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:140)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
| at org.jboss.mx.server.MBeanServerImpl$3.run(MBeanServerImpl.java:1431)
| at java.security.AccessController.doPrivileged(Native Method)
| at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:1426)
| at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:376)
| at org.jboss.deployers.structure.spi.helpers.AbstractDeploymentContext.registerMBeans(AbstractDeploymentContext.java:989)
| at org.jboss.deployers.structure.spi.helpers.AbstractDeploymentContext.addComponent(AbstractDeploymentContext.java:719)
| at org.jboss.deployers.structure.spi.helpers.AbstractDeploymentUnit.addComponent(AbstractDeploymentUnit.java:249)
| at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataFactoryVisitor.addBeanComponent(BeanMetaDataFactoryVisitor.java:52)
| at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataFactoryVisitor.deploy(BeanMetaDataFactoryVisitor.java:126)
| at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployerWithInput.deploy(AbstractRealDeployerWithInput.java:125)
| at org.jboss.deployers.spi.deployer.helpers.AbstractComponentDeployer.deployComponents(AbstractComponentDeployer.java:102)
| at org.jboss.deployers.spi.deployer.helpers.AbstractComponentDeployer.internalDeploy(AbstractComponentDeployer.java:82)
| 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:1410)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1128)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1181)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1069)
| at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
| at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:752)
| at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:541)
| at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:265)
| at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:143)
| at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:410)
| at org.jboss.Main.boot(Main.java:209)
|
As components are auto(magically) registered by DeploymentContext.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4187288#4187288
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4187288
17 years, 5 months
[Design of JBoss jBPM] - donating an ANT task to the jBPM project
by tom.baeyens@jboss.com
on behalf of Jim:
"Jim" wrote : I've enhanced an existing ANT task called GenJar -- http://genjar.sourceforge.net/ that is LGPL licensed, and have received the OK from my boss to donate it back to the jBPM project. The original task walks the dependency tree of the classes of interest and builds the list of classes to put in a jar. I had modified the main class of the task and added another class so it will inspect the processdefinition.xml file being deployed and walk the dependency tree of all of the delegation classes that all of the handlers call out to.
|
| There are a few upsides:
| - Smaller deployment to the database
| - Deploy time checking of class names (I've deployed processes with wrong package / class name before, and it blows up at runtime -- this catches it at deploy time)
| - fairly easy to use
|
| One drawback:
| - Interface based programming isn't possible (I think this can be worked around with Spring Java Config)
|
|
| Please let me know how best to proceed so I can donate the code to the jBPM project.
|
| Thanks,
| Jim
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4187278#4187278
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4187278
17 years, 5 months
[Design of POJO Server] - Re: NPE in TransactionScopedEntityManager
by alesj
I know what is the issue. ;-)
It's this change:
- https://jira.jboss.org/jira/browse/JBDEPLOY-118
The problem there is that you're by-passing BMDFVisitor
that adds CLASS level scope to DUs Scope:
| protected DeploymentUnit addComponent(DeploymentUnit unit, BeanMetaData attachment)
| {
| DeploymentUnit component = super.addComponent(unit, attachment);
| String className = attachment.getBean();
| if (className != null)
| {
| Object qualifier;
| if (attachment.getClassLoader() == null)
| {
| ClassLoader cl = unit.getClassLoader();
| try
| {
| qualifier = cl.loadClass(className);
| }
| catch (Exception e)
| {
| throw new IllegalArgumentException("Exception loading class for ScopeKey addition.", e);
| }
| }
| else
| {
| qualifier = className;
| }
| component.getScope().addScope(CommonLevels.CLASS, qualifier);
| }
|
| return component;
| }
|
So, the solution is that you stop hacking around components. ;-)
Component deployer shouldn't create new attachments, else similar issues can pop up.
Perhaps do this:
| DeploymentUnit parent = unit.getParent();
| if (parent == null)
| throw new IllegalArgumentException("Should not be null as this unit should be component.");
|
| parent.addAttachment(BeanMetaData.class.getName() + "." + name, builder.getBeanMetaData(), BeanMetaData.class);
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4187259#4187259
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4187259
17 years, 5 months
[Design of POJO Server] - Re: NPE in TransactionScopedEntityManager
by wolfc
The dependency is declared:
2008-11-06 10:02:11,616 INFO [org.jboss.ejb3.deployers.JBossASKernel:103] (RMI TCP Connection(2)-127.0.0.1) Created KernelDeployment for: ejb3_annotations_entity_stateless3_vehicle_ejb.jar
| 2008-11-06 10:02:11,617 INFO [org.jboss.ejb3.deployers.JBossASKernel:114] (RMI TCP Connection(2)-127.0.0.1) installing bean: jboss.j2ee:ear=ejb3_annotations_entity_vehicles.ear,jar=ejb3_annotations_entity_stateless3_vehicle_ejb.jar,name=Stateless3VehicleBean,service=EJB3
| 2008-11-06 10:02:11,619 INFO [org.jboss.ejb3.deployers.JBossASKernel:115] (RMI TCP Connection(2)-127.0.0.1) with dependencies:
| 2008-11-06 10:02:11,620 INFO [org.jboss.ejb3.deployers.JBossASKernel:125] (RMI TCP Connection(2)-127.0.0.1) and demands:
| 2008-11-06 10:02:11,621 INFO [org.jboss.ejb3.deployers.JBossASKernel:128] (RMI TCP Connection(2)-127.0.0.1) jboss.ejb:service=EJBTimerService
| 2008-11-06 10:02:11,623 INFO [org.jboss.ejb3.deployers.JBossASKernel:128] (RMI TCP Connection(2)-127.0.0.1) persistence.unit:unitName=ejb3_annotations_entity_vehicles.ear/lib/ejb3_annotations_entity.jar#CTS-EM
| 2008-11-06 10:02:11,623 INFO [org.jboss.ejb3.deployers.JBossASKernel:130] (RMI TCP Connection(2)-127.0.0.1) and supplies:
| 2008-11-06 10:02:11,624 INFO [org.jboss.ejb3.deployers.JBossASKernel:133] (RMI TCP Connection(2)-127.0.0.1) jndi:ejb3_annotations_entity_vehicles/Stateless3VehicleBean/remote-com.sun.ts.tests.common.vehicle.stateless3.Stateless3VehicleIF
| 2008-11-06 10:02:11,625 INFO [org.jboss.ejb3.deployers.JBossASKernel:133] (RMI TCP Connection(2)-127.0.0.1) Class:com.sun.ts.tests.common.vehicle.stateless3.Stateless3VehicleIF
| 2008-11-06 10:02:11,626 INFO [org.jboss.ejb3.deployers.JBossASKernel:133] (RMI TCP Connection(2)-127.0.0.1) jndi:ejb3_annotations_entity_stateless3_vehicle_Stateless3VehicleBean
| 2008-11-06 10:02:11,627 INFO [org.jboss.ejb3.deployers.JBossASKernel:140] (RMI TCP Connection(2)-127.0.0.1) Added bean(jboss.j2ee:ear=ejb3_annotations_entity_vehicles.ear,jar=ejb3_annotations_entity_stateless3_vehicle_ejb.jar,name=Stateless3VehicleBean,service=EJB3) to KernelDeployment of: ejb3_annotations_entity_stateless3_vehicle_ejb.jar
I've added an assertion to PersistenceUnitDeployment.create:
2008-11-06 10:02:11,701 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController:955] (RMI TCP Connection(2)-127.0.0.1) Error installing to Create: name=persistence.unit:unitName=ejb3_annotations_entity_vehicles.ear/lib/ejb3_annotations_entity.jar#CTS-EM state=Configured
| java.lang.AssertionError: xpcResolver wasn't set on org.jboss.jpa.deployment.PersistenceUnitDeployment@3ba624
| at org.jboss.jpa.deployment.PersistenceUnitDeployment.create(PersistenceUnitDeployment.java:92)
| 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.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59)
| at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150)
| at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
| at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:241)
| at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47)
| at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:109)
| at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:70)
| at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:221)
| at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54)
| at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42)
| at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
| at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
| at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
| at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
| at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:774)
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:540)
| at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:121)
| 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:1410)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1128)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1149)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1181)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1069)
| at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
| at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:752)
| at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:541)
So MC didn't inject.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4187226#4187226
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4187226
17 years, 5 months
[Design of POJO Server] - Re: NPE in TransactionScopedEntityManager
by alesj
"ALRubinger" wrote : The issue is that @Inject is not getting called on setXPCResolver() of PersistenceUnitDeployment
With the following design
| AbstractBeanMetaData beanMetaData = new AbstractBeanMetaData(name, PersistenceUnitDeployment.class.getName());
| BeanMetaDataBuilder builder = BeanMetaDataBuilder.createBuilder(beanMetaData);
| builder.setConstructorValue(pu);
| addDependencies(builder, metaData);
|
| unit.addAttachment(BeanMetaData.class, builder.getBeanMetaData());
|
I see a couple of possible issues:
1) somebody else is also putting some BMD under BMD.class.getName attachment -- hence overlapping/'overridding' our PU
2) there might be zero / multiple matching XPCResolvers -- or do we chech somewhere that this PU is in Installed state?
3) how do we know this PU is gonna be handled by MC before that EJB -- where is the explicit dependency?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4187215#4187215
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4187215
17 years, 5 months