maven-surefire-plugin error during build

For help and support with issues specific to Linux/Unix
Forum rules
Please make sure you follow the Problem Reporting Guidelines before posting if you want a reply.

maven-surefire-plugin error during build

Postby jupo » Sat Mar 30, 2013 1:13 pm

Hello,

I am trying to build PS3 Media Server 1.80.0-SNAPSHOT on Ubuntu 12.04 Linaro.
The computer I am using is an Odroid-X which has a Exynos4412 ARM Cortex-A9 processor. It's a small one-board computer much like the raspberry pi.
I am using OpenJDK, java -version: java version "1.6.0_27".
I installed Maven3 from the following ppa:
Code: Select all
ppa:natecarlson/maven3


I cloned the repository from GitHub, and successfully resolved and installed the external maven libraries without a problem:
Code: Select all
sudo mvn3 com.savage7.maven.plugins:maven-external-dependency-plugin:resolve-external
sudo mvn3 com.savage7.maven.plugins:maven-external-dependency-plugin:install-external


The next step is where I ran into trouble. When I do "sudo mvn3 package", it seems to go fine until it reaches the TESTS section.
I ran it with error message and debug flags to get as much info as possible "sudo mvn3 -e -X package":

Code: Select all
-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Forking command line: /bin/sh -c cd /home/linaro/Software/pms/ps3mediaserver && /usr/lib/jvm/java-7-openjdk-armhf/jre/bin/java -Duser.language=en -Djna.nosys=true -jar /home/linaro/Software/pms/ps3mediaserver/target/surefire/surefirebooter3297331952744342749.jar /home/linaro/Software/pms/ps3mediaserver/target/surefire/surefire2077464585794320828tmp /home/linaro/Software/pms/ps3mediaserver/target/surefire/surefire_08278465121065124880tmp
Running net.pms.dlna.DLNAMediaAudioTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.494 sec
Running net.pms.dlna.DLNAMediaSubtitleTest
Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.366 sec
Running net.pms.configuration.RendererConfigurationTest

Results :

Tests run: 10, Failures: 0, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 17.315s
[INFO] Finished at: Sat Mar 30 12:11:04 UTC 2013
[INFO] Final Memory: 9M/24M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.3:test (default-test) on project pms: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.12.3:test failed: The forked VM terminated without saying properly goodbye. VM crash or System.exit called ? -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.3:test (default-test) on project pms: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.12.3:test failed: The forked VM terminated without saying properly goodbye. VM crash or System.exit called ?
   at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)
   at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
   at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
   at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
   at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
   at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
   at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
   at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
   at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
   at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
   at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
   at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:601)
   at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
   at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
   at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
   at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.12.3:test failed: The forked VM terminated without saying properly goodbye. VM crash or System.exit called ?
   at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:110)
   at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
   ... 19 more
Caused by: java.lang.RuntimeException: The forked VM terminated without saying properly goodbye. VM crash or System.exit called ?
   at org.apache.maven.plugin.surefire.booterclient.output.ForkClient.close(ForkClient.java:257)
   at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:301)
   at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:116)
   at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:740)
   at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAllProviders(AbstractSurefireMojo.java:682)
   at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:648)
   at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:586)
   at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
   ... 20 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException


I googled the error message "forked VM terminated without saying properly goodbye", and there were a couple of results pertaining to the maven-surefire-plugin version. I tried updating the version number in POM.xml to 2.14, but this didn't change anything.

At first, I suspected that it was because I am using OpenJDK instead of Oracle, but I read on another thread that happy.neko himself is also using OpenJDK.
My next thought was Maven, because I installed Maven3 from some other PPA? Though I don't know any other way to get maven3. :P Really stuck here.

If anyone can help me out with this issue, I would be very grateful. Thanks!
jupo
 
Posts: 12
Joined: Sat Mar 30, 2013 12:39 pm

Re: maven-surefire-plugin error during build

Postby Raptor399 » Sat Mar 30, 2013 6:43 pm

The tests are not necessary to build PMS, they are merely early warning signals for developers.
You can try to skip the tests.
Raptor399
Project Member
 
Posts: 1916
Joined: Thu Mar 10, 2011 12:06 am

Re: maven-surefire-plugin error during build

Postby jupo » Sun Mar 31, 2013 12:59 pm

Hi Raptor,

Thanks for the reply. I messed up my java installation by trying to get Oracle java 7 JDK... tried a lot of things to revert back to OpenJDK, but failed so I flashed my SD card back to default xD.

Anyways, when I get things back in order I'll try to package without tests, (mvn3 package -DskipTests=true), and report back. I believe I tried skipping tests once before I posted my first question and it failed, but I don't remember the error message.

Ill be back!
jupo
 
Posts: 12
Joined: Sat Mar 30, 2013 12:39 pm

Re: maven-surefire-plugin error during build

Postby jupo » Sun Mar 31, 2013 4:22 pm

Raptor399 wrote:The tests are not necessary to build PMS, they are merely early warning signals for developers.
You can try to skip the tests.


Thanks raptor! I got PMS to build successfully by skipping the tests as you suggested.

