[shrinkwrap-issues] [JBoss JIRA] Commented: (SHRINKWRAP-315) NPE in ContainerBase.addAsLibrary

Tommy Tynjä (JIRA) jira-events at lists.jboss.org
Wed Aug 10 14:06:24 EDT 2011


    [ https://issues.jboss.org/browse/SHRINKWRAP-315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12620092#comment-12620092 ] 

Tommy Tynjä commented on SHRINKWRAP-315:
----------------------------------------

Could you provide some more details on how you are producing the NPE? I tried to reproduce it with the following test cases, but I receive a "java.lang.IllegalArgumentException: xerces/xercesImpl.jar doesn't exist or can't be accessed" for both cases:

DynamicContainerTestBase:
{code:java}
@Test
@ArchiveType(LibraryContainer.class)
public void testAddAsLibraryWithUnknownLibrary() throws Exception {
   getLibraryContainer().addAsLibrary("xerces/xercesImpl.jar", "xercesImpl.jar"); // Library which does not exist
}

@Test
@ArchiveType(LibraryContainer.class)
public void testWebArchiveAddAsLibraryWithUnknownLibrary() throws Exception {
   WebArchive war = ShrinkWrap.create(WebArchive.class);
   war.addAsLibrary("xerces/xercesImpl.jar", "xercesImpl.jar"); // Library which does not exist
}
{code} 

> NPE in ContainerBase.addAsLibrary
> ---------------------------------
>
>                 Key: SHRINKWRAP-315
>                 URL: https://issues.jboss.org/browse/SHRINKWRAP-315
>             Project: ShrinkWrap
>          Issue Type: Bug
>            Reporter: Andrew Rubinger
>
> Using code:
> {code}war.addAsLibrary("xerces/xercesImpl.jar", "xercesImpl.jar");{code}
> ..if the resourceName doesn't exist, results in:
> {code}Caused by: java.lang.NullPointerException
> 	at org.jboss.shrinkwrap.impl.base.container.ContainerBase.addAsLibrary(ContainerBase.java:1353)
> 	at org.jboss.shrinkwrap.impl.base.container.ContainerBase.addAsLibrary(ContainerBase.java:1338)
> 	at org.jboss.shrinkwrap.impl.base.container.ContainerBase.addAsLibrary(ContainerBase.java:1289)
> 	at org.jboss.as.test.spec.xerces.ws.XercesUsageInWebServiceTestCase.createWebServiceDeployment(XercesUsageInWebServiceTestCase.java:74)
> 	... 59 more{code}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       



More information about the shrinkwrap-issues mailing list