I've been trying to send information from Java to Java script using the JSObject but i keep receiving a java.lang.ClassNotFoundException: com.sun.deploy.appcontext.AppContext exception i'm using netbeans 7.1.
Here is the full stack trace
java.lang.NoClassDefFoundError: com/sun/deploy/appcontext/AppContext
at MapTest.MapApplet.init(MapApplet.java:23)
at sun.applet.AppletPanel.run(AppletPanel.java:434)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.ClassNotFoundException: com.sun.deploy.appcontext.AppContext
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 sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
... 3 more
It is referring to this line of code
win = JSObject.getWindow(this);
These are all my imports
import netscape.javascript.JSObject;
import java.lang.*;
import java.applet.*;
import java.awt.Graphics;
I really need help with this can't seem to find solutions anywhere.
Thanks.
I came across a similar error and was able to solve it by adding deploy.jar found in the local Java install to the project build path. Not sure how to do this in netbeans but for others using maven you can try adding the folowing dependency:
<dependency>
<groupId>sun</groupId>
<artifactId>deploy</artifactId>
<version>7.0</version>
<scope>system</scope>
<systemPath>${java.home}/lib/deploy.jar</systemPath>
</dependency>
Related
There is my following problem :
java.lang.ClassNotFoundException: javax.vecmath.Point3f
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 org.netbeans.ProxyClassLoader.loadClass(ProxyClassLoader.java:244)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
Caused: java.lang.NoClassDefFoundError: javax/vecmath/Point3f
I don't really understand why it can't find this class. I have the latest version of Java 1.7. Any ideas ?
Best regards.
If you are using Maven, try to add this dependency please :
<dependency>
<groupId>java3d</groupId>
<artifactId>vecmath</artifactId>
<version>1.3.1</version>
</dependency>
Otherwise, download the latest java3d library : https://java3d.java.net/binary-builds.html
After imported, update your imports in your Java class and it should be fine to compile.
Point3f is part of the Java3D API, which is a separate download. Read more here.
Cheers,
I am trying to create a play framework project in intellij idea .But when i am trying to run or debug my project it shows the below error in my console.
java.lang.NoClassDefFoundError: org/jboss/netty/channel/ChannelFactory
at play.api.test.TestServer.start(Selenium.scala:142)
at play.api.test.PlayRunners$class.running(Helpers.scala:59)
at play.api.test.Helpers$.running(Helpers.scala:364)
at play.api.test.WithBrowser.around(Specs.scala:57)
at org.specs2.mutable.Around$class.delayedInit(Around.scala:12)
at play.api.test.WithBrowser.delayedInit(Specs.scala:45)
at IntegrationSpec$$anonfun$1$$anonfun$apply$1$$anon$1.<init>(IntegrationSpec.scala:17)
at IntegrationSpec$$anonfun$1$$anonfun$apply$1.apply(IntegrationSpec.scala:17)
at IntegrationSpec$$anonfun$1$$anonfun$apply$1.apply(IntegrationSpec.scala:17)
at org.specs2.specification.FragmentsBuilder$$anon$1.asResult(FragmentsBuilder.scala:142)
at org.specs2.specification.FragmentsBuilder$$anon$1.asResult(FragmentsBuilder.scala:141)
at org.specs2.execute.AsResult$.apply(Result.scala:250)
at org.specs2.specification.Example$$anonfun$apply$1.apply(Fragment.scala:209)
at org.specs2.specification.Example$$anonfun$apply$1.apply(Fragment.scala:209)
at org.specs2.specification.Example.execute(Fragment.scala:176)
at org.specs2.specification.FragmentExecution$$anonfun$1.apply(FragmentExecution.scala:52)
at org.specs2.specification.FragmentExecution$$anonfun$1.apply(FragmentExecution.scala:52)
at org.specs2.execute.ResultExecution$class.execute(ResultExecution.scala:22)
at org.specs2.execute.ResultExecution$.execute(ResultExecution.scala:116)
at org.specs2.specification.FragmentExecution$class.executeBody(FragmentExecution.scala:28)
at org.specs2.runner.JUnitRunner$$anon$3.executeBody(JUnitRunner.scala:43)
at org.specs2.specification.FragmentExecution$class.execute(FragmentExecution.scala:52)
at org.specs2.runner.JUnitRunner$$anon$3.execute(JUnitRunner.scala:43)
at org.specs2.specification.FragmentExecution$$anonfun$executeFragment$1$$anonfun$apply$1.apply(FragmentExecution.scala:35)
at org.specs2.specification.FragmentExecution$$anonfun$executeFragment$1$$anonfun$apply$1.apply(FragmentExecution.scala:35)
at org.specs2.control.Exceptions$class.catchAllOr(Exceptions.scala:54)
at org.specs2.control.Exceptions$.catchAllOr(Exceptions.scala:109)
at org.specs2.specification.FragmentExecution$$anonfun$executeFragment$1.apply(FragmentExecution.scala:35)
at org.specs2.specification.FragmentExecution$$anonfun$executeFragment$1.apply(FragmentExecution.scala:35)
at org.specs2.reporter.JUnitReporter$$anonfun$executeFragment$1.execute$1(JUnitReporter.scala:47)
at org.specs2.reporter.JUnitReporter$$anonfun$executeFragment$1.apply(JUnitReporter.scala:54)
at org.specs2.reporter.JUnitReporter$$anonfun$executeFragment$1.apply(JUnitReporter.scala:46)
at org.specs2.reporter.DefaultExecutionStrategy$class.executeWithBarrier$1(ExecutionStrategy.scala:103)
at org.specs2.reporter.DefaultExecutionStrategy$$anonfun$executeConcurrently$1$$anonfun$apply$2.apply(ExecutionStrategy.scala:105)
at org.specs2.reporter.DefaultExecutionStrategy$$anonfun$executeConcurrently$1$$anonfun$apply$2.apply(ExecutionStrategy.scala:105)
at scalaz.concurrent.Promise$Unfulfilled$.fulfill(Promise.scala:125)
at scalaz.concurrent.Promise$Done.eval(Promise.scala:153)
at scalaz.concurrent.Promise$$anonfun$e$1.apply(Promise.scala:17)
at scalaz.concurrent.Promise$$anonfun$e$1.apply(Promise.scala:17)
at scalaz.concurrent.Actor.batchHandle(Actor.scala:73)
at scalaz.concurrent.Actor.scalaz$concurrent$Actor$$act(Actor.scala:57)
at scalaz.concurrent.Actor$$anonfun$schedule$1.apply$mcV$sp(Actor.scala:52)
at scalaz.concurrent.Actor$$anonfun$schedule$1.apply(Actor.scala:52)
at scalaz.concurrent.Actor$$anonfun$schedule$1.apply(Actor.scala:52)
at scalaz.concurrent.StrategysLow$$anon$3$$anon$4.call(Strategy.scala:65)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.ClassNotFoundException: org.jboss.netty.channel.ChannelFactory
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 sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
... 50 more
java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/jboss/netty/channel/ChannelFactory
at play.api.test.TestServer.start(Selenium.scala:146)
at play.api.test.PlayRunners$class.running(Helpers.scala:59)
at play.api.test.Helpers$.running(Helpers.scala:364)
at play.api.test.WithBrowser.around(Specs.scala:57)
at play.api.test.WithBrowser.delayedInit(Specs.scala:45)
at IntegrationSpec$$anonfun$1$$anonfun$apply$1$$anon$1.<init>(IntegrationSpec.scala:17)
at IntegrationSpec$$anonfun$1$$anonfun$apply$1.apply(IntegrationSpec.scala:17)
at IntegrationSpec$$anonfun$1$$anonfun$apply$1.apply(IntegrationSpec.scala:17)
Caused by: java.lang.NoClassDefFoundError: org/jboss/netty/channel/ChannelFactory
at play.api.test.TestServer.start(Selenium.scala:142)
... 7 more
Caused by: java.lang.ClassNotFoundException: org.jboss.netty.channel.ChannelFactory
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
... 8 more
Disconnected from the target VM, address: '127.0.0.1:1698', transport: 'socket'
Process finished with exit code -1
I have play plugins installed in intellij and created my project from File -> New Project -> scala ->Play2.x
Why my play project is not able to run?
Thanks
First of all , check that your class name and file name is same, if it is true.
Then , check that your class path is specified properly and after the declaration of the class path you have not edited the folders name which are there in the class path or have changed there location .
I've made JAR file from a project I made, however when I try to execute it, it gives:
Exception in thread "main" java.lang.NoClassDefFoundError: org/jboss/netty/channel/socket/ServerSocketChannelFactory
at org.ddosdefense.httpfilter.HTTPInterceptor.main(HTTPInterceptor.java:66)
Caused by: java.lang.ClassNotFoundException: org.jboss.netty.channel.socket.ServerSocketChannelFactory
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)
... 1 more
Inside the jar file all the libraries are present.
In the .classpath file the netty jar library is present:
<classpathentry kind="lib" path="ddos2_lib/netty-3.6.2.Final.jar"/>
When I execute the project in eclipse it works perfectly. Anyone has an idea how to solve this problem?
Thanks in advance!
Most likely you don't have the jar packaged into the jar you produce or missed to specify the netty jar via the -cp option.
I'm looking for an updated answer to this question. Previously, a minimal Neo4j "Hello World" app required two jars. Now it apparently requires some other jars, but I don't know which ones.
If I include neo4j-kernel-2.1.2 and geronimo-jta_1.1_spec-1.1.1 as suggested in that other question, I get this error:
java.lang.ClassNotFoundException: org.neo4j.collection.primitive.PrimitiveLongIterator
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)
If I add neo4j-primitive-collections-2.1.2, I then get an error with this root cause:
Caused by: java.lang.IllegalArgumentException: No schema index provider org.neo4j.kernel.api.index.SchemaIndexProvider found.
Answers on this question suggest I need neo4j-lucene-index. When I add that jar, I get this error:
Caused by: java.lang.ClassNotFoundException: org.apache.lucene.store.Directory
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)
Finally, when I add lucene-core, I get this error:
Caused by: java.lang.ClassNotFoundException: org.apache.lucene.document.Fieldable
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)
What do I need to add to get past that?
I believe I've found the minimal set of dependencies for Neo4j 2.x. I was originally trying to use lucene-core-4.9.0, but the org.apache.lucene.document.Fieldable interface was removed from that library sometime after version 3.6.2. The minimal set of jars is thus:
neo4j-kernel (2.1.2)
neo4j-primitive-collections (2.1.2)
neo4j-lucene-index (2.1.2)
lucene-core (3.6.2)
jta (1.1)
These weigh in at about 4.5 MB, which is larger than I'd like, but I guess I can live with it. I've also been told that neo4j-lucene-index (which is what requires lucene-core) is not strictly required. Like jta, it's actually only one possible implementation of a required interface. But I don't know of any other implementation.
As the other answer correctly mention the most easy way is use a build tool featuring a dependency manager. Most widely these days used are Maven and Gradle. Both use Maven Central repository by default to pull dependencies and transitive dependencies.
Depending whether your embedded application uses cypher or not you should add the following dependencies your pom.xml:
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-lucene-index</artifactId>
<version>2.1.2</version>
</dependency>
or (when cypher is used):
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-cypher</artifactId>
<version>2.1.2</version>
</dependency>
Both of them transitively include all necessary libraries.
I know there have been many posts regarding this exception, but I am not able to fix this issue. Classpath has to be edited I think to resolve it.
I am trying to run a program called DistMap in hadoop infrastructure. This is the error I am getting.
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.util.PlatformName
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: org.apache.hadoop.util.PlatformName. Program will exit.
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/fs/FsShell
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.fs.FsShell
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: org.apache.hadoop.fs.FsShell. Program will exit.
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/util/PlatformName
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.util.PlatformName
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: org.apache.hadoop.util.PlatformName. Program will exit.
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/fs/FsShell
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.fs.FsShell
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: org.apache.hadoop.fs.FsShell. Program will exit.
Error could not create input directory /distmap_output_input folder on hdfs file system
which java says
/usr/java/jdk1.6.0_32/bin/java
echo $CLASSPATH gives a blank line
cat ~/.bash_profile says
cat ~/.bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
Update:
$HADOOP_HOME /usr/lib/hadoop
$HADOOP_CLASSPATH
/usr/lib/hadoop-0.20-mapreduce/hadoop-ant-2.0.0-mr1-cdh4.4.0.jar:/usr/lib/hadoop-0.20-mapreduce/hadoop-ant.jar:/usr/lib/hadoop-0.20-mapreduce/hadoop-examples-2.0.0-mr1-cdh4.4.0.jar:/usr/lib/hadoop-0.20-mapreduce/hadoop-examples.jar:/usr/lib/hadoop-0.20-mapreduce/hadoop-core.jar:/usr/lib/hadoop-0.20-mapreduce/hadoop-core-2.0.0-mr1-cdh4.4.0.jar:/usr/lib/hadoop-0.20-mapreduce/hadoop-test-2.0.0-mr1-cdh4.4.0.jar:/usr/lib/hadoop-0.20-mapreduce/hadoop-test.jar:/usr/lib/hadoop-0.20-mapreduce/hadoop-tools-2.0.0-mr1-cdh4.4.0.jar:/usr/lib/hadoop-0.20-mapreduce/hadoop-tools.jar:/usr/lib/hadoop-0.20-mapreduce/lib/*jar:/usr/lib/hadoop/hadoop-common.jar:/usr/lib/hadoop/hadoop-common-2.0.0-cdh4.4.0.jar
The last 2 jar files have those classes PlatformName and FsShell. Still its not working.
Can anyone please help me fix this issue?
Thanks
hadoop-auth-2.2.0.jar should be there for hadoop2.2.0
Add hadoop auth jar for your version
If you are a maven user and faced this issue -
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-client</artifactId>
<version>${hadoop.client.version}</version>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-common</artifactId>
<version>${hadoop.client.version}</version>
</dependency>
NOTE: :hadoop-client:2.5.2 alone didn't bring in all the required hadoop dependencies. That is why I added hadoop-common, which brought all the required deps.
Hadoop HADOOP_CLASSPATH issues
This would be helpful.
Thanks & Regards,
Alok Thaker
In my particular case, I am using Maven, and although I had hadoop-auth in both the POM and the classpath, I was still getting this exception.
What finally fixed it for me was changing the scope for the dependency in the POM from "provided" to "compile".