I ran into another problem though (not sure if I should start another thread for this).
I extracted the built binaries from its tarball, and tried running PMS by doing:
Code: Select all
./PMS.sh


This opened up the application (I was overjoyed), but then gave me this Java I/O permission error:
Code: Select all
Configuration error: java.lang.Error: Failed to create temporary file for jnidispatch library: java.io.IOException: Permission denied


I read around the forum and found out I should give myself permissions to /tmp/ps3mediaserver and /tmp/jna.

This resolves the permission error, now the application terminates right around the same time the error would appear.
There are no error messages or notifications. It just disappears.

Here is my debug.log if it helps:
http://pastebin.com/P2CWv054

Could this have something to do with the 'Profile permissions: no such file'?
Am I just running the application incorrectly? Maybe I'm supposed to install PMS before running it?
Last edited by jupo on Sun Mar 31, 2013 5:32 pm, edited 1 time in total.
jupo
 
Posts: 12
Joined: Sat Mar 30, 2013 12:39 pm

Re: maven-surefire-plugin error during build

Postby jupo » Sun Mar 31, 2013 5:31 pm

Hi,

To provide more info, I changed the ROOT LEVEL to trace to get a more detailed debug.log.
I also noticed that ~/.config/PMS directory was empty, so I put a copy of my PMS.conf to that directory.

here is my debug.log:
http://pastebin.com/uc95mcG4

The app is still terminating right around "searching for renderers..." :(
jupo
 
Posts: 12
Joined: Sat Mar 30, 2013 12:39 pm

Re: maven-surefire-plugin error during build

Postby Raptor399 » Sun Mar 31, 2013 10:06 pm

Thanks for the extensive info, interesting.

Because of the lines in the log files, I know the crash must happen here:

Code: Select all
      LOGGER.info("Profile name: " + configuration.getProfileName());
      LOGGER.info("");

      RendererConfiguration.loadRendererConfigurations(configuration);

      LOGGER.info("Checking MPlayer font cache. It can take a minute or so.");

The log shows the first two lines but not the last one, so a crash must occur in loadRendererConfigurations().
Unfortunately, that method looks fairly safe and I don't quite understand what would go wrong.

I have committed something to hopefully catch the error.
Can you try if the latest PMS snapshot shows more information in the log file?
Raptor399
Project Member
 
Posts: 1916
Joined: Thu Mar 10, 2011 12:06 am

Re: maven-surefire-plugin error during build

Postby Raptor399 » Sun Mar 31, 2013 10:21 pm

Never mind, I reverted the commit. It looks like all errors were already being caught in a parent method.
This makes the crash all the more peculiar... :?:
Raptor399
Project Member
 
Posts: 1916
Joined: Thu Mar 10, 2011 12:06 am

Re: maven-surefire-plugin error during build

Postby jupo » Mon Apr 01, 2013 11:46 am

I see. This is unfortunate. By the way, thanks for taking your time to help :)

Can you point me to where I can find the JVM error log when I run with the PMS.sh script? Maybe it can give us some more info.
I could also try setting up the development environment to use Eclipse's debugger.. is it possible to run it through eclipse and put a breakpoint there?
jupo
 
Posts: 12
Joined: Sat Mar 30, 2013 12:39 pm

Re: maven-surefire-plugin error during build

Postby jupo » Mon Apr 01, 2013 5:15 pm

So I did a bit more digging, and instead of setting up the dev environment I just decided to add a bunch of LOGGER.infos all over the place to see where it stops.

I followed it all the way to the constructor of RendererConfiguration, specifically the line:
Code: Select all
mimes = new HashMap<String, String>();


The logs go up until that line then stop as you can see here: http://pastebin.com/SSpYNeKQ

In case you can't follow my logs, heres how RenererConfiguration.java looks: http://pastebin.com/TrpyPk65

:/ not sure why it would crash at creating a generic HashMap... havent done much Java development, but could it be because mimes is defined as:
Code: Select all
private final Map<String, String> mimes;

and we're assigning a HashMap<String, String>?

probably not...
jupo
 
Posts: 12
Joined: Sat Mar 30, 2013 12:39 pm

Re: maven-surefire-plugin error during build

Postby Raptor399 » Mon Apr 01, 2013 7:07 pm

Ah, ye olde LOGGER statements! ;-)
Well, that works too.

However, the statement where the output stops is okay in Java: HashMap implements the Map interface and the assignment to the final variable happens in a constructor. All by the book, I would say.

Does output always stop at exactly that line?

What happens when - for the fun of it - you outcomment the loadRendererConfigurations line in PMS.java, like so:

Code: Select all
      LOGGER.info("Profile name: " + configuration.getProfileName());
      LOGGER.info("");

      // XXX Outcommented just to see what happens...
      // RendererConfiguration.loadRendererConfigurations(configuration);

      LOGGER.info("Checking MPlayer font cache. It can take a minute or so.");
Raptor399
Project Member
 
Posts: 1916
Joined: Thu Mar 10, 2011 12:06 am

Next

Return to Linux/Unix Support

Who is online

Users browsing this forum: No registered users and 9 guests