[Security & JAAS/JBoss] - EJB Client and Digest Auth using same SecurityDomain
by joff
Ok, I seem to have run into a bit of an issue with my application.
Firstly, I have an application-policy set up in login-config.xml, and configured with the web-tier, such that in order to access any servlets (actually web services), it requires DIGEST authentication (looked up in the database)
Here is the login-config.xml. Everything else in it is as per default:
<application-policy name="MyDomain">
| <authentication>
| <login-module code = "org.jboss.security.auth.spi.DatabaseServerLoginModule" flag = "required">
| <module-option name = "dsJndiName">java:/myDS</module-option>
|
| <module-option name = "principalsQuery">SELECT password_hash FROM auth WHERE user_id=?</module-option>
| <module-option name = "rolesQuery">SELECT role AS Role,"Roles" AS RoleGroup FROM role WHERE user_id=?</module-option>
| <module-option name = "hashAlgorithm">MD5</module-option>
| <module-option name = "hashEncoding">rfc2617</module-option>
| <module-option name = "hashUserPassword">false</module-option>
| <module-option name = "hashStorePassword">true</module-option>
| <module-option name = "passwordIsA1Hash">true</module-option>
| <module-option name = "storeDigestCallback">org.jboss.security.auth.spi.RFC2617Digest</module-option>
| </login-module>
| </authentication>
| </application-policy>
These services access EJBs, which are set up thus:
@Stateful
| @Local(CategoriesManagerLocal.class)
| @SecurityDomain("MyDomain")
| @RolesAllowed({"Soap","Native"})
| public class CategoriesManagerBean implements CategoriesManagerLocal {
This is working fine at the moment, HOWEVER, I also need to access these beans from an incoming JCA Resource Adapter (i.e. a custom TCP/IP protocol) which, as part of the protocol does it's own DIGEST authentication implementation. What I need to do, is programatically authenticate this user with the container, so that I can then access these same beans.
I had tried accessing them like this:
Properties env = new Properties();
| env.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.security.jndi.LoginInitialContextFactory");
| env.setProperty(Context.PROVIDER_URL, "jnp://localhost:1099");
| env.setProperty(Context.SECURITY_PROTOCOL, "MyDomain");
| env.setProperty(Context.SECURITY_PRINCIPAL, String.valueOf(user.getId()));
| env.setProperty(Context.SECURITY_CREDENTIALS, user.getPasswordHash());
|
| Context ctx = new InitialContext(env);
| CategoriesManagerLocal categoriesBean = (CategoriesManagerLocal) ctx.lookup("myapp/CategoriesManagerBean/local");
| categoriesBean.doMyAction();
This, naturally fails, as I'm passing in the already hashed password (I cannot access the plaintext of it) from the database, as the credentials, but the settings in the application-policy mean that it will try and use that hashed data as the plaintext, and thus I get:
FATAL [com.myorg.myapp] Failed to login using protocol=MyDomain
So I tried to add a second application-policy, "MyDomainInternal" to login-config.xml, which has all the hashing options taken out, and referring to that in the SECURITY_PROTOCOL, which seems to authenticate the user ok, but then it seems to also check against the "MyDomain" policy, and fails. Is this because I have specified @SecurityDomain("MyDomain") on the EJB? There doesn't seem to be any way to define multiple domains on a bean.
Logfile with security TRACE options enabled follows:
2007-06-07 16:01:51,701 TRACE [org.jboss.security.auth.login.XMLLoginConfigImpl] Begin getAppConfigurationEntry(MyDomainInternal), size=10
| 2007-06-07 16:01:51,701 TRACE [org.jboss.security.auth.login.XMLLoginConfigImpl] End getAppConfigurationEntry(MyDomainInternal), authInfo=AppConfigurationEntry[
| ]:
| [0]
| LoginModule Class: org.jboss.security.auth.spi.DatabaseServerLoginModule
| ControlFlag: LoginModuleControlFlag: required
| Options:name=rolesQuery, value=SELECT role AS Role,"Roles" AS RoleGroup FROM role WHERE user_id=?
| name=principalsQuery, value=SELECT password_hash FROM auth WHERE user_id=?
| name=dsJndiName, value=java:/myDS
|
| 2007-06-07 16:01:51,702 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] initialize, instance=@2036027929
| 2007-06-07 16:01:51,702 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] Security domain: FirstAlertGatewayInternal
| 2007-06-07 16:01:51,702 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] DatabaseServerLoginModule, dsJndiName=java:/myDS
| 2007-06-07 16:01:51,702 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] principalsQuery=SELECT password_hash FROM auth WHERE user_id=?
| 2007-06-07 16:01:51,702 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] rolesQuery=SELECT role AS Role,"Roles" AS RoleGroup FROM role WHERE user_id=?
| 2007-06-07 16:01:51,702 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] suspendResume=true
| 2007-06-07 16:01:51,702 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] login
| 2007-06-07 16:01:51,703 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] suspendAnyTransaction
| 2007-06-07 16:01:51,704 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] Excuting query: SELECT password_hash FROM auth WHERE user_id=?, with username: 0
| 2007-06-07 16:01:51,705 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] Obtained user password
| 2007-06-07 16:01:51,705 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] resumeAnyTransaction
| 2007-06-07 16:01:51,706 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] User '0' authenticated, loginOk=true
| 2007-06-07 16:01:51,706 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] commit, loginOk=true
| 2007-06-07 16:01:51,706 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] getRoleSets using rolesQuery: SELECT role AS Role,"Roles" AS RoleGroup FROM role WH
| ERE user_id=?, username: 0
| 2007-06-07 16:01:51,706 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] suspendAnyTransaction
| 2007-06-07 16:01:51,709 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] Excuting query: SELECT role AS Role,"Roles" AS RoleGroup FROM role WHERE user_id=?,
| with username: 0
| 2007-06-07 16:01:51,710 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] Assign user to role Native
| 2007-06-07 16:01:51,710 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] Assign user to role Soap
| 2007-06-07 16:01:51,710 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] resumeAnyTransaction
| 2007-06-07 16:01:51,789 TRACE [org.jboss.security.SecurityAssociation] getPrincipal, principal=null
| 2007-06-07 16:01:51,789 TRACE [org.jboss.security.plugins.JaasSecurityManager.MyDomain] Begin isValid, principal:null, cache info: null
| 2007-06-07 16:01:51,789 TRACE [org.jboss.security.plugins.JaasSecurityManager.MyDomain] defaultLogin, principal=null
| 2007-06-07 16:01:51,790 TRACE [org.jboss.security.auth.login.XMLLoginConfigImpl] Begin getAppConfigurationEntry(MyDomain), size=10
| 2007-06-07 16:01:51,790 TRACE [org.jboss.security.auth.login.XMLLoginConfigImpl] End getAppConfigurationEntry(MyDomain), authInfo=AppConfigurationEntry[]:
| [0]
| LoginModule Class: org.jboss.security.auth.spi.DatabaseServerLoginModule
| ControlFlag: LoginModuleControlFlag: sufficient
| Options:name=hashEncoding, value=rfc2617
| name=rolesQuery, value=SELECT role AS Role,"Roles" AS RoleGroup FROM role WHERE user_id=?
| name=principalsQuery, value=SELECT password_hash FROM auth WHERE user_id=?
| name=hashUserPassword, value=false
| name=passwordIsA1Hash, value=true
| name=hashAlgorithm, value=MD5
| name=hashStorePassword, value=true
| name=storeDigestCallback, value=org.jboss.security.auth.spi.RFC2617Digest
| name=dsJndiName, value=java:/myDS
|
| 2007-06-07 16:01:51,790 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] initialize, instance=@5298117
| 2007-06-07 16:01:51,790 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] Security domain: MyDomain
| 2007-06-07 16:01:51,790 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] Password hashing activated: algorithm = MD5, encoding = rfc2617, charset = {default
| }, callback = null, storeCallback = org.jboss.security.auth.spi.RFC2617Digest
| 2007-06-07 16:01:51,791 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] DatabaseServerLoginModule, dsJndiName=java:/myDS
| 2007-06-07 16:01:51,791 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] principalsQuery=SELECT password_hash FROM auth WHERE user_id=?
| 2007-06-07 16:01:51,791 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] rolesQuery=SELECT role AS Role,"Roles" AS RoleGroup FROM role WHERE user_id=?
| 2007-06-07 16:01:51,791 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] suspendResume=true
| 2007-06-07 16:01:51,791 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] login
| 2007-06-07 16:01:51,791 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] Authenticating as unauthenticatedIdentity=null
| 2007-06-07 16:01:51,791 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] suspendAnyTransaction
| 2007-06-07 16:01:51,792 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] Excuting query: SELECT password_hash FROM auth WHERE user_id=?, with username: null
| 2007-06-07 16:01:51,793 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] Query returned no matches from db
| 2007-06-07 16:01:51,793 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] resumeAnyTransaction
| 2007-06-07 16:01:51,794 TRACE [org.jboss.security.auth.spi.DatabaseServerLoginModule] abort
| 2007-06-07 16:01:51,794 TRACE [org.jboss.security.plugins.JaasSecurityManager.FirstAlertGateway] Login failure
| javax.security.auth.login.FailedLoginException: No matching username found in Principals
| at org.jboss.security.auth.spi.DatabaseServerLoginModule.getUsersPassword(DatabaseServerLoginModule.java:152)
| at org.jboss.security.auth.spi.UsernamePasswordLoginModule.login(UsernamePasswordLoginModule.java:206)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| ...
Am I close, or totally barking up the wrong tree?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4051960#4051960
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4051960
18Â years, 10Â months
[JBoss Seam] - Problem injecting (@In) entityManger in TestNG unit test
by roger_goldman2000
I'm trying to cause the EntityManager to be injected into a unit test class running via TestNG, but am having no luck. I'm hoping someone here can shed some light as to why.
Here's the steps I took (using Seam 1.2.1GA, JBoss4.2.0GA, JBossIDE 2.0.0Beta2)
| 1. "seam setup" to create a brand new project "SimpleTest"
| 2. "seam new-project"
| 3. "seam explode"
| 4. Using JBossIDE, created New General Project for SimpleTest
| 5. Created a class SimpleTest as follows:
|
| | package simpletest;
| |
| | import javax.persistence.EntityManager;
| |
| | import org.jboss.seam.annotations.In;
| | import org.jboss.seam.annotations.Name;
| | import org.jboss.seam.mock.SeamTest;
| | import org.testng.annotations.Test;
| |
| | @Name("SimpleTest")
| | public class SimpleTest extends SeamTest {
| |
| | @Test
| | public void theTest() {
| | entityManager.getTransaction().begin(); // I get a NullPointerException here!!!
| | entityManager.getTransaction().commit();
| | }
| |
| | @In
| | private EntityManager entityManager;
| | }
| |
| 6. Created a TestNG configuration file as follows:
|
| | <!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd">
| | <suite name="Test">
| | <test verbose="10" name="TheSimpleTest" annotations="JDK">
| | <packages>
| | <package name="simpletest" />
| | </packages>
| | </test>
| | </suite>
| |
| 7. Ran TestNG with the following classpath elements:
|
| | 1. \SimpleTest\embedded-ejb\conf
| | 2. \SimpleTest\resources
| | 3. \SimpleTest\classes
| | 4. C:\jboss-seam-1.2.1.GA\lib\*.jar
| | 5. C:\jboss-seam-1.2.1GA\jboss-seam.jar
| |
|
|
| Out of the box, I got the following error:
|
| | ...
| | 22:24:56,381 INFO [Initialization] two components with same name, higher precedence wins: org.jboss.seam.persistence.persistenceProvider
| | 22:24:56,501 INFO [Initialization] two components with same name, higher precedence wins: org.jboss.seam.security.identity
| | ...
| | Failed to invoke @Configuration method org.jboss.seam.mock.SeamTest.init:Could not create Component: org.jboss.seam.security.identity
| | [Invoker 6889270] Keeping method org.jboss.seam.mock.SeamTest.begin() for class [TestClass class simpletest.SimpleTest]
| | [Invoker 6889270] Keeping method org.jboss.seam.mock.SeamTest.end() for class [TestClass class simpletest.SimpleTest]
| | [Invoker 6889270] Keeping method org.jboss.seam.mock.SeamTest.begin() for class [TestClass class simpletest.SimpleTest]
| | [Invoker 6889270] Keeping method org.jboss.seam.mock.SeamTest.end() for class [TestClass class simpletest.SimpleTest]
| | [Invoker 6889270] Keeping method org.jboss.seam.mock.SeamTest.cleanup() for class [TestClass class simpletest.SimpleTest]
| |
| | *********** INVOKED METHODS
| |
| | org.jboss.seam.mock.SeamTest.init() 22481956
| | simpletest.SimpleTest.theTest() 22481956
| |
| | ***********
| |
| | Creating C:\Projects\SimpleTest\test-output\Test\TheSimpleTest.html
| | FAILED CONFIGURATION: @BeforeClass init
| | java.lang.RuntimeException: Could not create Component: org.jboss.seam.security.identity
| | at org.jboss.seam.init.Initialization.addComponent(Initialization.java:865)
| | at org.jboss.seam.init.Initialization.installComponents(Initialization.java:796)
| | at org.jboss.seam.init.Initialization.init(Initialization.java:503)
| | at org.jboss.seam.mock.SeamTest.init(SeamTest.java:701)
| | Caused by: java.lang.IllegalArgumentException: no such setter method: org.jboss.seam.security.Identity.securityRules
| | at org.jboss.seam.util.Reflections.getSetterMethod(Reflections.java:219)
| | at org.jboss.seam.Component.initInitializers(Component.java:401)
| | at org.jboss.seam.Component.<init>(Component.java:263)
| | at org.jboss.seam.Component.<init>(Component.java:203)
| | at org.jboss.seam.init.Initialization.addComponent(Initialization.java:851)
| | ... 25 more
| | ... Removed 22 stack frames
| | SKIPPED CONFIGURATION: @BeforeMethod begin
| | SKIPPED CONFIGURATION: @AfterMethod end
| | SKIPPED CONFIGURATION: @AfterClass cleanup
| | SKIPPED: theTest
| |
|
| So, I commented out the following lines in components.xml:
|
| | <drools:rule-base name="securityRules">
| | <drools:rule-files>
| | <value>/security.drl</value>
| | </drools:rule-files>
| | </drools:rule-base>
| |
| | <security:identity authenticate-method="#{authenticator.authenticate}"
| | security-rules="#{securityRules}"/>
| |
| and got much further, but still got a NullPointerException trying to reference the entityManager that I was hoping to have injected by the @In annotation. As you can see the "entityManager" component was initialized from components.xml but @In didn't seem to inject it.
|
| | ...
| | 22:27:46,646 INFO [Initialization] two components with same name, higher precedence wins: org.jboss.seam.security.identity
| | 22:27:46,736 INFO [Initialization] two components with same name, higher precedence wins: org.jboss.seam.persistence.persistenceProvider
| | 22:27:46,766 INFO [Component] Component: org.jboss.seam.core.init, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.core.Init
| | 22:27:46,946 INFO [Initialization] Installing components...
| | 22:27:46,986 INFO [Component] Component: entityManager, scope: CONVERSATION, type: JAVA_BEAN, class: org.jboss.seam.core.ManagedPersistenceContext
| | ...
| | 22:27:47,397 INFO [Ejb] starting the embedded EJB container
| | 22:27:48,759 WARN [BeanSchemaBinding] You should use the 2.0 version of the Microcontainer xml. xmlns='urn:jboss:bean-deployer:2.0'
| | 22:27:49,480 INFO [LocalTxDataSource] Bound datasource to JNDI name 'java:/DefaultDS'
| | 22:27:50,441 INFO [LocalTxDataSource] Bound datasource to JNDI name 'java:/SimpleTestTestDatasource'
| | 22:27:51,462 INFO [Ejb3Deployment] EJB3 deployment time took: 971
| | 22:27:52,534 INFO [Ejb3Deployment] EJB3 deployment time took: 1072
| | 22:27:52,664 INFO [MCKernelAbstraction] installing bean: jboss.j2ee:jar=jboss-seam,name=Dispatcher,service=EJB3 with dependencies:
| | 22:27:53,125 INFO [EJBContainer] STARTED EJB: org.jboss.seam.core.Dispatcher ejbName: Dispatcher
| | 22:27:53,225 INFO [MCKernelAbstraction] installing bean: jboss.j2ee:jar=jboss-seam,name=TransactionListener,service=EJB3 with dependencies:
| | 22:27:53,335 INFO [EJBContainer] STARTED EJB: org.jboss.seam.core.TransactionListener ejbName: TransactionListener
| | 22:27:53,385 INFO [Lifecycle] starting up: org.jboss.seam.servlet.exceptionFilter
| | 22:27:53,395 INFO [Lifecycle] starting up: org.jboss.seam.captcha.captchaImage
| | 22:27:54,877 INFO [Lifecycle] starting up: org.jboss.seam.servlet.multipartFilter
| | 22:27:54,877 INFO [Lifecycle] starting up: org.jboss.seam.servlet.redirectFilter
| | 22:27:54,877 INFO [Initialization] done initializing Seam
| | [Invoker 6889270] Keeping method org.jboss.seam.mock.SeamTest.begin() for class [TestClass class simpletest.SimpleTest]
| | [Invoker 6889270] Keeping method org.jboss.seam.mock.SeamTest.end() for class [TestClass class simpletest.SimpleTest]
| | [Invoker 6889270] Keeping method org.jboss.seam.mock.SeamTest.begin() for class [TestClass class simpletest.SimpleTest]
| | [Invoker 6889270] Invoking @BeforeMethod org.jboss.seam.mock.SeamTest.begin()
| | [Invoker 6889270] Invoking simpletest.SimpleTest.theTest
| | [Invoker 6889270] Keeping method org.jboss.seam.mock.SeamTest.end() for class [TestClass class simpletest.SimpleTest]
| | [Invoker 6889270] Invoking @AfterMethod org.jboss.seam.mock.SeamTest.end()
| | [Invoker 6889270] Keeping method org.jboss.seam.mock.SeamTest.cleanup() for class [TestClass class simpletest.SimpleTest]
| | [Invoker 6889270] Invoking @AfterClass org.jboss.seam.mock.SeamTest.cleanup()
| | 22:27:54,907 INFO [Ejb] stopping the embedded EJB container
| |
| | *********** INVOKED METHODS
| |
| | org.jboss.seam.mock.SeamTest.init() 5822128
| | simpletest.SimpleTest.theTest() 5822128
| | org.jboss.seam.mock.SeamTest.cleanup() 5822128
| |
| | ***********
| |
| | Creating C:\Projects\SimpleTest\test-output\Test\TheSimpleTest.html
| | FAILED: theTest
| | java.lang.NullPointerException
| | at simpletest.SimpleTest.theTest(SimpleTest.java:15)
| | ... Removed 21 stack frames
| |
|
| Any ideas?
|
| Thanks in advance.
|
| /rag
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4051956#4051956
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4051956
18Â years, 10Â months
[Beginners Corner] - Error Running JBoss with Oracle 10g
by eboi23ph
Hello,
I downloaded the latest JBoss from sourceforge (jboss-4.2.0.GA)
i followed the instructions in http://docs.jboss.org/jbossas/getting_started/v5/html/db.html on how to configure jboss using other databases.
after applying "8.3.2. Installing the JDBC Driver and Deploying the DataSource" this error occurs..
09:38:45,281 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jb
oss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI name 'java:JmsXA'
09:38:45,531 ERROR [MainDeployer] Could not create deployment: file:/C:/jboss-4.
2.0.GA/server/default/deploy/oracle-xa-ds.xml
org.jboss.deployment.DeploymentException: No ClassLoaders found for: org.jboss.r
esource.adapter.jdbc.vender.oracle.OracleXAExceptionFormatter; - nested throwabl
e: (java.lang.ClassNotFoundException: No ClassLoaders found for: org.jboss.resou
rce.adapter.jdbc.vender.oracle.OracleXAExceptionFormatter)
at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java
:196)
at org.jboss.system.ServiceController.install(ServiceController.java:226
)
at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
er.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy4.install(Unknown Source)
at org.jboss.deployment.SARDeployer.create(SARDeployer.java:249)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
er.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractIntercept
or.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelM
BeanOperationInterceptor.java:142)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy42.create(Unknown Source)
at org.jboss.deployment.XSLSubDeployer.create(XSLSubDeployer.java:192)
at org.jboss.deployment.MainDeployer.create(MainDeployer.java:969)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:818)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
er.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractIntercept
or.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelM
BeanOperationInterceptor.java:142)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy9.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen
tScanner.java:421)
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
canner.java:634)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
doScan(AbstractDeploymentScanner.java:263)
at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(A
bstractDeploymentScanner.java:336)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanS
upport.java:289)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMB
eanSupport.java:245)
at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
er.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
ler.java:978)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:417)
at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
er.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy4.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
er.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractIntercept
or.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelM
BeanOperationInterceptor.java:142)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy5.deploy(Unknown Source)
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
at org.jboss.Main.boot(Main.java:200)
at org.jboss.Main$1.run(Main.java:508)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.ClassNotFoundException: No ClassLoaders found for: org.jbos
s.resource.adapter.jdbc.vender.oracle.OracleXAExceptionFormatter
at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:212)
at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryCl
assLoader.java:514)
at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassL
oader.java:408)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at org.jboss.mx.server.MBeanServerImpl.instantiate(MBeanServerImpl.java:
1204)
at org.jboss.mx.server.MBeanServerImpl.instantiate(MBeanServerImpl.java:
286)
at org.jboss.mx.server.MBeanServerImpl.createMBean(MBeanServerImpl.java:
344)
at org.jboss.system.ServiceCreator.install(ServiceCreator.java:157)
at org.jboss.system.ServiceConfigurator.internalInstall(ServiceConfigura
tor.java:449)
at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java
:171)
... 94 more
09:38:46,406 INFO [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=.../dep
loy/jmx-console.war/
09:38:47,921 ERROR [URLDeploymentScanner] Incomplete Deployment listing:
--- Incompletely deployed packages ---
org.jboss.deployment.DeploymentInfo@a39b9838 { url=file:/C:/jboss-4.2.0.GA/serve
r/default/deploy/oracle-xa-ds.xml }
deployer: org.jboss.deployment.XSLSubDeployer@318293
status: Deployment FAILED reason: No ClassLoaders found for: org.jboss.resourc
e.adapter.jdbc.vender.oracle.OracleXAExceptionFormatter; - nested throwable: (ja
va.lang.ClassNotFoundException: No ClassLoaders found for: org.jboss.resource.ad
apter.jdbc.vender.oracle.OracleXAExceptionFormatter)
state: FAILED
watch: file:/C:/jboss-4.2.0.GA/server/default/deploy/oracle-xa-ds.xml
altDD: null
lastDeployed: 1181180325437
lastModified: 1181180325406
mbeans:
what should i do to fix this?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4051955#4051955
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4051955
18Â years, 10Â months
[JBoss Seam] - java.lang.NoClassDefFoundError: net/sf/ehcache/CacheExceptio
by azalea
Hi
In Seam Gen-generated project, I want to Unit Testing a stateful Seam component.
I want to create EntityManager in Unit Testing Code for injecting it in the Seam component with SeamTest#setField().
Running "ant test", java.lang.NoClassDefFoundError is thrown at this code.
| public class FooTest extends SeamTest {
| ... ...
| @Test
| public void testFind() {
| EntityManagerFactory emf = Persistence.createEntityManagerFactory("myproject");
| ... ...
| }
| ... ...
| }
|
"myproject" is persistence unit name defined in "resources/META-INF/persistence-test.xml".
| [testng] FAILED: seam.sandbox.unittesting.FooTest.testFind()
| [testng] java.lang.NoClassDefFoundError: net/sf/ehcache/CacheException
| [testng] at java.lang.Class.getDeclaredConstructors0(Native Method)
| [testng] at java.lang.Class.privateGetDeclaredConstructors(Class.java:23
| 7)
| [testng] at java.lang.Class.getConstructor0(Class.java:2671)
| [testng] at java.lang.Class.newInstance0(Class.java:321)
| [testng] at java.lang.Class.newInstance(Class.java:303)
| [testng] at org.hibernate.cfg.SettingsFactory.createCacheProvider(Settin
| sFactory.java:346)
| [testng] at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFact
| ry.java:220)
| [testng] at org.hibernate.cfg.Configuration.buildSettings(Configuration.
| ava:1928)
| [testng] at org.hibernate.cfg.Configuration.buildSessionFactory(Configur
| tion.java:1211)
| [testng] at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactor
| (Ejb3Configuration.java:631)
| [testng] at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFacto
| y(Ejb3Configuration.java:760)
| [testng] at org.hibernate.ejb.Ejb3Configuration.createFactory(Ejb3Config
| ration.java:151)
| [testng] at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFacto
| y(Ejb3Configuration.java:205)
| [testng] at org.hibernate.ejb.HibernatePersistence.createEntityManagerFa
| tory(HibernatePersistence.java:114)
| [testng] at javax.persistence.Persistence.createEntityManagerFactory(Per
| istence.java:37)
| [testng] at javax.persistence.Persistence.createEntityManagerFactory(Per
| istence.java:27)
| [testng] at seam.sandbox.unittesting.FooTest.testFind(FooTest.java:13)
| [testng] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| [testng] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
| sorImpl.java:39)
| [testng] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
| hodAccessorImpl.java:25)
| [testng] at java.lang.reflect.Method.invoke(Method.java:585)
| [testng] at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.j
| va:529)
| [testng] at org.testng.internal.Invoker.invokeMethod(Invoker.java:398)
| [testng] at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:6
| 5)
| [testng] at org.testng.internal.TestMethodWorker.run(TestMethodWorker.ja
| a:88)
| [testng] at org.testng.TestRunner.privateRun(TestRunner.java:614)
| [testng] at org.testng.TestRunner.run(TestRunner.java:505)
| [testng] at org.testng.SuiteRunner.privateRun(SuiteRunner.java:221)
| [testng] at org.testng.SuiteRunner.run(SuiteRunner.java:147)
| [testng] at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:576)
| [testng] at org.testng.TestNG.runSuitesLocally(TestNG.java:539)
| [testng] at org.testng.TestNG.run(TestNG.java:316)
| [testng] at org.testng.TestNG.privateMain(TestNG.java:666)
| [testng] at org.testng.TestNG.main(TestNG.java:608)
|
any Hints how to solve this problem?
[environment]
JBoss AS 4.2.0.GA
JBoss Seam CVS
(After reading Gavin's last message in http://www.jboss.com/index.html?module=bb&op=viewtopic&t=110304, I checkouted.)
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4051946#4051946
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4051946
18Â years, 10Â months