Bug 961295

Summary: Seam 2.3 org.jboss.seam.mock.MockServletContext IllegalArgumentException: URI scheme is not "file" when used incontainer on EAP 6.1
Product: [Retired] JBoss Enterprise WFK Platform 2 Reporter: Marek Schmidt <maschmid>
Component: SeamAssignee: Marek Novotny <mnovotny>
Status: CLOSED CURRENTRELEASE QA Contact: Marek Schmidt <maschmid>
Severity: high Docs Contact:
Priority: unspecified    
Version: 2.2.0CC: tremes
Target Milestone: ER1   
Target Release: 2.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
EAP 6.1.0.ER6
Last Closed: 2013-07-16 11:10:04 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Marek Schmidt 2013-05-09 11:19:19 UTC
Description of problem:

Seam MockServletContext used incontainer from an arquillian test is broken on EAP6.1. This breaks restbay and tasks examples integration tests.

java.lang.IllegalArgumentException: URI scheme is not "file"
        at java.io.File.<init>(File.java:395)
        at org.jboss.seam.mock.MockServletContext.<init>(MockServletContext.java:69)
        at org.jboss.seam.mock.EnhancedMockHttpServletRequest.<init>(EnhancedMockHttpServletRequest.java:245)
        at org.jboss.seam.mock.EnhancedMockHttpServletRequest.<init>(EnhancedMockHttpServletRequest.java:202)
        at org.jboss.seam.mock.ResourceRequestEnvironment$ResourceRequest.createRequest(ResourceRequestEnvironment.java:209)
        at org.jboss.seam.mock.ResourceRequestEnvironment$ResourceRequest.init(ResourceRequestEnvironment.java:173)
        at org.jboss.seam.mock.ResourceRequestEnvironment$ResourceRequest.run(ResourceRequestEnvironment.java:158)
        at org.jboss.seam.example.restbay.test.AuctionServiceTest.testAuctions(AuctionServiceTest.java:97)

The code in MockServletContext wrongly assumes the getClass().getResource(foo).toURI() will be a file: URI. 


Version-Release number of selected component (if applicable):
WFK 2.2.0

Steps to Reproduce:
1. run restbay integration tests on EAP6.1   (e.g. mvn clean verify -Darquillian=jbossas-remote-7 )
2. notice the failure and the exception

Comment 1 Marek Novotny 2013-05-09 11:44:51 UTC
just curious what is that failing resource? That code is trying to find out web app root.

Comment 2 Marek Schmidt 2013-05-09 12:22:32 UTC
yes, I believe that never really worked. e.g. on EAP 6.0.1 the web app root it finds is 

file:/path/to/jboss-eap-6.0/modules/sun/jdk/main/service-loader-resources/

which is not very helpful anyway.

Comment 3 Marek Novotny 2013-06-03 13:47:37 UTC
fixed by https://source.jboss.org/changelog/Seam?cs=15522

Comment 5 Tomas Remes 2013-06-12 08:36:46 UTC
Verified on 2.3.0.ER1 release.