[Javassist user questions] - Inconsistent or missing stackmap error in midlet class files
by shivurx
Hi I am using Javassist to modify a MIDlet class. I was successfully able to change the midlet class file.
The changes i did are as follows
1. copied the startApp() method body to a new method and set new body for startApp().
2. add 2 additional methods.
3. I then called methods.getMethodInfo().rebuildStackMap(classPool) on all the methods of the midlet class
4. called rebuildClassFile()
5. called writeFile() to finally write the class file out to the disk.
I could view the changes in Bytecode viewer.
But when i try to run the application with WTK emulator it gives me an error as follows:
Error verifying method com/test/TestApp commandAction(Ljavax/microedition/lcdui/Command;Ljavax/microedition/lcdui/Displayable;)V
Approximate bytecode offset 9: Inconsistent or missing stackmap at target
Method............: 10233084 'com/sun/midp/midlet/MIDletState.createMIDlet (static)'
I have not made any changes to commandAction() method.
I am not sure what is wrong, I would really appreciate if someone could shed some light on this.
Thanks
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4228810#4228810
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4228810
16 years, 11 months
[EJB 3.0] - EJB jar cannot be deployed as a library (JBoss 5.0.1.GA)
by bcowdery
Hi All...
I have a core jar that contains the majority of our business objects as EJB3 entity beans and some simple EJB3 Stateless DAO beans (see Hibernates suggested DAO pattern - caveat emptor example/GenericDAO). This is packaged as objectmodel-core.jar
In most cases this jar is packaged in a deployable EAR as an EJB jar, however we have some applications that use the defined business objects as POJO's and not EJB entity beans (no usage of @EJB, @Resource or any other type of injection - no usage of persistance units, entity managers and the like... pure POJO).
In this case we have an application.xml that looks like
<?xml version="1.0" encoding="UTF-8"?>
| <application xmlns="http://java.sun.com/xml/ns/javaee"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd"
| version="5">
| <module>
| <web>
| <web-uri>webapp.war</web-uri>
| <context-root>/application-web</context-root>
| </web>
| </module>
|
| <library-directory>lib</library-directory>
| </application>
with objectmodel-core.jar included in the library-directory
On deployment to JBoss 5.0.1.GA i get an exception stating that it can't find persistence unit named 'null':
2009-05-05 12:43:08,797 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (HDScanner) Error installing to Real: name=vfszip:/data/apps/jboss-5.0.1.GA/server/jb5-cluster-node0/deploy/subscription.ear/ state=PreReal mode=Manual requiredState=Real
| org.jboss.deployers.spi.DeploymentException: Error deploying subscription.ear: Container jboss.j2ee:ear=subscription.ear,jar=application.ear,name=AnswerDAOImpl,service=EJB3 failed to resolve persistence unit null
| at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:201)
| at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:103)
| at org.jboss.deployers.vfs.spi.deployer.AbstractVFSRealDeployer.internalDeploy(AbstractVFSRealDeployer.java:45)
| 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.install(DeployersImpl.java:1098)
| 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:781)
| at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:698)
| at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:290)
| at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
| at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
| at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:280)
| at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:135)
| at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:65)
| at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:142)
| at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:166)
| at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
| at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: java.lang.IllegalArgumentException: Container jboss.j2ee:ear=subscription.ear,jar=subscription.ear,name=AnswerDAOImpl,service=EJB3 failed to resolve persistence unit null
| at org.jboss.injection.PersistenceUnitHandler.addPUDependency(PersistenceUnitHandler.java:135)
| at org.jboss.injection.PersistenceContextHandler.loadXml(PersistenceContextHandler.java:76)
| at org.jboss.ejb3.EJBContainer.processMetadata(EJBContainer.java:588)
| at org.jboss.ejb3.Ejb3Deployment.processEJBContainerMetadata(Ejb3Deployment.java:415)
| at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:523)
| at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:194)
| ... 27 more
| Caused by: java.lang.IllegalArgumentException: Can't find a persistence unit named 'null' in AbstractVFSDeploymentContext@2127445{vfszip:/data/apps/jboss-5.0.1.GA/server/jb5-cluster-node0/deploy/subscription.ear/}
| at org.jboss.jpa.resolvers.BasePersistenceUnitDependencyResolver.resolvePersistenceUnitSupplier(BasePersistenceUnitDependencyResolver.java:107)
| at org.jboss.ejb3.Ejb3Deployment.resolvePersistenceUnitSupplier(Ejb3Deployment.java:720)
| at org.jboss.ejb3.EJBContainer.resolvePersistenceUnitSupplier(EJBContainer.java:1428)
| at org.jboss.injection.PersistenceUnitHandler.addPUDependency(PersistenceUnitHandler.java:130)
| ... 32 more
There are zero usages of AnswerDAOImpl or its service interface, and absolutely no usages of any Entity beans save for one single class being used as a simple POJO.
This worked in JBoss 4.2.2.GA so I'm not sure whats going on. IMHO JBoss's deployment scanner shouldn't be touching this jar at all as its not referenced by the application.xml ...
Anyone have any idea's whats going on here? how can I deploy this application without JBoss attempting to deploy the persistance unit (i've tried removing all persistence.xml and like configuration files from the jar - no dice).
Thanks for your help.
-Brian
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4228794#4228794
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4228794
16 years, 12 months
[JBoss jBPM] - jBPM 4 Process archive with custom classes
by mpradny
Hello,
I'm testing jbpm4 for one of my projects and I got into troubles. I'm able to deploy process using xml file or .par archive, but I'm not able to use custom java classes in the process if I don't put them physically in the java class path.
I can see them stored in the database, but so far I haven't found any way how to configure the class loader to use them. I get only class not found exception all the time.
I've searched through the source codes and have found DeploymentClassLoader, but I haven't found a way how to use it.
Am I missing something in my configuration or is it not supported right now.
I want to use jbpm emebedded in servlet running on very simple servlet container that doesn't support dynamic deployment, so this would be only way to deploy these classes without container restart :(
Thank you for advices
Martin
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4228778#4228778
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4228778
16 years, 12 months