You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by "Romain Manni-Bucau (JIRA)" <ji...@apache.org> on 2015/01/09 11:27:34 UTC
[jira] [Resolved] (TOMEE-1490) Arquillian Test and Local
context.xml file not loading correctly
[ https://issues.apache.org/jira/browse/TOMEE-1490?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Romain Manni-Bucau resolved TOMEE-1490.
---------------------------------------
Resolution: Fixed
Fix Version/s: 1.7.2
2.0.0-Milestone-1
Enhanced CDI support - few cases needed some more advanced integration like realm lifecycle handling with a cdi low typed realm - on trunk and 1.7.x branch and added a test using arquillian to the existing example: https://git-wip-us.apache.org/repos/asf?p=tomee.git;a=blob;f=examples/cdi-realm/src/test/java/org/superbiz/AuthBeanTest.java;h=d89d691e7ad36e85278b5090b64c1267ae5f12ef;hb=fea2a02434ed1ccd361556cbd43eb3d7b495a788
> Arquillian Test and Local context.xml file not loading correctly
> ----------------------------------------------------------------
>
> Key: TOMEE-1490
> URL: https://issues.apache.org/jira/browse/TOMEE-1490
> Project: TomEE
> Issue Type: Bug
> Components: TomEE Arquillian Adapters
> Affects Versions: 1.7.1
> Reporter: Ryan McGuinness
> Assignee: Romain Manni-Bucau
> Labels: arquillian, test
> Fix For: 2.0.0-Milestone-1, 1.7.2
>
>
> When using a custom "webapp/META-INF/context.xml
> <Context>
> <Realm className="org.apache.catalina.realm.LockOutRealm">
> <Realm
> cdi="true"
> className="org.apache.tomee.catalina.realm.LazyRealm"
> realmClass="example.service.SecurityRealm" />
> </Realm>
> </Context>
> Then build the shrink wrap to include it in deployment:
> @Deployment(testable = true)
> public static WebArchive createDeployment() {
> WebAppDescriptor descriptor = Descriptors.create(WebAppDescriptor.class)
> .version("3.0");
> File[] files = new File("src/main/resources/META-INF").listFiles();
> WebArchive war = ShrinkWrap.create(WebArchive.class, "example.war")
> .setWebXML(new StringAsset(descriptor.exportAsString()))
> .addPackages(true, "example")
> .addAsManifestResource(new File("src/main/webapp/META-INF/context.xml"))
> .addAsWebInfResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml"));
> for (File f : files) {
> war.addAsManifestResource(f);
> }
> System.out.println(war.toString(true));
> return war;
> }
> The following error is thrown (regardless the realm definition):
> Caused by: org.apache.catalina.LifecycleException: Failed to start component [Realm[LockOutRealm]]
> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
> at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5373)
> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
> ... 99 more
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)