Re: [jboss-user] [Javassist] - How can get the initial member field value?
by Stuart Douglas
Stuart Douglas [http://community.jboss.org/people/swd847] replied to the discussion
"How can get the initial member field value?"
To view the discussion, visit: http://community.jboss.org/message/546350#546350
--------------------------------------------------------------
This stuff is set in the constructor, so some of it can be extracted, probably not it the format you want though.
For integer fields the bytecode code that gets generated would look something like:
ALOAD_0 //put the this pointer on the stack
ICONST_2 //put the integer constant 2 on the stack
PUTFIELD com/mydomain/Point.x //set the field value.
The hashmap field would be slightly more complex:
ALOAD_0 //put the this pointer on the stack
ANEW java/util/HashMap //create the hashmap instance
DUP //duplicate it so it is still on the stack after the constructor call
INVOKESPECIAL java/util/HashMap.<init> //call the constructor
PUTFIELD com/mydomain/Point.hashMap //set the field value.
To actually extract this information you would need to write some kind of bytecode analyser, and even then there would be cases that it could not handle correctly, as you would also need some kind of dissasembler to go back from the bytecode into java.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/546350#546350]
Start a new discussion in Javassist at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
16 years
[Javassist] - How can get the initial member field value?
by xeo show
xeo show [http://community.jboss.org/people/xeoshow] created the discussion
"How can get the initial member field value?"
To view the discussion, visit: http://community.jboss.org/message/546345#546345
--------------------------------------------------------------
Hello, dear all
I want to get the initial member field value via javassist, can that be achived?
For example, sample class as below. I just want exactly get the 2 for x, 3 for y, and "world" for str, and "hello" for s, and the string "new HashMap()" for hashMap (not the result of new HashMap(), just the string "new HashMap()"). Can this be done via javassist? Thanks a lot.
---------------------------------
public class Point {
static int x = 2;
int y = 3;
static String str = "world";
String s = "hello";
HashMap hashMap = new HashMap();
void move(int m, int n) {
x = x + m;
y += n;
hashMap.put("name", "hashmap");
}
}
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/546345#546345]
Start a new discussion in Javassist at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
16 years
Re: [jboss-user] [JBoss Tools] - WEB-INF/lib remains empty after deployment
by henk de boer
henk de boer [http://community.jboss.org/people/henk53] replied to the discussion
"WEB-INF/lib remains empty after deployment"
To view the discussion, visit: http://community.jboss.org/message/546339#546339
--------------------------------------------------------------
> Denis Golovin wrote:
>
> JBossTools 3.1.1. should be out till the end of the month.
Okay, and what about this month? Will we see a 3.1.1 in June? ;)
Anyway, in case some extra information about this bug is still needed; it seems the Mac is also more susceptible to this bug. On my own Mac (OS X 10.5), the problem is 100% reproducible. I.e. I *always* have it right after I start up Eclipse.
Now a co-worker of my who's also using a Mac never had this problem, but he was still running on Eclipse 3.5.1/JBoss tools 3.1.0RC2. He just upgraded to Eclipse 3.5.2/JBoss tools 3.1.0GA, and he immediately had the empty WEB-INF/lib. After the by now well known workaround of closing and re-opening the affected project, and performing the clean operation on the server runtime, the libs were back.
Meanwhile, I almost never see the problem on my Ubuntu box, which is also running Eclipse 3.5.2/JBoss tools 3.1.0GA.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/546339#546339]
Start a new discussion in JBoss Tools at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
16 years
[EJB 3.0] - ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy
by Benjamin Seyinbour
Benjamin Seyinbour [http://community.jboss.org/people/ebross] created the discussion
"ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy"
To view the discussion, visit: http://community.jboss.org/message/546338#546338
--------------------------------------------------------------
Using: Linux/JEE 5/GateIn-3.1.0-CR01/JSF 1.2
Until yesterday, my EAR application was running without any problem, but I am now having the problem below. It seems to stem from my EJB project deployed inside an ear, which also includes a war file, EJB Client file and other utility files. have used TRACE to dig into it and also looked into the AnnotationParser class but still have no clue what exactly the problem is. It refers to annotations but which one and in which file – I have over 500 EJB files with annotations. Any suggestions would be welcomed?
Thanks.
2010-06-05 11:18:01,075 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (main) Error installing to PostClassLoader: name=vfszip:/home/dev/tools/GateIn-3.1.0-CR01/server/all/deploy/xxxxEAR.ear/ state=ClassLoader mode=Manual requiredState=PostClassLoader
org.jboss.deployers.spi.DeploymentException: Cannot process metadata
at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
at org.jboss.deployment.AnnotationMetaDataDeployer.deploy(AnnotationMetaDataDeployer.java:181)
at org.jboss.deployment.AnnotationMetaDataDeployer.deploy(AnnotationMetaDataDeployer.java:93)
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:1210)
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:1631)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
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:702)
at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
at org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployAction.java:70)
at org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileAction.java:53)
at org.jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfileService.java:361)
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
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.system.server.profileservice.repository.AbstractProfileService.activateProfile(AbstractProfileService.java:306)
at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:271)
at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)
at org.jboss.Main.boot(Main.java:221)
at org.jboss.Main$1.run(Main.java:556)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy
at sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:653)
at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:460)
at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:286)
at sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:222)
at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:69)
at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:52)
at java.lang.Class.initAnnotationsIfNecessary(Class.java:3070)
at java.lang.Class.getAnnotation(Class.java:3029)
at org.jboss.metadata.annotation.finder.DefaultAnnotationFinder.getAnnotation(DefaultAnnotationFinder.java:38)
at org.jboss.metadata.annotation.creator.ejb.jboss.StatefulProcessor.create(StatefulProcessor.java:61)
at org.jboss.metadata.annotation.creator.ejb.jboss.StatefulProcessor.create(StatefulProcessor.java:44)
at org.jboss.metadata.annotation.creator.ejb.jboss.AbstractEnterpriseBeanProcessor.process(AbstractEnterpriseBeanProcessor.java:90)
at org.jboss.metadata.annotation.creator.ejb.jboss.AbstractEnterpriseBeanProcessor.process(AbstractEnterpriseBeanProcessor.java:52)
at org.jboss.metadata.annotation.creator.AbstractCreator.process(AbstractCreator.java:154)
at org.jboss.metadata.annotation.creator.AbstractCreator.processMetaData(AbstractCreator.java:87)
at org.jboss.metadata.annotation.creator.ejb.jboss.JBoss50Creator.create(JBoss50Creator.java:109)
at org.jboss.deployment.OptAnnotationMetaDataDeployer.processJBossMetaData(OptAnnotationMetaDataDeployer.java:134)
at org.jboss.deployment.OptAnnotationMetaDataDeployer.processMetaData(OptAnnotationMetaDataDeployer.java:84)
at org.jboss.deployment.AnnotationMetaDataDeployer.deploy(AnnotationMetaDataDeployer.java:177)
... 32 more
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/546338#546338]
Start a new discussion in EJB 3.0 at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
16 years