[Datasource Configuration] - Re: Encrypting Datasource Password
by Larry Honeywood
Larry Honeywood [https://community.jboss.org/people/lhoneywood] created the discussion
"Re: Encrypting Datasource Password"
To view the discussion, visit: https://community.jboss.org/message/715654#715654
--------------------------------------------------------------
Also, Make sure the service type in your login-config.xml file matches the transaction type in your "-ds.xml" file. EX:
if your "-ds.xml" entry tooks like:
<*xa-datasource*>
<jndi-name>SomeDS</jndi-name>
<security-domain>SomeDomain</security-domain>
*</xa-datasource*>
Then the service type in the login-config.xml for the corresponding domain should look like :
<module-option name = "managedConnectionFactoryName">jboss.jca:name=SomeDS,*service=XATxCM*</module-option>
But,
if your "-ds.xml" entry tooks like:
<*local-tx-datasource*>
<jndi-name>SomeDS</jndi-name>
<security-domain>SomeDomain</security-domain>
*</local-tx-datasource*>
Then the service type in the login-config.xml for the corresponding domain should look like :
<module-option name = "managedConnectionFactoryName">jboss.jca:name=SomeDS,*service=LocalTxCM*</module-option>
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/715654#715654]
Start a new discussion in Datasource Configuration at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
14 years, 2 months
[Javassist] - PowerMockito jvisualvm profiler throws javassist.NotFoundException
by wmcdonald
wmcdonald [https://community.jboss.org/people/wmcdonald] created the discussion
"PowerMockito jvisualvm profiler throws javassist.NotFoundException"
To view the discussion, visit: https://community.jboss.org/message/715624#715624
--------------------------------------------------------------
I have documented this issue here:
http://code.google.com/p/powermock/issues/detail?id=370 http://code.google.com/p/powermock/issues/detail?id=370
I'm trying to use jvisualvm on a junit test that uses PowerMockito to mock out a new() for a class. When I run it in eclipse (using jdk 1.6) the junit test works fine. But if I try and use jvisualvm and instrument the classes in the package, it throws the exception:
java.lang.RuntimeException: javassist.NotFoundException: org.netbeans.lib.profiler.server.ProfilerRuntimeCPUFullInstr
at org.powermock.core.classloader.MockClassLoader.loadUnmockedClass(MockClassLoader.java:187)
at org.powermock.core.classloader.MockClassLoader.loadModifiedClass(MockClassLoader.java:147)
at org.powermock.core.classloader.DeferSupportingClassLoader.loadClass(DeferSupportingClassLoader.java:65)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at org.pm.PMProfilerTest$1.<init>(PMProfilerTest.java:32)
at org.pm.PMProfilerTest.setup(PMProfilerTest.java:32)
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.junit.internal.runners.MethodRoadie.runBefores(MethodRoadie.java:129)
at org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:93)
at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$PowerMockJUnit44MethodRunner.executeTest(PowerMockJUnit44RunnerDelegateImpl.java:294)
at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$PowerMockJUnit44MethodRunner.runBeforesThenTestThenAfters(PowerMockJUnit44RunnerDelegateImpl.java:282)
at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:84)
at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:49)
at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.invokeTestMethod(PowerMockJUnit44RunnerDelegateImpl.java:207)
at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.runMethods(PowerMockJUnit44RunnerDelegateImpl.java:146)
at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl$1.run(PowerMockJUnit44RunnerDelegateImpl.java:120)
at org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:34)
at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:44)
at org.powermock.modules.junit4.internal.impl.PowerMockJUnit44RunnerDelegateImpl.run(PowerMockJUnit44RunnerDelegateImpl.java:118)
at org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.run(JUnit4TestSuiteChunkerImpl.java:102)
at org.powermock.modules.junit4.common.internal.impl.AbstractCommonPowerMockRunner.run(AbstractCommonPowerMockRunner.java:53)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
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: javassist.NotFoundException: org.netbeans.lib.profiler.server.ProfilerRuntimeCPUFullInstr
at javassist.ClassPool.get(ClassPool.java:440)
at org.powermock.core.classloader.MockClassLoader.loadUnmockedClass(MockClassLoader.java:180)
... 29 more
Is it possible to use PowerMockito and jvisualvm? If so, what do I need to do?
TVMIA
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/715624#715624]
Start a new discussion in Javassist at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
14 years, 2 months
[Datasource Configuration] - javax.resource.ResourceException: Some connections were not closed
by Leon Feijtel
Leon Feijtel [https://community.jboss.org/people/feijtel] created the document:
"javax.resource.ResourceException: Some connections were not closed"
To view the document, visit: https://community.jboss.org/docs/DOC-17543
--------------------------------------------------------------
Hi,
Yesterday I was investigating a “Connection is not associated with a managed connection” error that occurred in our application. Browsing through the log files, I discovered that we accidentally leaked a connection when retrieving data from the database failed.
The following happened:
A ClassCastException occurred while Hibernate was resolving a ManyToOne relationship. One of the classes involved was not Serializable. Because the error handling in our application did not close the session, JBoss cleaned up for us and the CachedConnectionManager reported: Closing a connection for you. Please close them yourself.
Obviously, this means there are two errors in the application. One of the classes needed to be Serializable, and our error handling wasn’t closing the session properly.
However, straight after that another error was shown in the logging:
1. javax.servlet.ServletException: Error invoking cached connection manager
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:174)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:451)
at java.lang.Thread.run(Thread.java:662)
Caused by: javax.resource.ResourceException: Some connections were not closed, see the log for the allocation stacktraces
at org.jboss.resource.connectionmanager.CachedConnectionManager.popMetaAwareObject(CachedConnectionManager.java:251)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:164)
... 6 more
This confuses me a little. JBoss detects that we left a connection open (we have the properties ‘debug’ and ‘error’ both set to true in the jca-jboss-beans.xml), but it seems that when JBoss tries to close it, something else goes wrong. Why closing fails, I do not know. The ResourceException says “see the log file for allocation stacktraces”, but I’m not sure what to look for?
After all of the above, the Hibernate Session object thinks its session object and connection are still in good shape. The session.isOpen() and the session.isConnected() both return true. However, the underlying JDBC connection isn’t there anymore. Any attempt to use the Session object afterwards results in the “Connection is not associated with a managed connection” error mentioned above.
We are using JBoss 5 and Hibernate 3.2. We plan to upgrade Hibernate to a new version, but haven’t been able to find the time. So I'm stuck for now with this version.
I realize our application contains a serious error by not closing the session, and that that is the area that needs to be fixed. But I’m trying to understand how it’s possible that closing the connection fails and how it’s possible that Hibernate still thinks everything is ok, while the underlying JDBC connection has been closed/destroyed. Shouldn't JBoss signal that the connection close failed and inform Hibernate?
Any help is appreciated.
--------------------------------------------------------------
Comment by going to Community
[https://community.jboss.org/docs/DOC-17543]
Create a new document in Datasource Configuration at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=102&c...]
14 years, 2 months