Problems running local copy of etherpad - java

I get the following message when trying to execute etherpad/bin/run-local.sh:
Exception in thread "main" java.lang.NoClassDefFoundError: net/appjet/oui/main
I created CLASSPATH variable,
export CLASSPATH="/home/user/src/etherpad/trunk/infrastructure/build"
but that didn't help either. Although I can clearly see net/appjet/oui package in the build directory.

Looks like this has been figured out:
http://groups.google.com/group/etherpad-open-source-discuss/browse_thread/thread/2d877d1b585e159c

Related

Java class not found in Jackson

I'm new to Java and have a program that's throwing the following error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/codehaus/jackson/map/ObjectMapper
at ExtractCustomerIds.main(ExtractCustomerIds.java:21)
Caused by: java.lang.ClassNotFoundException: org.codehaus.jackson.map.ObjectMapper
at jdk.internal.loader.BuiltinClassLoader.loadClass(java.base#9-internal/BuiltinClassLoader.java:366)
at jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(java.base#9-internal/ClassLoaders.java:184)
at java.lang.ClassLoader.loadClass(java.base#9-internal/ClassLoader.java:419)
... 1 more
I know the problem has to be with paths, classpath or jar name, but I can't figure out as of now.
My folder structure is:
.
- get_customer_ids
- ExtractCustomerIds.java
- libs
- jackson-all-1.9.11.jar
So when I'm inside the get_customer_ids I give the following command:
get_customer_ids$ javac -cp ../libs/* ExtractCustomerIds.java and this causes the error above.
I thought I was setting the classpath correctly, but it's still not working. What's missing?
The exception occurs when running your program - you are specifying the classpath while compiling. The classpath set during compilation is not stored inside the compiled class files or the like - you need to correctly specify it when running your program, too!
Like so:
$ java -cp ../libs/* ExtractCustomerIds

noclassdeffound error in java, linux

running a java class by shell script:
java -cp $CLASSPATH CG_GpsRequest "dbname","oracle.jdbc.driver.OracleDriver","abc","abc"
while running the script in unix, getting error,
Exception in thread "main" java.lang.NoClassDefFoundError: CG_GpsRequest
Caused by: java.lang.ClassNotFoundException:
CG_GpsRequest is the class file name.
Okay.. If I understand you correctly..
I think its problem with the Package name specification..
Your calss CG_GpsRequest you must have specified in Packaging way for example
com.xxx.yyy.CG_GpsRequest
So I think JVM is searching your class com.xxx.yyy.CG_GpsRequest in this patter so Please run your script with the following modifications.
java -cp $CLASSPATH com.xxx.yyy.CG_GpsRequest "dbname","oracle.jdbc.driver.OracleDriver","abc","abc"
This is just assumption that you have created your class in Pacakgin hirarechy since you havent specified more information.
Add the folder/path in which your java class exists to your CLASSPATH

Java Execute Jar-File NullPointerException when updateLayoutState

i exported my java programm to an executable JAR-File.
When i now run this JAR-File:
java -jar myFile.jar
this Exception appears:
Exception in thread "main" java.lang.NullPointerException
at javax.swing.JList$4.getSize(Unknown Source)
at javax.swing.plaf.basic.BasicListUI.updateLayoutState(Unknown Source)
at javax.swing.plaf.basic.BasicListUI.maybeUpdateLayoutState(Unknown Source)
at javax.swing.plaf.basic.BasicListUI.getPreferredSize(Unknown Source)
....
Never saw this before and havent found a solution yet.
What is actually happening here and how can i solve this problem?
It doesn't seems to be a packaging related issue. It looks more like there is a JList not properly initialized - e.g. like if you passed null as the array in the constructor. So check your code...
Procedure:
Expand the jar in exactly the same location as the jar as a directory, say, ExpDir.
Run the main class using -cp ExpDir and main class. Use the same current directory, JVM, and everything else.
If the program now works (1% probability, in my experience), comment on this on the question. Also, confirm that you are not inadvertently changing something else.
If it does not (99% probability), correct the programming error and/or ask a different question appropriate to the error.

How to get the buildindex step working in the semanticvectors java package on a mac OS X terminal?

I'm trying to use semantic vectors. Here are some links:
https://code.google.com/p/semanticvectors/wiki/InstallationInstructions
https://code.google.com/p/semanticvectors/
Anyway, I'm on the step where you input java pitt.search.semanticvectors.BuildIndex, but I'm lacking results.
The current part I'm following is "To Build and Search a Model".
I am able to compile the package successfully with the ant command and I did get the first step working with first setting the class path with:
export CLASSPATH=./lib/lucene-core-3.6.2.jar:./…
And then inputing
java org.apache.lucene.demo.IndexFiles -docs .
However with this next step I'm getting these errors:
user:/home/data/SemanticVectors/semant… java pitt.search.semanticvectors.BuildIndex
Exception in thread "main" java.lang.NoClassDefFoundError: pitt/search/semanticvectors/BuildIndex
Caused by: java.lang.ClassNotFoundException: pitt.search.semanticvectors.BuildIndex
at java.net.URLClassLoader$1.run(URLClassLo…
at java.security.AccessController.doPrivile… Method)
at java.net.URLClassLoader.findClass(URLCla…
at java.lang.ClassLoader.loadClass(ClassLoa…
at sun.misc.Launcher$AppClassLoader.loadCla…
at java.lang.ClassLoader.loadClass(ClassLoa…
Could not find the main class: pitt.search.semanticvectors.BuildIndex. Program will exit.
I am using a terminal on a mac OS X
As I see your post, it appears you are not providing a path to the semanticvectors-x.x.jar file as indicated in
export CLASSPATH=./lib/lucene-core-3.6.2.jar:./…
Once this change is done, it should work.

Verify Error Java at Run time

I am getting the following error when running my program. Compilation works just fine! and the program was working a min ago wht the hell is going on?! can you please help
java.lang.VerifyError: (class: FinalTest, method: <init> signature: ()V) Constructor must call super() or this()
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2442)
at java.lang.Class.getMethod0(Class.java:2685)
at java.lang.Class.getMethod(Class.java:1620)
at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:484)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:476)
Exception in thread "main" Java Result: 1
Javadoc says:
Thrown when the "verifier" detects that a class file, though well
formed, contains some sort of internal inconsistency or security
problem.
As you application was running a mintute ago, it should not be a security issue. Cleanup all your .class files, rebuild your application and run it. Also, check your compilation warnings to make sure you don't have conflicting dependencies.
Just copy the whole project .. and run the new one.. It worked for me.

Categories

Resources