java.io.FileNotFoundException: null\\conf\\wrapper

2020-03-27 02:27发布

问题:

I've been using this tutorial http://mpjexpress.blogspot.co.nz/2010/05/executing-and-debugging-mpj-express.html, text: steps 1,2,3 and video: steps between 0:00 to 3:29

Referenced files


(source: iforce.co.nz)

Sample Code (Copy paste from the tutorial)

import mpi.*;
public class HelloEclipseWorld {
vpublic static void main(String[] args) throws Exception {
MPI.Init(args) ;
int rank = MPI.COMM_WORLD.Rank();
int size = MPI.COMM_WORLD.Size();
System.out.println("I am process <"+rank+"> of total <"+
size+"> processes.");
MPI.Finalize();
}
}

And I've included the mpi and mpj jar file from http://en.sourceforge.jp/projects/sfnet_mpjexpress/downloads/releases/mpj-v0_38.zip/ (as per tutorial step)

Then I set the run path configuration (as per tutorial step)

-jar ${MPJ_HOME}/lib/starter.jar

I also tried the same command but with -np 4 appended to the end (as per tutorial step)

-jar ${MPJ_HOME}/lib/starter.jar -np 4

VM arguments


(source: iforce.co.nz)

MPJ_HOME variable


(source: iforce.co.nz)

MPJ Express Output

 MPJ Express (0.38) is started in the multicore configuration
 I am process <3> of total <4> processes
 I am process <3> of total <4> processes
 I am process <3> of total <4> processes
 I am process <3> of total <4> processes

Once I finished setting everything I try to execute it via Eclipse, but I'm getting these errors :(

Compiler Error

java.io.FileNotFoundException: null\conf\wrapper.conf (The system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at runtime.starter.MPJRun.getPortFromWrapper(MPJRun.java:807)
at runtime.starter.MPJRun.<init>(MPJRun.java:68)
at runtime.starter.MPJRun.main(MPJRun.java:964)

Wrapper.conf location


(source: iforce.co.nz)

I'm slightly confused on why I'm getting these errors.. am I meant to do something else ? that the tutorial isn't telling me? in order to get this to work?

what am I doing wrong? how can I fix this JRE error? regarding the file "conf\wrapper.conf" on mpj express? I think I'm missing something but I've read so many resources and followed the tutorial over and over... but I'm still receiving the FileNotFoundException for wrapper.conf.

Some resources I've found (none answer the FileNotFoundException problem).

  • Mpj java docs
  • Mpj windows guide
  • vub mpj

If anyone has any advice on how to fix the FileNotFoundException I'd greatly appreciate it thanks!

回答1:

In the preferences menu go to run/debug --> String Substitution. Put your variable there. You are not dealing with an environment variable in this context. Environment variables will appear in totally platform specific way on windows you'll see %MJP_HOME% and on *nix it will look like $MJP_HOME in this case you are use Eclipse's string substitution mechanism

you can read about it here



回答2:

Addressing the MPJ error

Error: Could not find or load main class runtime.starter.MulticoreStarter

To get it working.. go to Run Config -> Class Path, and under "Bootstrap" click "Add External JARS" and just include everything from /lib/ folder from mpj and that will make the mpj run, but I'm unsure on how you can address the compiler issues.



回答3:

Addressing Compiler

java.io.FileNotFoundException: null\conf\wrapper.conf (The system cannot find the path specified) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.(Unknown Source) at java.io.FileInputStream.(Unknown Source) at runtime.starter.MPJRun.getPortFromWrapper(MPJRun.java:807) at runtime.starter.MPJRun.(MPJRun.java:68) at runtime.starter.MPJRun.main(MPJRun.java:964)

My Lecturer told me I was missing the Enviroment Variable "MPJ_HOME", Run Config -> Enviroment Variables -> New "MPJ_HOME" (use the variable created for VM Arguments)