I am learning COMPSs. Until now, everything has been working really well, but I only executed the examples given in the manual.
Now that I want to run my own test application, I can't get it to work. I must be missing something, but I can't see what I am doing wrong.
My application is called App, and has the main class App, and the interface in another class called AppItf. When I try to run it using runcompss:
runcompss -d --classpath=$PWD/App.jar App
I get the following message:
Using default location for project file:
/opt/COMPSs/Runtime/scripts/user/../../configuration/xml/projects/project.xml
Using default location for resources file:
/opt/COMPSs/Runtime/scripts/user/../../configuration/xml/resources/resources.xml
----------------- Executing App --------------------------
[Loader] - There was an error when loading or executing your
application. java.lang.reflect.InvocationTargetException
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:606)
at integratedtoolkit.loader.ITAppLoader.load(ITAppLoader.java:54)
at integratedtoolkit.loader.ITAppLoader.main(ITAppLoader.java:84) Caused
by: java.lang.ClassNotFoundException: AppItf
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at integratedtoolkit.loader.CustomLoader.loadClass(CustomLoader.java:56)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:195)
at integratedtoolkit.loader.total.ITAppModifier.modify(ITAppModifier.java:46)
... 6 more
Error running application
Can somebody help me find what I am doing wrong?
Thank you in advance!
In the runcompss command you have to specify the fully qualified domain name of the class. So, if this class has a package you have to add the package to the class name. It is currently missing.
Related
I am trying to run the sample JavaStatefulNetworkWordCount Algorithm provided by Apache Spark examples but am experiencing a problem when I try to run the program using spark submit, I get the following exception:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/spark/streaming/StateSpec
at JavaStatefulNetworkWordCount.main(JavaStatefulNetworkWordCount.java:109)
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:606)
at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:674)
at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:180)
at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:205)
at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:120)
at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
Caused by: java.lang.ClassNotFoundException: org.apache.spark.streaming.StateSpec
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
I have imported the StateSpec classes and the code is the same as the one provided over here: https://github.com/apache/spark/blob/master/examples/src/main/java/org/apache/spark/examples/streaming/JavaStatefulNetworkWordCount.java
I would appreciate any help in understanding why this problem arises and how I can fix it.
You should probably add the actual submit command as well.
I highly suspect that you are either missing the --class parameter at all when submitting the spark jar or you did not use the correct qualified class name in it.
I tried using the following command:
spark-submit --class JavaStatefulNetworkWordCount --master local[2] target/SparkStreaming.jar localhost 2222
I want to test some regular classes and methods that have nothing to do with Android, with JUnit in Android Studio 1.1.0
In the test package I have the following class:
public class ParametrizedStaticMapsRequestTest extends TestCase {
#SmallTest
public void testBuildingStaticMapsRequestURL() {
System.out.println("asd");
}
}
But when I try to run it, I get the following error:
Exception in thread "main" java.lang.NoClassDefFoundError: junit/textui/ResultPrinter
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:191)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:116)
Caused by: java.lang.ClassNotFoundException: junit.textui.ResultPrinter
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 3 more
I read on the internet that this happens because Im trying to run it as an Android Test. I want to run it as a plain old JUnit test, like I was able to do in Eclipse. What do I do?
Here's one way to do it using an official but experimental functionality: link
I have a problem with Java libraries. I'm using javax.mail and mysql-connector.
While compiling I don't have any problems, but if I try to execute the program with sudo:
$sudo java Server -jar mysql-connector-java-5.1.28.jar
It gives me this error:
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:259)
at dbConnect.dbQuery(dbConnect.java:192)
at Server.main(Server.java:39)
while if I try to execute it without sudo:
$java Server -jar mysql-connector-java-5.1.28.jar
It gives me this error:
Exception in thread "main" java.lang.NoClassDefFoundError: javax/mail/internet/AddressException
at dbConnect.registration(dbConnect.java:161)
at dbConnect.splitUsrPass(dbConnect.java:87)
at dbConnect.dbQuery(dbConnect.java:196)
at Server.main(Server.java:39)
Caused by: java.lang.ClassNotFoundException: javax.mail.internet.AddressException
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 4 more
I can understand why it doesn't work without administrator privileges (I guess the mail library requires them) but it seems strange to me that it won't find the MySQL library if I give it the administrator privileges.
Does anyone know if this is a known issue?
When you want to run something with Java on the command line, you have two options:
Run a class: java MyClass
Run a jar: java -jar MyJar.jar
What you are trying to do is both, which will result in the -jar-part will be ignored.
I'm guessing that what you want to do is run the class Server, with the MySQL-jar on the classpath. The correct command will then be:
java Server -cp mysql-connector-java-5.1.28.jar
You could also add the directory containing the MySQL-jar to the CLASSPATH environment variable. The reason you get different error messages when using sudo and not is probably because the root user has a different CLASSPATH than your user (your user lacks the javax.mail-jar on the classpath, while root has it.)
I've been trying to run Mahout on a amazon ec2 instance. I keep getting an error when the script executes.
my config script is like this
CLASSPATH=recommender/recommender.jar:async/async-command.jar:async/lib/:./.m2/repository/org/apache/mahout/mahout-core/0.6/
java.lang.NoClassDefFoundError: org/apache/mahout/cf/taste/impl/model/jdbc/ConnectionPoolDataSource
at org.drupal.project.recommender.RunRecommender$AlgorithmImpl.initDataModel(RunRecommender.java:671)
at org.drupal.project.recommender.RunRecommender$AlgorithmImpl.run(RunRecommender.java:954)
at org.drupal.project.recommender.RunRecommender.run(RunRecommender.java:435)
at org.drupal.project.async_command.Druplet.runSerial(Druplet.java:379)
at org.drupal.project.async_command.Druplet.run(Druplet.java:284)
at org.drupal.project.async_command.CommandLineLauncher.handleExecutables(CommandLineLauncher.java:107)
at org.drupal.project.async_command.CommandLineLauncher.launch(CommandLineLauncher.java:66)
at org.drupal.project.recommender.RecommenderApp.main(RecommenderApp.java:37)
Caused by: java.lang.ClassNotFoundException: org.apache.mahout.cf.taste.impl.model.jdbc.ConnectionPoolDataSource
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
I understand that this means that some class was not found, I have no idea how to fix it
On you amazon box you need to ensure that this path :./.m2/repository/org/apache/mahout/mahout-core/0.6/
exists and unless you are reading class files from this directory, then you modify this line to include that jar file name
e.g.
:./.m2/repository/org/apache/mahout/mahout-core/0.6/mahout_core.0.6.jar
I am using the Restlet framework.
I am trying to run my project from a jar file created using Eclipse, by doing: Export->Runnable JAR File, and selecting the option Package required libraries into generated jar.
However, when I try to execute the jar file in the command line, by typing:
java -Djava.security.policy=Client.Policy -jar identiscopeRunnable.jar
I get the following:
Exception in thread "main" java.lang.reflect.InvocationTargetException
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.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: java.lang.NoClassDefFoundError: org/restlet/service/TunnelService
at rest.IdentiscopeServer.main(IdentiscopeServer.java:24)
... 5 more
Caused by: java.lang.ClassNotFoundException: org.restlet.service.TunnelService
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
... 6 more
I have added all the jar files downloaded from the Restlet Framework to my project, so I presume it is not a problem with them. Does anyone have any clue about this?
Just in case anyone asks, the line 24 of IdentiscopeServer.java is:
IdentiscopeServerApplication identiscopeServerApp = new IdentiscopeServerApplication();
The class IdentiscopeServerApplication basically does this:
#Override
public Restlet createInboundRoot() {
Router router = new Router(getContext());
//attaches the /tweet path to the TweetRest class
router.attach("/collectionPublic", CollectionPublicREST.class);
router.attach("/collectionPrivate", CollectionPrivateREST.class);
router.attach("/analysis", AnalysisREST.class);
return router;
}
Adding the jars to your eclipse project will not add the jars to your command line classpath.
java -cp <add your jars here separated by ';'(win) or ':'(linux) > -Djava.security.policy=Client.Policy -jar identiscopeRunnable.jar
See if this helps.