[JBoss AS 7 Development] - As 7.2 Log4j Logging
by Bill Rosenberg
Bill Rosenberg [https://community.jboss.org/people/bill.rosenberg] created the discussion
"As 7.2 Log4j Logging"
To view the discussion, visit: https://community.jboss.org/message/823536#823536
--------------------------------------------------------------
Logging seemed to work fine when i was using AS 7.1 with log4j libs and code, now when using 7.2, i do not see the expected logging using log4j.
I follow the migration guide:
*Procedure 3.5. Configure JBoss Enterprise Application Platform 6 to use a log4 j.properties*
*or log4 j.xml file*
1. 1. Create a *jboss-deploym ent-structure.xm l* with the following content:
<jboss-deploym ent-structure>
<deploym ent>
<!-- Exclusions allow you to prevent the server from autom atically
adding som e dependencies -->
<exclusions>
<m odule nam e="org.apache.log4j" />
</exclusions>
</deploym ent>
</jboss-deploym ent-structure>
1. 2. Place the *jboss-deploym ent-structure.xm l* file in either the *MET A-INF/* directory or the
*WEB-INF/* directory if you are deploying a WAR, or in the *MET A-INF/* directory if you are
deploying an EAR.
1. 3. Include the *log4 j.properties* or *log4 j.xm l* file in the *lib/* directory in your deployment.
2. 4. Start the JBoss Enterprise Application Platform 6 server with the following runtime argument to
prevent a *ClassCastException* from appearing in the console when you deploy the application:
-Dorg.jboss.as.logging.per-deploym ent=false
1. 5. Deploy your application.
And then i get an exception that log4j classes cannot be found, which i would expect if i exclude log4j from the deployment.
12:41:29,192 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.deployment.subunit."LightSpeed.ear"."LightSpeedEJB.jar".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."LightSpeed.ear"."LightSpeedEJB.jar".INSTALL: JBAS018733: Failed to process phase INSTALL of subdeployment "LightSpeedEJB.jar" of deployment "LightSpeed.ear"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:127) [jboss-as-server-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_21]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_21]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_21]
*Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Priority*
at com.lightspeed.rdp.ejb.RateDynamicStatusBean.<clinit>(RateDynamicStatusBean.java:67)
at java.lang.Class.forName0(Native Method) [rt.jar:1.7.0_21]
at java.lang.Class.forName(Class.java:266) [rt.jar:1.7.0_21]
at org.jboss.invocation.proxy.AbstractProxyFactory.afterClassLoad(AbstractProxyFactory.java:94)
at org.jboss.invocation.proxy.AbstractClassFactory.defineClass(AbstractClassFactory.java:166)
at org.jboss.invocation.proxy.AbstractProxyFactory.getCachedMethods(AbstractProxyFactory.java:145)
at org.jboss.as.ejb3.component.stateless.StatelessComponentDescription$3.configure(StatelessComponentDescription.java:150)
at org.jboss.as.ee.component.ComponentDescription$DefaultComponentConfigurator.configure(ComponentDescription.java:929)
at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:80)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:120) [jboss-as-server-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
... 5 more
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Priority from [Module "deployment.LightSpeed.ear:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:196) [jboss-modules.jar:1.2.0.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:444) [jboss-modules.jar:1.2.0.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:432) [jboss-modules.jar:1.2.0.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:374) [jboss-modules.jar:1.2.0.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:119) [jboss-modules.jar:1.2.0.Final-redhat-1]
... 15 more
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/823536#823536]
Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
11 years, 6 months
[JBoss Remoting Development] - [Remoting 3] SASL and Kerberos
by Ron Sigal
Ron Sigal [https://community.jboss.org/people/ron_sigal] modified the document:
"[Remoting 3] SASL and Kerberos"
To view the document, visit: https://community.jboss.org/docs/DOC-17302
--------------------------------------------------------------
Working on how Kerberos can be supported with Remoting for https://issues.jboss.org/browse/REM3-29 REM3-29, the first stage is understanding the unederlying mechanism.
*Please Note, this article is not a user guide, it is a reference guide to hold the information needed so that the issue REM3-129 can be implemented.*
Whilst there is some JDK documentation this does not go into the finer details, the implementation makes quite a few assumptions so this article is to capture the additional detail.
h1. Client
OS local Kerberos configuration can be used to specify the Ream and KDC, alternatively JVM wide system properties can be used: -
System.setProperty("java.security.krb5.kdc", "ec2-?-?-?-?.compute-1.amazonaws.com");
System.setProperty("java.security.krb5.realm", "DARRANL.JBOSS.ORG");
On the client side unless you fallback to default JAAS configurations the SASL negotiation needs to be within a PrivilegedAction where a Subject for the local clients identity is passed in: -
Subject.doAs(clientSubject, new PrivilegedAction<Void>() {
@Override
public Void run() {
try {
client.haveAChat();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
});
To obtain the subject a JAAS LoginContext is used with the 'com.sun.security.auth.module.Krb5LoginModule' LoginModule, although JAAS is used we don't need the configuration within a descriptor - we can provide a simplified configuration for the client and dynamically configure the LoginContext.
No special configuration of the LoginModule is required on the client side. There are three configuration options for the client: -
1. Use a supplied CallbackHandler to prompt the client for the username and password, the LoginModule will then obtain their Kerberos tickets.
2. Configure to use a keytab without prompting - useful for unattended processes e.g. server instances.
3. Configure to use local OS cache i.e. if user obtained Kerberos ticket on OS log on use this identity.
The client side does not require the 'storeKey' option being set to true although if a process is both a client and a server this can be set to true.
Inside the PriviledgedAction the SaslClient can be obtained as: -
Sasl.createSaslClient(MECHS, null, "remoting", "test2", Collections.EMPTY_MAP,
new NoCallbackHanlder());
The parameters are: -
1. Array of mechanisms, in this case just "GSSAPI"
2. The authorization ID, if not supplied it will default to the username@REALM of the user.
3. Protocol
4. Server host name
5. Configuration options
6. Callback Handler
*The values for protocol and server host name are criticial to the negotiation process.*
In this example before the communication with the server commences the client side will automatically send a TGS-REQ to the KDC for the server name 'remoting/test2' - this is an integral part of the process an if this server is not known by the KDC the process will terminate.
Do also note that the host name may undergo the following conversion, the comment in the code openly admints that this is against the RFC but goes ahead and does it anyway. The end result is that the name could end up being the fully qualified host name of the remote service. If the server name does not match then the original supplied name is used.
// RFC4120 does not recommend canonicalizing a hostname.
// However, for compatibility reason, we will try
// canonicalize it and see if the output looks better.
String canonicalized = (InetAddress.getByName(hostName)).
getCanonicalHostName();
For this TGS-REQ a service principal mapping on the KDC is sufficient, however there are also issues on the server side of this to consider.
There are a couple of options which could be passed in, one is to enable server_auth, this setting means that in addition to the server verifying the identity of the client the client will also verify the identity of the server.
At the stage of the SASL message exchange the CallbackHandler on the client is not required to handle any callbacks, the client side idenity has already been established when the Subject was obtained.
If this was SPNEGO the web browser would be verifying the DNS name of the server it is connecting to, we should consider if our client should allow any flexibility in the setting of server host name or should we mandate that it does match the host name we are connecting to - at the same point also consider banning connection to IP addresses as DNS is also fundamental to this.
h1. Server
As for the client side the Realm / KDC configuration is required, again this can either be configured using OS specific configuration or the same system properties can be set.
On the server a Subject needs to be obtained similar to how one was obtained for the client, this time the Subject is for the identity of the server - all the Sasl calls will then be within a PriviledgedAction.
When the Subject for the server is obtained here it is essential that 'storeKey' is set to true for the LoginModule, this will store the KerberosKeys for the server in the PrivateCredentials of the Subject.
On the server side the SaslServer can be obtained with: -
SaslServer saslServer = Sasl.createSaslServer(GSSAPI, "remoting", "test2", Collections.EMPTY_MAP,
new AuthorizeCallbackHandler());
Here the parameters are: -
1. Chosen mechanism "GSSAPI"
2. Protocol
3. Server Host Name
4. Configuration options
5. Callback Handler
On the server side the protocol and server host name are again critical to the process but this time they affect how the PrivateCredentials of the Subject are searched.
In this example the protocol is 'remoting', the server host name is 'test2' and from the system properties the realm is 'DARRANL.JBOSS.ORG', the private credentials of the Subject will be searched for KerberosKeys with the prinicipal name " mailto:remoting/test2@DARRANL.JBOSS.ORG remoting/test2(a)DARRANL.JBOSS.ORG"
On the server side an error indicating "Mechanism level: Failed to find any Kerberos Key" most likely translates to mean that no key has been found with the expected principal name.
The server identity does need to match the identity the client received in the TGS-REP from the TGS-REQ that the client sent in, however I need to verify if the names within the Subject also need to match or if we can just allign the createSaslServer identity with what is provided in the Subject. The reason this needs to be considered is that it may be desirable to just have a single Kerberos identity on the server for both Remoting and HTTP, however for HTTP the identity may already be mapped to HTTP/test2
The only Callback that needs to be supported is the AuthorizeCallback, by default the authentication ID will be in the form username@REALM - there may be some desire to drop the @REALM part.
In the exchange between the client and the server we do need to be able to support 0 length SASL messages.
There is also an option that may be possible to set on the server side if the identity is only being used for incomming requests and that is to set isInitiator to false, this removes one round trip with the KDC.
--------------------------------------------------------------
Comment by going to Community
[https://community.jboss.org/docs/DOC-17302]
Create a new document in JBoss Remoting Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=102&c...]
11 years, 7 months
[jBPM Development] - Jbpm 6.0.0.beta2 error disposing ksession when commiting transaction
by Pablo Zamudio
Pablo Zamudio [https://community.jboss.org/people/pzamudio] created the discussion
"Jbpm 6.0.0.beta2 error disposing ksession when commiting transaction"
To view the discussion, visit: https://community.jboss.org/message/822389#822389
--------------------------------------------------------------
We are testing Jbpm 6.0.0.beta2 and we get an error when working inside JBoss7, in a CMT environment.
We are using a PerRequestRuntimeManager, so with the new apis, in a CMT environment, as soon as the transaction is commited, DisposeSessionTransactionSynchronization should dispose ksession and delete it from database.
The error happens when the tx sync tries to delete ksession from db, because it tries to join the current transaction, which has been closed, so errors of transaction closed appears.
Looking at tests cases in source code, the test PerRequestRuntimeManagerTest.testCreationOfSessionWithinTransaction() has exactly the problem i am describing. The test gives green results, but in console appears the exceptions as warnings. When running over JBoss7, this exceptions turns to errors, because the server tries to make rollback of the current transaction (which is already commited).
The exact exception in testcase is:
3714 10/06 18:10:23,737[main] WARN hibernate.ejb.AbstractEntityManagerImpl.joinTransaction - HHH000326: Cannot join transaction: do not override hibernate.transaction.factory_class
3715 10/06 18:10:23,738[main] WARN drools.persistence.SingleSessionCommandService.rollbackTransaction - Could not commit session
javax.persistence.TransactionRequiredException: No active JTA transaction on joinTransaction call
at org.hibernate.ejb.AbstractEntityManagerImpl.joinTransaction(AbstractEntityManagerImpl.java:1223)
at org.hibernate.ejb.AbstractEntityManagerImpl.joinTransaction(AbstractEntityManagerImpl.java:1173)
at org.drools.persistence.jpa.JpaPersistenceContext.joinTransaction(JpaPersistenceContext.java:42)
at org.drools.persistence.SingleSessionCommandService.destroy(SingleSessionCommandService.java:428)
at org.drools.core.command.runtime.DestroySessionCommand.execute(DestroySessionCommand.java:36)
at org.drools.core.command.runtime.DestroySessionCommand.execute(DestroySessionCommand.java:22)
at org.drools.core.command.impl.DefaultCommandService.execute(DefaultCommandService.java:36)
at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:347)
at org.drools.core.command.impl.CommandBasedStatefulKnowledgeSession.destroy(CommandBasedStatefulKnowledgeSession.java:239)
at org.jbpm.runtime.manager.impl.PerRequestRuntimeManager.disposeRuntimeEngine(PerRequestRuntimeManager.java:52)
at org.jbpm.runtime.manager.impl.tx.DisposeSessionTransactionSynchronization.afterCompletion(DisposeSessionTransactionSynchronization.java:22)
at org.drools.persistence.jta.JtaTransactionSynchronizationAdapter.afterCompletion(JtaTransactionSynchronizationAdapter.java:22)
at bitronix.tm.BitronixTransaction.fireAfterCompletionEvent(BitronixTransaction.java:497)
at bitronix.tm.BitronixTransaction.commit(BitronixTransaction.java:244)
at bitronix.tm.BitronixTransactionManager.commit(BitronixTransactionManager.java:120)
at org.jbpm.runtime.manager.PerRequestRuntimeManagerTest.testCreationOfSessionWithinTransaction(PerRequestRuntimeManagerTest.java:158)
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:601)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:69)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:48)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.junit.runners.ParentRunner.run(ParentRunner.java:292)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
3717 10/06 18:10:23,740[main] WARN persistence.jta.JtaTransactionManager.rollback - Unable to rollback transaction
java.lang.IllegalStateException: transaction is done, cannot change its status
at bitronix.tm.BitronixTransaction.setRollbackOnly(BitronixTransaction.java:291)
at bitronix.tm.BitronixTransactionManager.setRollbackOnly(BitronixTransactionManager.java:150)
at org.drools.persistence.jta.JtaTransactionManager.rollback(JtaTransactionManager.java:201)
at org.drools.persistence.SingleSessionCommandService.rollbackTransaction(SingleSessionCommandService.java:405)
at org.drools.persistence.SingleSessionCommandService.destroy(SingleSessionCommandService.java:439)
at org.drools.core.command.runtime.DestroySessionCommand.execute(DestroySessionCommand.java:36)
at org.drools.core.command.runtime.DestroySessionCommand.execute(DestroySessionCommand.java:22)
at org.drools.core.command.impl.DefaultCommandService.execute(DefaultCommandService.java:36)
at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:347)
at org.drools.core.command.impl.CommandBasedStatefulKnowledgeSession.destroy(CommandBasedStatefulKnowledgeSession.java:239)
at org.jbpm.runtime.manager.impl.PerRequestRuntimeManager.disposeRuntimeEngine(PerRequestRuntimeManager.java:52)
at org.jbpm.runtime.manager.impl.tx.DisposeSessionTransactionSynchronization.afterCompletion(DisposeSessionTransactionSynchronization.java:22)
at org.drools.persistence.jta.JtaTransactionSynchronizationAdapter.afterCompletion(JtaTransactionSynchronizationAdapter.java:22)
at bitronix.tm.BitronixTransaction.fireAfterCompletionEvent(BitronixTransaction.java:497)
at bitronix.tm.BitronixTransaction.commit(BitronixTransaction.java:244)
at bitronix.tm.BitronixTransactionManager.commit(BitronixTransactionManager.java:120)
at org.jbpm.runtime.manager.PerRequestRuntimeManagerTest.testCreationOfSessionWithinTransaction(PerRequestRuntimeManagerTest.java:158)
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:601)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:69)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:48)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.junit.runners.ParentRunner.run(ParentRunner.java:292)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
3718 10/06 18:10:23,741[main] ERROR drools.persistence.SingleSessionCommandService.rollbackTransaction - Could not rollback
java.lang.RuntimeException: Unable to rollback transaction
at org.drools.persistence.jta.JtaTransactionManager.rollback(JtaTransactionManager.java:205)
at org.drools.persistence.SingleSessionCommandService.rollbackTransaction(SingleSessionCommandService.java:405)
at org.drools.persistence.SingleSessionCommandService.destroy(SingleSessionCommandService.java:439)
at org.drools.core.command.runtime.DestroySessionCommand.execute(DestroySessionCommand.java:36)
at org.drools.core.command.runtime.DestroySessionCommand.execute(DestroySessionCommand.java:22)
at org.drools.core.command.impl.DefaultCommandService.execute(DefaultCommandService.java:36)
at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:347)
at org.drools.core.command.impl.CommandBasedStatefulKnowledgeSession.destroy(CommandBasedStatefulKnowledgeSession.java:239)
at org.jbpm.runtime.manager.impl.PerRequestRuntimeManager.disposeRuntimeEngine(PerRequestRuntimeManager.java:52)
at org.jbpm.runtime.manager.impl.tx.DisposeSessionTransactionSynchronization.afterCompletion(DisposeSessionTransactionSynchronization.java:22)
at org.drools.persistence.jta.JtaTransactionSynchronizationAdapter.afterCompletion(JtaTransactionSynchronizationAdapter.java:22)
at bitronix.tm.BitronixTransaction.fireAfterCompletionEvent(BitronixTransaction.java:497)
at bitronix.tm.BitronixTransaction.commit(BitronixTransaction.java:244)
at bitronix.tm.BitronixTransactionManager.commit(BitronixTransactionManager.java:120)
at org.jbpm.runtime.manager.PerRequestRuntimeManagerTest.testCreationOfSessionWithinTransaction(PerRequestRuntimeManagerTest.java:158)
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:601)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:69)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:48)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.junit.runners.ParentRunner.run(ParentRunner.java:292)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.IllegalStateException: transaction is done, cannot change its status
at bitronix.tm.BitronixTransaction.setRollbackOnly(BitronixTransaction.java:291)
at bitronix.tm.BitronixTransactionManager.setRollbackOnly(BitronixTransactionManager.java:150)
at org.drools.persistence.jta.JtaTransactionManager.rollback(JtaTransactionManager.java:201)
... 39 more
3721 10/06 18:10:23,744[main] WARN drools.persistence.SingleSessionCommandService.rollbackTransaction - Could not commit session
java.lang.IllegalStateException: Illegal method call. This session was previously disposed.
at org.drools.core.reteoo.DisposedReteooWorkingMemory.getId(DisposedReteooWorkingMemory.java:97)
at org.drools.core.impl.StatefulKnowledgeSessionImpl.getId(StatefulKnowledgeSessionImpl.java:140)
at org.drools.core.command.runtime.GetIdCommand.execute(GetIdCommand.java:41)
at org.drools.core.command.runtime.GetIdCommand.execute(GetIdCommand.java:28)
at org.drools.core.command.impl.DefaultCommandService.execute(DefaultCommandService.java:36)
at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:376)
at org.drools.core.command.impl.CommandBasedStatefulKnowledgeSession.getId(CommandBasedStatefulKnowledgeSession.java:106)
at org.jbpm.runtime.manager.PerRequestRuntimeManagerTest.testCreationOfSessionWithinTransaction(PerRequestRuntimeManagerTest.java:163)
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:601)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:69)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:48)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.junit.runners.ParentRunner.run(ParentRunner.java:292)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
3722 10/06 18:10:23,745[main] WARN bitronix.tm.BitronixTransaction.fireAfterCompletionEvent - Synchronization.afterCompletion() call failed for org.drools.persistence.jta.JtaTransactionSynchronizationAdapter@117efa0
java.lang.IllegalStateException: Illegal method call. This session was previously disposed.
at org.drools.core.reteoo.DisposedReteooWorkingMemory.getProcessRuntime(DisposedReteooWorkingMemory.java:261)
at org.drools.core.impl.StatefulKnowledgeSessionImpl.getProcessRuntime(StatefulKnowledgeSessionImpl.java:868)
at org.drools.persistence.SingleSessionCommandService$SynchronizationImpl.afterCompletion(SingleSessionCommandService.java:485)
at org.drools.persistence.jta.JtaTransactionSynchronizationAdapter.afterCompletion(JtaTransactionSynchronizationAdapter.java:25)
at bitronix.tm.BitronixTransaction.fireAfterCompletionEvent(BitronixTransaction.java:497)
at bitronix.tm.BitronixTransaction.rollback(BitronixTransaction.java:283)
at bitronix.tm.BitronixTransactionManager.rollback(BitronixTransactionManager.java:129)
at org.drools.persistence.jta.JtaTransactionManager.rollback(JtaTransactionManager.java:199)
at org.drools.persistence.SingleSessionCommandService.rollbackTransaction(SingleSessionCommandService.java:405)
at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:384)
at org.drools.core.command.impl.CommandBasedStatefulKnowledgeSession.getId(CommandBasedStatefulKnowledgeSession.java:106)
at org.jbpm.runtime.manager.PerRequestRuntimeManagerTest.testCreationOfSessionWithinTransaction(PerRequestRuntimeManagerTest.java:163)
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:601)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:69)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:48)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.junit.runners.ParentRunner.run(ParentRunner.java:292)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/822389#822389]
Start a new discussion in jBPM Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
11 years, 7 months
[JBoss AS 7 Development] - Per-deployment logging in EAP 6.1.0.GA: no console output
by fabioo
fabioo [https://community.jboss.org/people/fabioo] created the discussion
"Per-deployment logging in EAP 6.1.0.GA: no console output"
To view the discussion, visit: https://community.jboss.org/message/824028#824028
--------------------------------------------------------------
Hello. I'm migrating a .war application from AS 7.1 to EAP 6.1.0.GA, but I'm not able to log to console (other appenders just work) using log4j and per-deployment logging. I can reproduce the issue with a quickstart:
* Import the jboss-eap-6.1.0-quickstarts/log4j project (I've set version.org.jboss.spec.jboss.javaee.6.0 = 3.0.2.Final, for the records)* Everything's fine, logging to console is ok
* Create a log4j.properties (or .xml, I had the same issues) that logs both to a console appender and a file appender
log4j.rootLogger=INFO, file, console
log4j.appender.file=org.apache.log4j.RollingFileAppender
[...]
log4j.appender.console=org.apache.log4j.ConsoleAppender
[...]
* Deploy and run
Observed: the logs are written properly to the specified file, +but nothing is shown on the console+. No configuration warnings or errors are shown during the server/app startup.
I've spent several hours searching for a solution but the only suggestions i got were related to "disabling per-deployment logging", which is not what I want (I like this feature a lot)!
Thank you in advance,
Fabio
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/824028#824028]
Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
11 years, 7 months