[JBoss JIRA] (WFLY-2510) Add CLI command to display information about current connection.
by Claudio Miranda (JIRA)
[ https://issues.jboss.org/browse/WFLY-2510?page=com.atlassian.jira.plugin.... ]
Claudio Miranda commented on WFLY-2510:
---------------------------------------
The implementation is done, see the result
1) local connection as SuperUser and SSL
[standalone@localhost:9993 /] connection-info
Username - Local connection authenticated as SuperUser
Logged since - Sun Aug 10 00:09:33 BRT 2014
Subject - CN=mgmt-connector,OU=jboss,O=jboss,L=Brasilia,ST=DF,C=BR
Issuer - CN=mgmt-connector, OU=jboss, O=jboss, L=Brasilia, ST=DF, C=BR
Valid From - Fri Aug 08 01:13:16 BRT 2014
Valid To - Thu Nov 06 02:13:16 BRST 2014
SHA1 - fa:25:f4:cf:57:89:ce:ff:97:82:9d:b4:c8:b1:67:ef:b3:08:a8:b4
MD5 - e6:67:14:c7:86:84:d3:22:14:21:e7:43:09:05:a4:7f
2) Authenticated user and SSL
[standalone@localhost:9993 /] connection-info
Username - admin
Logged since - Sun Aug 10 00:11:52 BRT 2014
Subject - CN=mgmt-connector,OU=jboss,O=jboss,L=Brasilia,ST=DF,C=BR
Issuer - CN=mgmt-connector, OU=jboss, O=jboss, L=Brasilia, ST=DF, C=BR
Valid From - Fri Aug 08 01:13:16 BRT 2014
Valid To - Thu Nov 06 02:13:16 BRST 2014
SHA1 - fa:25:f4:cf:57:89:ce:ff:97:82:9d:b4:c8:b1:67:ef:b3:08:a8:b4
MD5 - e6:67:14:c7:86:84:d3:22:14:21:e7:43:09:05:a4:7f
3) Authenticated user and not ssl
[standalone@localhost:9990 /] connection-info
Username - admin
Logged since - Sun Aug 10 00:12:39 BRT 2014
Not an SSL connection.
4) local connection as SuperUser and not ssl
[standalone@localhost:9990 /] connection-info
Username - admin
Logged since - Sun Aug 10 00:14:19 BRT 2014
Not an SSL connection.
Doest it need to print if it is in domain or standalone mode ?
> Add CLI command to display information about current connection.
> ----------------------------------------------------------------
>
> Key: WFLY-2510
> URL: https://issues.jboss.org/browse/WFLY-2510
> Project: WildFly
> Issue Type: Enhancement
> Security Level: Public(Everyone can see)
> Components: CLI
> Reporter: Darran Lofthouse
> Assignee: Darran Lofthouse
> Labels: management_security,
> Fix For: Awaiting Volunteers
>
>
> Would be useful for a single command to display information about the current connection.
> Definitely information about SSL, certificates, authenticated user, address etc...
> Could also obtain other common info from server.
--
This message was sent by Atlassian JIRA
(v6.2.6#6264)
11 years, 9 months
[JBoss JIRA] (ELY-41) Password Recognition and Parsing Framework
by Darran Lofthouse (JIRA)
Darran Lofthouse created ELY-41:
-----------------------------------
Summary: Password Recognition and Parsing Framework
Key: ELY-41
URL: https://issues.jboss.org/browse/ELY-41
Project: WildFly Elytron
Issue Type: Task
Security Level: Public (Everyone can see)
Components: API / SPI
Reporter: Darran Lofthouse
Fix For: 1.0.0.Beta1
I don't think having a single PasswordUtils that recognises and parses all password types is going to be a good idea long term - I think a lot of the responsibility for what is supported needs to come from the realm.
A scenario I am thinking is an LDAP server is configured to support clear text passwords, that server verifies the strength of the password before letting a user set it - this could be circumvented by setting the password value to something we would parse as one of the other password types. The problem is the user could just hash 'password' - this would pass the LDAP servers dictionary attack check.
The second issue is that different formats could be realm specific, e.g. LDAP supports trival digests in formats slightly different to those we already support.
One idea I am starting to think about it a password parser that a realm can build up with a set of supported password types, working on LDAP it is apparent realms potentially need configuration for the credential types they will claim to support before the RealmIdentity is identified so not a major deviation from the work I am already finding necessary.
--
This message was sent by Atlassian JIRA
(v6.2.6#6264)
11 years, 9 months
[JBoss JIRA] (ELY-40) Split the Base64 util methods out of PasswordUtils
by Darran Lofthouse (JIRA)
Darran Lofthouse created ELY-40:
-----------------------------------
Summary: Split the Base64 util methods out of PasswordUtils
Key: ELY-40
URL: https://issues.jboss.org/browse/ELY-40
Project: WildFly Elytron
Issue Type: Task
Security Level: Public (Everyone can see)
Components: Utils
Reporter: Darran Lofthouse
Assignee: Darran Lofthouse
Fix For: 1.0.0.Beta1
The PasswordUtils class is risking becoming one big general purpose util for password parsing - this in itself has risks as password types can be represented in a number of different ways - some of this should even be down to the realm accessing the backing store to identify the approaches actually supported.
However initially Base64 is something that is general and should be split out for general re-use.
--
This message was sent by Atlassian JIRA
(v6.2.6#6264)
11 years, 9 months
[JBoss JIRA] (DROOLS-573) Kie Server: bugs and enhancements
by Petr Široký (JIRA)
[ https://issues.jboss.org/browse/DROOLS-573?page=com.atlassian.jira.plugin... ]
Petr Široký updated DROOLS-573:
-------------------------------
Description:
As discussed with Edson, I am creating list of possible bugs and enhancements for the KIE Server.
Bugs:
* Server returns NPE when the request body is empty (and is required). This happens for example when creating new container using /container/{id}, but not providing any data within the body (the XML/JSON specifying release-id, etc).
Enhancements:
* I think it it would useful to move the KieServer interface into -api module so that user's can use e.g. RestEasy ClientProxy to create own REST client in case the don't want to use the provided client.
The description will be updated if I found more such bugs/enhancements.
was:
As discussed with Edson, I am creating list of possible bugs and enhancements for the KIE Server.
Bugs:
* Server returns NPE when the request body is empty (and is required). This happens for example when creating new container using /container/{id}, but not providing any within the body (the XML/JSON data specifying release-id).
Enhancements:
* I think it it would useful to move the KieServer interface into -api module so that user's can use e.g. RestEasy ClientProxy to create own REST client in case the don't want to use the provided client.
The description will be updated if I found more such bugs/enhancements.
> Kie Server: bugs and enhancements
> ---------------------------------
>
> Key: DROOLS-573
> URL: https://issues.jboss.org/browse/DROOLS-573
> Project: Drools
> Issue Type: Enhancement
> Security Level: Public(Everyone can see)
> Affects Versions: 6.2.0.Beta1
> Reporter: Petr Široký
> Assignee: Edson Tirelli
>
> As discussed with Edson, I am creating list of possible bugs and enhancements for the KIE Server.
> Bugs:
> * Server returns NPE when the request body is empty (and is required). This happens for example when creating new container using /container/{id}, but not providing any data within the body (the XML/JSON specifying release-id, etc).
> Enhancements:
> * I think it it would useful to move the KieServer interface into -api module so that user's can use e.g. RestEasy ClientProxy to create own REST client in case the don't want to use the provided client.
> The description will be updated if I found more such bugs/enhancements.
--
This message was sent by Atlassian JIRA
(v6.2.6#6264)
11 years, 9 months
[JBoss JIRA] (DROOLS-573) Kie Server: bugs and enhancements
by Petr Široký (JIRA)
Petr Široký created DROOLS-573:
----------------------------------
Summary: Kie Server: bugs and enhancements
Key: DROOLS-573
URL: https://issues.jboss.org/browse/DROOLS-573
Project: Drools
Issue Type: Enhancement
Security Level: Public (Everyone can see)
Affects Versions: 6.2.0.Beta1
Reporter: Petr Široký
Assignee: Edson Tirelli
As discussed with Edson, I am creating list of possible bugs and enhancements for the KIE Server.
Bugs:
* Server returns NPE when the request body is empty (and is required). This happens for example when creating new container using /container/{id}, but not providing any within the body (the XML/JSON data specifying release-id).
Enhancements:
* I think it it would useful to move the KieServer interface into -api module so that user's can use e.g. RestEasy ClientProxy to create own REST client in case the don't want to use the provided client.
The description will be updated if I found more such bugs/enhancements.
--
This message was sent by Atlassian JIRA
(v6.2.6#6264)
11 years, 9 months
[JBoss JIRA] (WFCORE-48) EOFException when address of a mgmt operation is of a bad data type
by Ladislav Thon (JIRA)
[ https://issues.jboss.org/browse/WFCORE-48?page=com.atlassian.jira.plugin.... ]
Ladislav Thon commented on WFCORE-48:
-------------------------------------
Changed the issue summary. I thought that the problem is that the address is empty, but in fact, the problem is that the address is of a bad data type (the correct one is list). Using an empty string, non-empty string, an integer, all lead to the same {{EOFException}}.
> EOFException when address of a mgmt operation is of a bad data type
> -------------------------------------------------------------------
>
> Key: WFCORE-48
> URL: https://issues.jboss.org/browse/WFCORE-48
> Project: WildFly Core
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Domain Management
> Reporter: Ladislav Thon
> Assignee: Brian Stansberry
>
> (Hopefully this belongs to WildFly Core. If not, please move to WildFly.)
> I'm doing a programmatic invocation of a simple mgmt operation on the root mgmt resource, say e.g. {{:whoami}}. I'm doing this against a freshly built WildFly from master branch (commit {{e2b9ecfb}}) and on the client side, I'm depending on {{org.wildfly.core:wildfly-controller-client:1.0.0.Alpha4}}.
> The code looks like this:
> {code:java}
> ModelControllerClient client = ModelControllerClient.Factory.create("localhost", 9990);
> try {
> ModelNode op = new ModelNode();
> op.get(ClientConstants.OP).set("whoami");
> op.get(ClientConstants.OP_ADDR).set("");
> ModelNode result = client.execute(op);
> System.out.println(result);
> } finally {
> client.close();
> }
> {code}
> This fails with an exception like this:
> {code}
> Exception in thread "main" java.io.IOException: java.util.concurrent.ExecutionException: Operation failed
> at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeForResult(AbstractModelControllerClient.java:129)
> at org.jboss.as.controller.client.impl.AbstractModelControllerClient.execute(AbstractModelControllerClient.java:71)
> at cz.ladicek.wildfly.ErrorReproducer.main(ErrorReproducer.java:17)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:606)
> at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
> Caused by: java.util.concurrent.ExecutionException: Operation failed
> at org.jboss.threads.AsyncFutureTask.operationFailed(AsyncFutureTask.java:74)
> at org.jboss.threads.AsyncFutureTask.get(AsyncFutureTask.java:268)
> at org.jboss.as.controller.client.impl.AbstractDelegatingAsyncFuture.get(AbstractDelegatingAsyncFuture.java:100)
> at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeForResult(AbstractModelControllerClient.java:127)
> ... 7 more
> Caused by: java.io.EOFException
> at java.io.DataInputStream.readByte(DataInputStream.java:267)
> at org.jboss.as.protocol.mgmt.ProtocolUtils.expectHeader(ProtocolUtils.java:83)
> at org.jboss.as.controller.client.impl.AbstractModelControllerClient$1.handleRequest(AbstractModelControllerClient.java:167)
> at org.jboss.as.protocol.mgmt.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:270)
> at org.jboss.as.protocol.mgmt.AbstractMessageHandler.handleRequest(AbstractMessageHandler.java:235)
> at org.jboss.as.protocol.mgmt.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:113)
> at org.jboss.as.protocol.mgmt.ManagementChannelReceiver$1.handleMessage(ManagementChannelReceiver.java:56)
> at org.jboss.as.protocol.mgmt.ManagementChannelReceiver.handleMessage(ManagementChannelReceiver.java:84)
> at org.jboss.remoting3.remote.RemoteConnectionChannel$5.run(RemoteConnectionChannel.java:452)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> at java.lang.Thread.run(Thread.java:745)
> {code}
> However, when I remove the line that sets {{address}} ({{op.get(ClientConstants.OP_ADDR).set("");}}), it works just fine.
> Fine, I made a mistake, but getting an {{EOFException}}? That's hardly an appropriate response. I should get a proper failure ({{"outcome" => "failed"}} etc.).
--
This message was sent by Atlassian JIRA
(v6.2.6#6264)
11 years, 9 months
[JBoss JIRA] (WFCORE-48) EOFException when address of a mgmt operation is of a bad data type
by Ladislav Thon (JIRA)
[ https://issues.jboss.org/browse/WFCORE-48?page=com.atlassian.jira.plugin.... ]
Ladislav Thon updated WFCORE-48:
--------------------------------
Summary: EOFException when address of a mgmt operation is of a bad data type (was: EOFException when adding empty address to a mgmt operation)
> EOFException when address of a mgmt operation is of a bad data type
> -------------------------------------------------------------------
>
> Key: WFCORE-48
> URL: https://issues.jboss.org/browse/WFCORE-48
> Project: WildFly Core
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Domain Management
> Reporter: Ladislav Thon
> Assignee: Brian Stansberry
>
> (Hopefully this belongs to WildFly Core. If not, please move to WildFly.)
> I'm doing a programmatic invocation of a simple mgmt operation on the root mgmt resource, say e.g. {{:whoami}}. I'm doing this against a freshly built WildFly from master branch (commit {{e2b9ecfb}}) and on the client side, I'm depending on {{org.wildfly.core:wildfly-controller-client:1.0.0.Alpha4}}.
> The code looks like this:
> {code:java}
> ModelControllerClient client = ModelControllerClient.Factory.create("localhost", 9990);
> try {
> ModelNode op = new ModelNode();
> op.get(ClientConstants.OP).set("whoami");
> op.get(ClientConstants.OP_ADDR).set("");
> ModelNode result = client.execute(op);
> System.out.println(result);
> } finally {
> client.close();
> }
> {code}
> This fails with an exception like this:
> {code}
> Exception in thread "main" java.io.IOException: java.util.concurrent.ExecutionException: Operation failed
> at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeForResult(AbstractModelControllerClient.java:129)
> at org.jboss.as.controller.client.impl.AbstractModelControllerClient.execute(AbstractModelControllerClient.java:71)
> at cz.ladicek.wildfly.ErrorReproducer.main(ErrorReproducer.java:17)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:606)
> at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
> Caused by: java.util.concurrent.ExecutionException: Operation failed
> at org.jboss.threads.AsyncFutureTask.operationFailed(AsyncFutureTask.java:74)
> at org.jboss.threads.AsyncFutureTask.get(AsyncFutureTask.java:268)
> at org.jboss.as.controller.client.impl.AbstractDelegatingAsyncFuture.get(AbstractDelegatingAsyncFuture.java:100)
> at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeForResult(AbstractModelControllerClient.java:127)
> ... 7 more
> Caused by: java.io.EOFException
> at java.io.DataInputStream.readByte(DataInputStream.java:267)
> at org.jboss.as.protocol.mgmt.ProtocolUtils.expectHeader(ProtocolUtils.java:83)
> at org.jboss.as.controller.client.impl.AbstractModelControllerClient$1.handleRequest(AbstractModelControllerClient.java:167)
> at org.jboss.as.protocol.mgmt.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:270)
> at org.jboss.as.protocol.mgmt.AbstractMessageHandler.handleRequest(AbstractMessageHandler.java:235)
> at org.jboss.as.protocol.mgmt.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:113)
> at org.jboss.as.protocol.mgmt.ManagementChannelReceiver$1.handleMessage(ManagementChannelReceiver.java:56)
> at org.jboss.as.protocol.mgmt.ManagementChannelReceiver.handleMessage(ManagementChannelReceiver.java:84)
> at org.jboss.remoting3.remote.RemoteConnectionChannel$5.run(RemoteConnectionChannel.java:452)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> at java.lang.Thread.run(Thread.java:745)
> {code}
> However, when I remove the line that sets {{address}} ({{op.get(ClientConstants.OP_ADDR).set("");}}), it works just fine.
> Fine, I made a mistake, but getting an {{EOFException}}? That's hardly an appropriate response. I should get a proper failure ({{"outcome" => "failed"}} etc.).
--
This message was sent by Atlassian JIRA
(v6.2.6#6264)
11 years, 9 months
[JBoss JIRA] (JASSIST-232) BadBytecode when trying access localVariable using insertAfter and asFinally = true
by Marvin Herman Froeder (JIRA)
[ https://issues.jboss.org/browse/JASSIST-232?page=com.atlassian.jira.plugi... ]
Marvin Herman Froeder updated JASSIST-232:
------------------------------------------
Description:
What I was trying to do:
I wanna init a variable calling a method and then I wanna run a cleanup on
finally.
{code:java}
private void originalMethod() {
String aVar = null; // ctMethod.addLocalVariable()
try{
aVar = initVar(); // routine to create something ctMethod.insertBefore()
runOriginalCode();
}finally {
dismiss(aVar); //cleanup routine ctMethod.insertAfter(,true)
}
}
{code}
I tried that by doing:
{code:java}
ctMethod.addLocalVariable("aVar", StringCtClass));
ctMethod.insertBefore("aVar = initVar();");
ctMethod.insertAfter(" dismiss( aVar );" , true);
{code}
But I got:
{quote}
javassist.CannotCompileException: by javassist.bytecode.BadBytecode: success ()Ljava/lang/Boolean; in com.contaazul.Sample: conflict: *top* and java.lang.String
at javassist.CtBehavior.insertAfter(CtBehavior.java:880)
at com.marvinformatics.dbadvisor.agent.DbAdvisorClassFileTransformer.trackThread(DbAdvisorClassFileTransformer.java:127)
at com.marvinformatics.dbadvisor.agent.DbAdvisorClassFileTransformer.trackThread(DbAdvisorClassFileTransformer.java:120)
at com.marvinformatics.dbadvisor.agent.DbAdvisorClassFileTransformer.instrumentContaAzul(DbAdvisorClassFileTransformer.java:66)
at com.marvinformatics.dbadvisor.agent.DbAdvisorClassFileTransformer.transform(DbAdvisorClassFileTransformer.java:38)
at com.marvinformatics.dbadvisor.agent.DbAdvisorClassFileTransformerTest$1.loadClass(DbAdvisorClassFileTransformerTest.java:39)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at com.marvinformatics.dbadvisor.agent.DbAdvisorClassFileTransformerTest.contaazulish(DbAdvisorClassFileTransformerTest.java:93)
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:597)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
at org.testng.SuiteRunner.run(SuiteRunner.java:240)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
at org.testng.TestNG.run(TestNG.java:1057)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)
Caused by: javassist.bytecode.BadBytecode: success ()Ljava/lang/Boolean; in com.contaazul.Sample: conflict: *top* and java.lang.String
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:111)
at javassist.bytecode.MethodInfo.rebuildStackMap(MethodInfo.java:423)
at javassist.bytecode.MethodInfo.rebuildStackMapIf6(MethodInfo.java:405)
at javassist.CtBehavior.insertAfter(CtBehavior.java:871)
... 31 more
Caused by: javassist.bytecode.BadBytecode: conflict: *top* and java.lang.String
at javassist.bytecode.stackmap.TypeData$BasicType.setType(TypeData.java:134)
at javassist.bytecode.stackmap.Tracer.checkParamTypes(Tracer.java:930)
at javassist.bytecode.stackmap.Tracer.doInvokeMethod(Tracer.java:801)
at javassist.bytecode.stackmap.Tracer.doOpcode148_201(Tracer.java:597)
at javassist.bytecode.stackmap.Tracer.doOpcode(Tracer.java:81)
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:187)
at javassist.bytecode.stackmap.MapMaker.traceException(MapMaker.java:221)
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:182)
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:164)
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:108)
... 34 more
{quote}
and I also tried the other way around (insertAfter first and insertBefore later):
{code:java}
ctMethod.addLocalVariable("aVar", StringCtClass));
ctMethod.insertAfter(" dismiss( aVar );" , true);
ctMethod.insertBefore("aVar = initVar();");
{code}
still, same error
{quote}
javassist.CannotCompileException: by javassist.bytecode.BadBytecode: success ()Ljava/lang/Boolean; in com.contaazul.Sample: conflict: *top* and java.lang.String
at javassist.CtBehavior.insertAfter(CtBehavior.java:880)
at com.marvinformatics.dbadvisor.agent.DbAdvisorClassFileTransformer.trackThread(DbAdvisorClassFileTransformer.java:126)
at com.marvinformatics.dbadvisor.agent.DbAdvisorClassFileTransformer.trackThread(DbAdvisorClassFileTransformer.java:120)
at com.marvinformatics.dbadvisor.agent.DbAdvisorClassFileTransformer.instrumentContaAzul(DbAdvisorClassFileTransformer.java:66)
at com.marvinformatics.dbadvisor.agent.DbAdvisorClassFileTransformer.transform(DbAdvisorClassFileTransformer.java:38)
at com.marvinformatics.dbadvisor.agent.DbAdvisorClassFileTransformerTest$1.loadClass(DbAdvisorClassFileTransformerTest.java:39)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at com.marvinformatics.dbadvisor.agent.DbAdvisorClassFileTransformerTest.contaazulish(DbAdvisorClassFileTransformerTest.java:93)
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:597)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
at org.testng.SuiteRunner.run(SuiteRunner.java:240)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
at org.testng.TestNG.run(TestNG.java:1057)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)
Caused by: javassist.bytecode.BadBytecode: success ()Ljava/lang/Boolean; in com.contaazul.Sample: conflict: *top* and java.lang.String
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:111)
at javassist.bytecode.MethodInfo.rebuildStackMap(MethodInfo.java:423)
at javassist.bytecode.MethodInfo.rebuildStackMapIf6(MethodInfo.java:405)
at javassist.CtBehavior.insertAfter(CtBehavior.java:871)
... 31 more
Caused by: javassist.bytecode.BadBytecode: conflict: *top* and java.lang.String
at javassist.bytecode.stackmap.TypeData$BasicType.setType(TypeData.java:134)
at javassist.bytecode.stackmap.Tracer.checkParamTypes(Tracer.java:930)
at javassist.bytecode.stackmap.Tracer.doInvokeMethod(Tracer.java:801)
at javassist.bytecode.stackmap.Tracer.doOpcode148_201(Tracer.java:597)
at javassist.bytecode.stackmap.Tracer.doOpcode(Tracer.java:81)
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:187)
at javassist.bytecode.stackmap.MapMaker.traceException(MapMaker.java:221)
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:182)
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:164)
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:108)
... 34 more
{quote}
was:
What I was trying to do:
I wanna init a variable calling a method and then I wanna run a cleanup on
finally.
{code:java}
private void originalMethod() {
String aVar = null;
try{
aVar = initVar(); // routine to create something added instrumenting
runOriginalCode();
}finally {
dismiss(aVar); //cleanup routine added instrumenting
}
}
{code}
I tried that by doing:
{code:java}
ctMethod.addLocalVariable("aVar", StringCtClass));
ctMethod.insertBefore("aVar = initVar();");
ctMethod.insertAfter(" dismiss( aVar );" , true);
{code}
But I got:
{quote}
javassist.CannotCompileException: by javassist.bytecode.BadBytecode: success ()Ljava/lang/Boolean; in com.contaazul.Sample: conflict: *top* and java.lang.String
at javassist.CtBehavior.insertAfter(CtBehavior.java:880)
at com.marvinformatics.dbadvisor.agent.DbAdvisorClassFileTransformer.trackThread(DbAdvisorClassFileTransformer.java:127)
at com.marvinformatics.dbadvisor.agent.DbAdvisorClassFileTransformer.trackThread(DbAdvisorClassFileTransformer.java:120)
at com.marvinformatics.dbadvisor.agent.DbAdvisorClassFileTransformer.instrumentContaAzul(DbAdvisorClassFileTransformer.java:66)
at com.marvinformatics.dbadvisor.agent.DbAdvisorClassFileTransformer.transform(DbAdvisorClassFileTransformer.java:38)
at com.marvinformatics.dbadvisor.agent.DbAdvisorClassFileTransformerTest$1.loadClass(DbAdvisorClassFileTransformerTest.java:39)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at com.marvinformatics.dbadvisor.agent.DbAdvisorClassFileTransformerTest.contaazulish(DbAdvisorClassFileTransformerTest.java:93)
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:597)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
at org.testng.SuiteRunner.run(SuiteRunner.java:240)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
at org.testng.TestNG.run(TestNG.java:1057)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)
Caused by: javassist.bytecode.BadBytecode: success ()Ljava/lang/Boolean; in com.contaazul.Sample: conflict: *top* and java.lang.String
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:111)
at javassist.bytecode.MethodInfo.rebuildStackMap(MethodInfo.java:423)
at javassist.bytecode.MethodInfo.rebuildStackMapIf6(MethodInfo.java:405)
at javassist.CtBehavior.insertAfter(CtBehavior.java:871)
... 31 more
Caused by: javassist.bytecode.BadBytecode: conflict: *top* and java.lang.String
at javassist.bytecode.stackmap.TypeData$BasicType.setType(TypeData.java:134)
at javassist.bytecode.stackmap.Tracer.checkParamTypes(Tracer.java:930)
at javassist.bytecode.stackmap.Tracer.doInvokeMethod(Tracer.java:801)
at javassist.bytecode.stackmap.Tracer.doOpcode148_201(Tracer.java:597)
at javassist.bytecode.stackmap.Tracer.doOpcode(Tracer.java:81)
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:187)
at javassist.bytecode.stackmap.MapMaker.traceException(MapMaker.java:221)
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:182)
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:164)
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:108)
... 34 more
{quote}
and I also tried the other way around (insertAfter first and insertBefore later):
{code:java}
ctMethod.addLocalVariable("aVar", StringCtClass));
ctMethod.insertAfter(" dismiss( aVar );" , true);
ctMethod.insertBefore("aVar = initVar();");
{code}
still, same error
{quote}
javassist.CannotCompileException: by javassist.bytecode.BadBytecode: success ()Ljava/lang/Boolean; in com.contaazul.Sample: conflict: *top* and java.lang.String
at javassist.CtBehavior.insertAfter(CtBehavior.java:880)
at com.marvinformatics.dbadvisor.agent.DbAdvisorClassFileTransformer.trackThread(DbAdvisorClassFileTransformer.java:126)
at com.marvinformatics.dbadvisor.agent.DbAdvisorClassFileTransformer.trackThread(DbAdvisorClassFileTransformer.java:120)
at com.marvinformatics.dbadvisor.agent.DbAdvisorClassFileTransformer.instrumentContaAzul(DbAdvisorClassFileTransformer.java:66)
at com.marvinformatics.dbadvisor.agent.DbAdvisorClassFileTransformer.transform(DbAdvisorClassFileTransformer.java:38)
at com.marvinformatics.dbadvisor.agent.DbAdvisorClassFileTransformerTest$1.loadClass(DbAdvisorClassFileTransformerTest.java:39)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at com.marvinformatics.dbadvisor.agent.DbAdvisorClassFileTransformerTest.contaazulish(DbAdvisorClassFileTransformerTest.java:93)
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:597)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
at org.testng.SuiteRunner.run(SuiteRunner.java:240)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
at org.testng.TestNG.run(TestNG.java:1057)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)
Caused by: javassist.bytecode.BadBytecode: success ()Ljava/lang/Boolean; in com.contaazul.Sample: conflict: *top* and java.lang.String
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:111)
at javassist.bytecode.MethodInfo.rebuildStackMap(MethodInfo.java:423)
at javassist.bytecode.MethodInfo.rebuildStackMapIf6(MethodInfo.java:405)
at javassist.CtBehavior.insertAfter(CtBehavior.java:871)
... 31 more
Caused by: javassist.bytecode.BadBytecode: conflict: *top* and java.lang.String
at javassist.bytecode.stackmap.TypeData$BasicType.setType(TypeData.java:134)
at javassist.bytecode.stackmap.Tracer.checkParamTypes(Tracer.java:930)
at javassist.bytecode.stackmap.Tracer.doInvokeMethod(Tracer.java:801)
at javassist.bytecode.stackmap.Tracer.doOpcode148_201(Tracer.java:597)
at javassist.bytecode.stackmap.Tracer.doOpcode(Tracer.java:81)
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:187)
at javassist.bytecode.stackmap.MapMaker.traceException(MapMaker.java:221)
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:182)
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:164)
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:108)
... 34 more
{quote}
> BadBytecode when trying access localVariable using insertAfter and asFinally = true
> -----------------------------------------------------------------------------------
>
> Key: JASSIST-232
> URL: https://issues.jboss.org/browse/JASSIST-232
> Project: Javassist
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Affects Versions: 3.18.2-GA
> Reporter: Marvin Herman Froeder
> Assignee: Shigeru Chiba
>
> What I was trying to do:
> I wanna init a variable calling a method and then I wanna run a cleanup on
> finally.
> {code:java}
> private void originalMethod() {
> String aVar = null; // ctMethod.addLocalVariable()
> try{
> aVar = initVar(); // routine to create something ctMethod.insertBefore()
> runOriginalCode();
> }finally {
> dismiss(aVar); //cleanup routine ctMethod.insertAfter(,true)
> }
> }
> {code}
> I tried that by doing:
> {code:java}
> ctMethod.addLocalVariable("aVar", StringCtClass));
> ctMethod.insertBefore("aVar = initVar();");
> ctMethod.insertAfter(" dismiss( aVar );" , true);
> {code}
> But I got:
> {quote}
> javassist.CannotCompileException: by javassist.bytecode.BadBytecode: success ()Ljava/lang/Boolean; in com.contaazul.Sample: conflict: *top* and java.lang.String
> at javassist.CtBehavior.insertAfter(CtBehavior.java:880)
> at com.marvinformatics.dbadvisor.agent.DbAdvisorClassFileTransformer.trackThread(DbAdvisorClassFileTransformer.java:127)
> at com.marvinformatics.dbadvisor.agent.DbAdvisorClassFileTransformer.trackThread(DbAdvisorClassFileTransformer.java:120)
> at com.marvinformatics.dbadvisor.agent.DbAdvisorClassFileTransformer.instrumentContaAzul(DbAdvisorClassFileTransformer.java:66)
> at com.marvinformatics.dbadvisor.agent.DbAdvisorClassFileTransformer.transform(DbAdvisorClassFileTransformer.java:38)
> at com.marvinformatics.dbadvisor.agent.DbAdvisorClassFileTransformerTest$1.loadClass(DbAdvisorClassFileTransformerTest.java:39)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
> at com.marvinformatics.dbadvisor.agent.DbAdvisorClassFileTransformerTest.contaazulish(DbAdvisorClassFileTransformerTest.java:93)
> 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:597)
> at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
> at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
> at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
> at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
> at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
> at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
> at org.testng.TestRunner.privateRun(TestRunner.java:767)
> at org.testng.TestRunner.run(TestRunner.java:617)
> at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
> at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
> at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
> at org.testng.SuiteRunner.run(SuiteRunner.java:240)
> at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
> at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
> at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
> at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
> at org.testng.TestNG.run(TestNG.java:1057)
> at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
> at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
> at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)
> Caused by: javassist.bytecode.BadBytecode: success ()Ljava/lang/Boolean; in com.contaazul.Sample: conflict: *top* and java.lang.String
> at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:111)
> at javassist.bytecode.MethodInfo.rebuildStackMap(MethodInfo.java:423)
> at javassist.bytecode.MethodInfo.rebuildStackMapIf6(MethodInfo.java:405)
> at javassist.CtBehavior.insertAfter(CtBehavior.java:871)
> ... 31 more
> Caused by: javassist.bytecode.BadBytecode: conflict: *top* and java.lang.String
> at javassist.bytecode.stackmap.TypeData$BasicType.setType(TypeData.java:134)
> at javassist.bytecode.stackmap.Tracer.checkParamTypes(Tracer.java:930)
> at javassist.bytecode.stackmap.Tracer.doInvokeMethod(Tracer.java:801)
> at javassist.bytecode.stackmap.Tracer.doOpcode148_201(Tracer.java:597)
> at javassist.bytecode.stackmap.Tracer.doOpcode(Tracer.java:81)
> at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:187)
> at javassist.bytecode.stackmap.MapMaker.traceException(MapMaker.java:221)
> at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:182)
> at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:164)
> at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:108)
> ... 34 more
> {quote}
> and I also tried the other way around (insertAfter first and insertBefore later):
> {code:java}
> ctMethod.addLocalVariable("aVar", StringCtClass));
> ctMethod.insertAfter(" dismiss( aVar );" , true);
> ctMethod.insertBefore("aVar = initVar();");
> {code}
> still, same error
> {quote}
> javassist.CannotCompileException: by javassist.bytecode.BadBytecode: success ()Ljava/lang/Boolean; in com.contaazul.Sample: conflict: *top* and java.lang.String
> at javassist.CtBehavior.insertAfter(CtBehavior.java:880)
> at com.marvinformatics.dbadvisor.agent.DbAdvisorClassFileTransformer.trackThread(DbAdvisorClassFileTransformer.java:126)
> at com.marvinformatics.dbadvisor.agent.DbAdvisorClassFileTransformer.trackThread(DbAdvisorClassFileTransformer.java:120)
> at com.marvinformatics.dbadvisor.agent.DbAdvisorClassFileTransformer.instrumentContaAzul(DbAdvisorClassFileTransformer.java:66)
> at com.marvinformatics.dbadvisor.agent.DbAdvisorClassFileTransformer.transform(DbAdvisorClassFileTransformer.java:38)
> at com.marvinformatics.dbadvisor.agent.DbAdvisorClassFileTransformerTest$1.loadClass(DbAdvisorClassFileTransformerTest.java:39)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
> at com.marvinformatics.dbadvisor.agent.DbAdvisorClassFileTransformerTest.contaazulish(DbAdvisorClassFileTransformerTest.java:93)
> 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:597)
> at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
> at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
> at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
> at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
> at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
> at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
> at org.testng.TestRunner.privateRun(TestRunner.java:767)
> at org.testng.TestRunner.run(TestRunner.java:617)
> at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
> at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
> at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
> at org.testng.SuiteRunner.run(SuiteRunner.java:240)
> at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
> at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
> at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
> at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
> at org.testng.TestNG.run(TestNG.java:1057)
> at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
> at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
> at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)
> Caused by: javassist.bytecode.BadBytecode: success ()Ljava/lang/Boolean; in com.contaazul.Sample: conflict: *top* and java.lang.String
> at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:111)
> at javassist.bytecode.MethodInfo.rebuildStackMap(MethodInfo.java:423)
> at javassist.bytecode.MethodInfo.rebuildStackMapIf6(MethodInfo.java:405)
> at javassist.CtBehavior.insertAfter(CtBehavior.java:871)
> ... 31 more
> Caused by: javassist.bytecode.BadBytecode: conflict: *top* and java.lang.String
> at javassist.bytecode.stackmap.TypeData$BasicType.setType(TypeData.java:134)
> at javassist.bytecode.stackmap.Tracer.checkParamTypes(Tracer.java:930)
> at javassist.bytecode.stackmap.Tracer.doInvokeMethod(Tracer.java:801)
> at javassist.bytecode.stackmap.Tracer.doOpcode148_201(Tracer.java:597)
> at javassist.bytecode.stackmap.Tracer.doOpcode(Tracer.java:81)
> at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:187)
> at javassist.bytecode.stackmap.MapMaker.traceException(MapMaker.java:221)
> at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:182)
> at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:164)
> at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:108)
> ... 34 more
> {quote}
--
This message was sent by Atlassian JIRA
(v6.2.6#6264)
11 years, 9 months
[JBoss JIRA] (JASSIST-232) BadBytecode when trying access localVariable using insertAfter and asFinally = true
by Marvin Herman Froeder (JIRA)
Marvin Herman Froeder created JASSIST-232:
---------------------------------------------
Summary: BadBytecode when trying access localVariable using insertAfter and asFinally = true
Key: JASSIST-232
URL: https://issues.jboss.org/browse/JASSIST-232
Project: Javassist
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 3.18.2-GA
Reporter: Marvin Herman Froeder
Assignee: Shigeru Chiba
What I was trying to do:
I wanna init a variable calling a method and then I wanna run a cleanup on
finally.
{code:java}
private void originalMethod() {
String aVar = null;
try{
aVar = initVar(); // routine to create something added instrumenting
runOriginalCode();
}finally {
dismiss(aVar); //cleanup routine added instrumenting
}
}
{code}
I tried that by doing:
{code:java}
ctMethod.addLocalVariable("aVar", StringCtClass));
ctMethod.insertBefore("aVar = initVar();");
ctMethod.insertAfter(" dismiss( aVar );" , true);
{code}
But I got:
{quote}
javassist.CannotCompileException: by javassist.bytecode.BadBytecode: success ()Ljava/lang/Boolean; in com.contaazul.Sample: conflict: *top* and java.lang.String
at javassist.CtBehavior.insertAfter(CtBehavior.java:880)
at com.marvinformatics.dbadvisor.agent.DbAdvisorClassFileTransformer.trackThread(DbAdvisorClassFileTransformer.java:127)
at com.marvinformatics.dbadvisor.agent.DbAdvisorClassFileTransformer.trackThread(DbAdvisorClassFileTransformer.java:120)
at com.marvinformatics.dbadvisor.agent.DbAdvisorClassFileTransformer.instrumentContaAzul(DbAdvisorClassFileTransformer.java:66)
at com.marvinformatics.dbadvisor.agent.DbAdvisorClassFileTransformer.transform(DbAdvisorClassFileTransformer.java:38)
at com.marvinformatics.dbadvisor.agent.DbAdvisorClassFileTransformerTest$1.loadClass(DbAdvisorClassFileTransformerTest.java:39)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at com.marvinformatics.dbadvisor.agent.DbAdvisorClassFileTransformerTest.contaazulish(DbAdvisorClassFileTransformerTest.java:93)
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:597)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
at org.testng.SuiteRunner.run(SuiteRunner.java:240)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
at org.testng.TestNG.run(TestNG.java:1057)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)
Caused by: javassist.bytecode.BadBytecode: success ()Ljava/lang/Boolean; in com.contaazul.Sample: conflict: *top* and java.lang.String
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:111)
at javassist.bytecode.MethodInfo.rebuildStackMap(MethodInfo.java:423)
at javassist.bytecode.MethodInfo.rebuildStackMapIf6(MethodInfo.java:405)
at javassist.CtBehavior.insertAfter(CtBehavior.java:871)
... 31 more
Caused by: javassist.bytecode.BadBytecode: conflict: *top* and java.lang.String
at javassist.bytecode.stackmap.TypeData$BasicType.setType(TypeData.java:134)
at javassist.bytecode.stackmap.Tracer.checkParamTypes(Tracer.java:930)
at javassist.bytecode.stackmap.Tracer.doInvokeMethod(Tracer.java:801)
at javassist.bytecode.stackmap.Tracer.doOpcode148_201(Tracer.java:597)
at javassist.bytecode.stackmap.Tracer.doOpcode(Tracer.java:81)
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:187)
at javassist.bytecode.stackmap.MapMaker.traceException(MapMaker.java:221)
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:182)
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:164)
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:108)
... 34 more
{quote}
and I also tried the other way around (insertAfter first and insertBefore later):
{code:java}
ctMethod.addLocalVariable("aVar", StringCtClass));
ctMethod.insertAfter(" dismiss( aVar );" , true);
ctMethod.insertBefore("aVar = initVar();");
{code}
still, same error
{quote}
javassist.CannotCompileException: by javassist.bytecode.BadBytecode: success ()Ljava/lang/Boolean; in com.contaazul.Sample: conflict: *top* and java.lang.String
at javassist.CtBehavior.insertAfter(CtBehavior.java:880)
at com.marvinformatics.dbadvisor.agent.DbAdvisorClassFileTransformer.trackThread(DbAdvisorClassFileTransformer.java:126)
at com.marvinformatics.dbadvisor.agent.DbAdvisorClassFileTransformer.trackThread(DbAdvisorClassFileTransformer.java:120)
at com.marvinformatics.dbadvisor.agent.DbAdvisorClassFileTransformer.instrumentContaAzul(DbAdvisorClassFileTransformer.java:66)
at com.marvinformatics.dbadvisor.agent.DbAdvisorClassFileTransformer.transform(DbAdvisorClassFileTransformer.java:38)
at com.marvinformatics.dbadvisor.agent.DbAdvisorClassFileTransformerTest$1.loadClass(DbAdvisorClassFileTransformerTest.java:39)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at com.marvinformatics.dbadvisor.agent.DbAdvisorClassFileTransformerTest.contaazulish(DbAdvisorClassFileTransformerTest.java:93)
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:597)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
at org.testng.SuiteRunner.run(SuiteRunner.java:240)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
at org.testng.TestNG.run(TestNG.java:1057)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)
Caused by: javassist.bytecode.BadBytecode: success ()Ljava/lang/Boolean; in com.contaazul.Sample: conflict: *top* and java.lang.String
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:111)
at javassist.bytecode.MethodInfo.rebuildStackMap(MethodInfo.java:423)
at javassist.bytecode.MethodInfo.rebuildStackMapIf6(MethodInfo.java:405)
at javassist.CtBehavior.insertAfter(CtBehavior.java:871)
... 31 more
Caused by: javassist.bytecode.BadBytecode: conflict: *top* and java.lang.String
at javassist.bytecode.stackmap.TypeData$BasicType.setType(TypeData.java:134)
at javassist.bytecode.stackmap.Tracer.checkParamTypes(Tracer.java:930)
at javassist.bytecode.stackmap.Tracer.doInvokeMethod(Tracer.java:801)
at javassist.bytecode.stackmap.Tracer.doOpcode148_201(Tracer.java:597)
at javassist.bytecode.stackmap.Tracer.doOpcode(Tracer.java:81)
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:187)
at javassist.bytecode.stackmap.MapMaker.traceException(MapMaker.java:221)
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:182)
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:164)
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:108)
... 34 more
{quote}
--
This message was sent by Atlassian JIRA
(v6.2.6#6264)
11 years, 9 months
[JBoss JIRA] (WFCORE-48) EOFException when adding empty address to a mgmt operation
by Ladislav Thon (JIRA)
Ladislav Thon created WFCORE-48:
-----------------------------------
Summary: EOFException when adding empty address to a mgmt operation
Key: WFCORE-48
URL: https://issues.jboss.org/browse/WFCORE-48
Project: WildFly Core
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Domain Management
Reporter: Ladislav Thon
Assignee: Brian Stansberry
(Hopefully this belongs to WildFly Core. If not, please move to WildFly.)
I'm doing a programmatic invocation of a simple mgmt operation on the root mgmt resource, say e.g. {{:whoami}}. I'm doing this against a freshly built WildFly from master branch (commit {{e2b9ecfb}}) and on the client side, I'm depending on {{org.wildfly.core:wildfly-controller-client:1.0.0.Alpha4}}.
The code looks like this:
{code:java}
ModelControllerClient client = ModelControllerClient.Factory.create("localhost", 9990);
try {
ModelNode op = new ModelNode();
op.get(ClientConstants.OP).set("whoami");
op.get(ClientConstants.OP_ADDR).set("");
ModelNode result = client.execute(op);
System.out.println(result);
} finally {
client.close();
}
{code}
This fails with an exception like this:
{code}
Exception in thread "main" java.io.IOException: java.util.concurrent.ExecutionException: Operation failed
at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeForResult(AbstractModelControllerClient.java:129)
at org.jboss.as.controller.client.impl.AbstractModelControllerClient.execute(AbstractModelControllerClient.java:71)
at cz.ladicek.wildfly.ErrorReproducer.main(ErrorReproducer.java:17)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
Caused by: java.util.concurrent.ExecutionException: Operation failed
at org.jboss.threads.AsyncFutureTask.operationFailed(AsyncFutureTask.java:74)
at org.jboss.threads.AsyncFutureTask.get(AsyncFutureTask.java:268)
at org.jboss.as.controller.client.impl.AbstractDelegatingAsyncFuture.get(AbstractDelegatingAsyncFuture.java:100)
at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeForResult(AbstractModelControllerClient.java:127)
... 7 more
Caused by: java.io.EOFException
at java.io.DataInputStream.readByte(DataInputStream.java:267)
at org.jboss.as.protocol.mgmt.ProtocolUtils.expectHeader(ProtocolUtils.java:83)
at org.jboss.as.controller.client.impl.AbstractModelControllerClient$1.handleRequest(AbstractModelControllerClient.java:167)
at org.jboss.as.protocol.mgmt.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:270)
at org.jboss.as.protocol.mgmt.AbstractMessageHandler.handleRequest(AbstractMessageHandler.java:235)
at org.jboss.as.protocol.mgmt.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:113)
at org.jboss.as.protocol.mgmt.ManagementChannelReceiver$1.handleMessage(ManagementChannelReceiver.java:56)
at org.jboss.as.protocol.mgmt.ManagementChannelReceiver.handleMessage(ManagementChannelReceiver.java:84)
at org.jboss.remoting3.remote.RemoteConnectionChannel$5.run(RemoteConnectionChannel.java:452)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
{code}
However, when I remove the line that sets {{address}} ({{op.get(ClientConstants.OP_ADDR).set("");}}), it works just fine.
Fine, I made a mistake, but getting an {{EOFException}}? That's hardly an appropriate response. I should get a proper failure ({{"outcome" => "failed"}} etc.).
--
This message was sent by Atlassian JIRA
(v6.2.6#6264)
11 years, 9 months