Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] Strange error in WTP webapp

Ahh... that made me look silly :)

Ok... everything is fine now up until compiling the webapp project, which is throwing the NullPointerException below.  Before I installed m2e-wtp I didn't have an error on this project. Also, a second WTP project I have also does not get this error so this is probably a project with my setup. I will try to do some debugging..

!ENTRY org.eclipse.core.resources 4 75 2011-06-21 10:41:20.516
!MESSAGE Errors occurred during the build.
!SUBENTRY 1 org.eclipse.m2e.core 4 75 2011-06-21 10:41:20.516
!MESSAGE Errors running builder 'Maven Project Builder' on project 'intouch-webapp'.
!STACK 0
java.lang.NullPointerException
at org.eclipse.wst.common.componentcore.internal.resources.VirtualComponent.setReferences(VirtualComponent.java:499)
at org.maven.ide.eclipse.wtp.WebProjectConfiguratorDelegate.setModuleDependencies(WebProjectConfiguratorDelegate.java:277)
at org.maven.ide.eclipse.wtp.WTPProjectConfigurator.mavenProjectChanged(WTPProjectConfigurator.java:75)
at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.mavenProjectChanged(ProjectConfigurationManager.java:753)
at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.notifyProjectChangeListeners(ProjectRegistryManager.java:724)
at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.applyMutableProjectRegistry(ProjectRegistryManager.java:847)
at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refresh(ProjectRegistryManager.java:280)
at org.eclipse.m2e.core.internal.project.registry.MavenProjectManager.refresh(MavenProjectManager.java:58)
at org.eclipse.m2e.core.internal.builder.MavenBuilder.build(MavenBuilder.java:120)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:629)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:172)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:203)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:255)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:258)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:311)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:343)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:144)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:242)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)


On Tue, Jun 21, 2011 at 10:18 AM, Vincent Vandenschrick <vvandens@xxxxxxxxx> wrote:
Hi Collin,
Untick "group items by category" on the selection dialog and you should be fine.

Best,
Vincent

Envoyé de mon iPhone

Le 21 juin 2011 à 18:18, Collin Peters <cpeters@xxxxxxxxxxxxxxxxxxx> a écrit :

Thanks Fred!

I'm trying to install these updates and m2e 1.0 installed ok but when I add the m2e wtp link (#3 below) Eclipse tells me "There are no categorized items". Any ideas on that?

Thanks,
Collin

On Mon, Jun 20, 2011 at 2:45 PM, Fred Bricon <fbricon@xxxxxxxxx> wrote:
Collin,

The pom.xml needing 2 saves is a bug in m2e core 0.12. It has been fixed in m2e 1.0.0 [1]
I quickly tested the setup you described with m2e-wtp 0.13.0 and haven't seen any particular issues using <includes> or folders outside the project.
I do believe you're seeing these strange behaviours but I need some sample test projects in order to reproduce the bugs.

So please, test m2e 1.0.0 [2] and m2e-wtp 0.13.0 (from the nightly build update site [3]). If you can reproduce those issues with some test projects, please open 2 separate bugs at [4]

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=340159
[2] http://download.eclipse.org/technology/m2e/releases/
[3] http://download.jboss.org/jbosstools/builds/staging/m2eclipse-wtp-e37/all/repo/
[4] https://issues.sonatype.org/browse/MECLIPSEWTP


Regards,

Fred Bricon


2011/6/20 Collin Peters <cpeters@xxxxxxxxxxxxxxxxxxx>
I was having another issue with lots of errors in my WTP project where dependencies were not being resolved. I un-installed m2eclipse-extras and now both problems are solved. Well, solved in the sense that I don't get the errors anymore but I of course don't get the benefits of the WTP functionality in m2eclipse-extras.

