This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 271497 - Normal (non-maven) project created using dependencies resolved by maven with arquillian testing generates strange errors in netbeans
Summary: Normal (non-maven) project created using dependencies resolved by maven with ...
Status: NEW
Alias: None
Product: projects
Classification: Unclassified
Component: Ant Project (show other bugs)
Version: 8.2
Hardware: PC Linux
: P3 normal (vote)
Assignee: Tomas Stupka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-18 08:27 UTC by ferenci84
Modified: 2017-09-18 11:23 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ferenci84 2017-09-18 08:27:46 UTC
I have originally submitted this to java EE, however I found that there is no activity there.

Created attachment https://netbeans.org/bugzilla/attachment.cgi?id=165140
working maven project

I have used a working maven project to create the same in a normal netbeans project to be able to run test using arquillian.
What I have done:
I have resolved the dependencies with maven (see pom.xml)
I have created a blank normal netbeans (ant-based) web-application, imported the dependencies and copied the files to the appropriate folders.
The project consists of 3 important files: Greeter.java, BasicTest.java, arquillian.xml

The error says: Caused by: java.lang.IllegalArgumentException: WEB-INF/classes/org/arquillian/wildfly/example/Greeter.class not found in classloader sun.misc.Launcher$AppClassLoader@5197848c

When I created the project with Greeter.java in the test classes, it worked OK, however when I wanted to do a workaround other strange things happened, for example:

1. When I start from the above structure and copy back the Greeter.java to the tests, it shows the same message, although creating this project structure from scratch did work well.

2. When I created links (on linux system) from the maven project (I have done this in my real project) creating the working structure, although the BasicTest.java has run OK, when I created a new test file, it didn't recognize, even if the code was the same as BasicTest.java. I then experimented with this error by creating a blank project and copying static (not linked) files, and it worked with simple JUnit tests, and after I imported the libraries, for the first test, however then I again couldn't add anymore tests, it simply ignored them.

I have attached the maven project. The netbeans project is too big, I uploaded it to aws:
https://s3-eu-west-1.amazonaws.com/ferenci84/ArquillianTest.zip
Comment 1 ferenci84 2017-09-18 11:23:18 UTC
For your information, I have found a workaround that had to be made in the bild-impl.xml. In order to run the test OK, I had to make it compile the project files into the bild/test/classes directory and then to delete the bild/web/WEB-INF/classes directory. Somehow both of these steps are needed (even directories couldn't be in the classes directory) in order to be compatible with the arquillian testing. I found this by experimenting the differences in the bild directory between the working and not-working scenario.
I also found that the incompatible module is ShrinkWrap.