I noticed the following odd behaviour that might help you reproduce the problem
  • Open the Maven console
  • Create a 'foo' directory in src/main and put at least 1 file in it
  • Have a <webResource> section in your maven-war-plugin definition in the pom.xml
  • In the <webResource> have a "<targetPath>WEB-INF/foo</targetPath>" and a "<directory>src/main/foo</directory>"
  • This does seem to work though I notice the following problems
    • When editing the pom.xml I have to save the file twice. On the first save after actually making the edit I can see in the Maven console that the change was not picked up. When I re-save the file I see that it is picked up.
    • It seems if you have an <includes> section then it doesn't include *anything*. Again, you can see this output in the Maven console
  • Now, as soon as the foo directory is moved outside of the project root something very strange seems to happen. 
    • It my case the console output claims that 91 files have been copied to WEB-INF/foo
    • When I actually look inside the m2e-wtp folder (I assume this is the correct folder), I see inside m2e-wtp/web-resources/WEB-INF/foo a 'target' directory which contains an empty 'classes' directory. No 91 files to be found, nor my actual expected test file that I actually have inside foo
So clearly there are some odd bugs in this whole setup. I have had to uninstall m2eclipse-extras to make my workspace usable again.

Let me know if I can provide anymore information

Regards,
Collin

On Thu, Jun 16, 2011 at 8:56 AM, Collin Peters <cpeters@xxxxxxxxxxxxxxxxxxx> wrote:
Yes - everything works fine in the CLI.  There are 5 <webResource> sections in the pom and 3 of them refer to files outside of the project. If I comment out the last one (actually my first post shows it commented out) then m2eclipse compiles it fine. It is only when it is uncommented that this strange error happens. This error also only started happening recently so I'm not sure what exactly changed to start it off.

It is going to be very difficult to make a test project which can reproduce the error. I'll see if I can do it.

On Thu, Jun 16, 2011 at 8:14 AM, Fred Bricon <fbricon@xxxxxxxxx> wrote:
Looks like you're referring to files outside your project. This is not guaranteed to work. m2e core would not allow that kind of thing for java resources for instance as it's considered an anti-pattern. Does it work in CLI?
Can you create a JIRA issue and attach a test project reproducing the error [1]? I don't know if that can easily be fixed but I can at least take a look.

regards,

Fred Bricon
[1] https://issues.sonatype.org/browse/MECLIPSEWTP


2011/6/16 Collin Peters <cpeters@xxxxxxxxxxxxxxxxxxx>
In my webapp project I have the following in my pom.xml (see below).

As you can see, I have a number of webResource inclusions, including some SQL file, some Jasper reports, and the fckeditor (an html wysiwyg browser editor). I am having an odd problem where it will say something like:

File /home/collin/Code/intouch.git/java/intouch-webapp/../../resources/editor/target/surefire/surefire917805111467821345tmp does not exist

I have no idea how to even read this error.  The first half of it (up till "resources/editor") looks like the webResource for the fckeditor, but the second half looks like some random test file from surefire.

Anybody have any ideas on what could help?

-----------------------------------------------------------------------
pom.xml
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>${maven.war.version}</version>
<configuration>
<webResources>
<webResource>
<directory>${basedir}/src/main/webapp/WEB-INF</directory>
<targetPath>WEB-INF</targetPath>
<filtering>true</filtering>
<includes>
<include>web.xml</include>
<include>*-servlet.xml</include>
</includes>
</webResource>
<!-- Include desired I18N properties files (devel or prod) -->
<webResource>
<directory>src/main/resources/i18n/${i18nType}</directory>
<targetPath>WEB-INF/classes/i18n</targetPath>
</webResource>
<!-- Include SQL for dbmaintain -->
<webResource>
<directory>../../sql</directory>
<targetPath>WEB-INF/sql</targetPath>
<includes>
<include>**/*.sql</include>
</includes>
</webResource>
<!-- Include compiled reports -->
<webResource>
<directory>../../reports</directory>
<targetPath>WEB-INF/reports</targetPath>
<includes>
<include>**/*.jasper</include>
<!-- Include XSLT for reports -->
<include>**/*.xslt</include>
</includes>
</webResource>
<!-- Include FCKEditor Runtime -->
<!-- 
<webResource>
<directory>../../resources/editor</directory>
<targetPath>editor</targetPath>
</webResource>
-->
</webResources>
</configuration>
</plugin> 


_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-users




--
"Have you tried turning it off and on again" - The IT Crowd

_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-users




_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-users




--
"Have you tried turning it off and on again" - The IT Crowd

_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-users


_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-users

_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-users



Back to the top