After loading mod_java.so, I am getting exception as class not found in org.freeswitch.Launcher
Getting the below exception on freeswitch console..I have set the librarypath, classpath and some necessary arguments in java.conf.xml.
Exception in thread "Thread-7" java.lang.ClassNotFoundException: org/freeswitch/Launcher.class
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at org.freeswitch.Launcher.launch(Launcher.java:65)
Main thing I am using JavaSession class of swig package to do dtmf recognition..
Please anyone tell me the solution.
In you java.conf.xml remove or comment out any startup or shutdown class.
Shutdown any running instance of freeswitch and run it again. Mod_java will load perfectly this time.
Related
I am trying to run RestClient .From this code I deleted all Loggers related code.But I kept classpath for log4j same. Then run the application ,it gives following two exceptions
java.lang.NoClassDefFoundError: org/apache/log4j/Level
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Level
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Level
Please give reason for those exceptions.
Other jars that you use most likely will use log4j. Also, make sure you remove imports of log4j, not just the code that uses it.
I am running a test case using java & fitnesse...
while Clicking on the "Test" button from below image,
It showing error as follows:
Standard Error:
Exception in thread "main" java.lang.NoClassDefFoundError: ":build/classes://////var/www/git/vodaware/java/Build:/root/leadout-tests///////var/www/git/vodaware/java/supportLibs/mockito-all-1/9/5/jar:/root/leadout-tests///////var/www/git/vodaware/java/supportLibs/jsp-api/jar:/root/leadout-tests///////var/www/git/vodaware/java/supportLibs/testng-6/8/7/jar:/root/leadout-tests///////var/www/git/vodaware/java/supportLibs/servlet-api/jar:/root/leadout-tests///////var/www/git/vodaware/java/supportLibs/jcip-annotations-1/0/jar
Caused by: java.lang.ClassNotFoundException: ":build.classes:......var.www.git.vodaware.java.Build:.root.leadout-tests.......var.www.git.vodaware.java.supportLibs.mockito-all-1.9.5.jar:.root.leadout-tests.......var.www.git.vodaware.java.supportLibs.jsp-api.jar:.root.leadout-tests.......var.www.git.vodaware.java.supportLibs.testng-6.8.7.jar:.root.leadout-tests.......var.www.git.vodaware.java.supportLibs.servlet-api.jar:.root.leadout-tests.......var.www.git.vodaware.java.supportLibs.jcip-annotations-1.0.jar
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
Could not find the main class: ":build/classes:../../var/www/git/vodaware.java/Build:/root/leadout-tests/../../var/www/git/vodaware.java/supportLibs/mockito-all-1.9.5.jar:/root/leadout-tests/../../var/www/git/vodaware.java/supportLibs/jsp-api.jar:/root/leadout-tests/../../var/www/git/vodaware.java/supportLibs/testng-6.8.7.jar:/root/leadout-tests/../../var/www/git/vodaware.java/supportLibs/servlet-api.jar:/root/leadout-tests/../../var/www/git/vodaware.java/supportLibs/jcip-annotations-1.0.jar. Program will exit.
What is the cause of this logs? Please anyone help me.
As the error says, the program is not able to find the java class. You need to make sure the
class path is set properly and also make sure the package location is set properly.
Ex:
classpath: foo/bar/
package: jane/doe.class
See to it that you mention the package hierarchy properly while setting it in the fitnesse column.
Hope this helps.
My web app runs tomcat 7, myfaces, primefaces.
I have a problem on my production m/c that I am not able to replicate on development environment even though the exact code and libraries are loaded on both the machines. The only difference is the tomcat subversion, dev has tomcat7.0.35 and prod has tomcat7.0.40
javax.servlet.ServletException: javax.el.ELException: java.lang.NoClassDefFoundError: Could not initialize class com.myapps.util.UIStringUtil
javax.faces.webapp.FacesServlet.service(FacesServlet.java:229)
com.myapps.util.LoginFilter.doFilter(LoginFilter.java:56) **root cause** java.lang.NoClassDefFoundError: Could not initialize class com.myapps.util.UIStringUtil
com.myapps.bean.UserAuthBean.login(UserAuthBean.java:106)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.apache.el.parser.AstValue.invoke(AstValue.java:278)
org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:274)
org.apache.myfaces.view.facelets.el.ContextAwareTagMethodExpression.invoke(ContextAwareTagMethodExpression.java:96)
org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:68)
javax.faces.component.UICommand.broadcast(UICommand.java:120)
javax.faces.component.UIViewRoot._broadcastAll(UIViewRoot.java:1028)
javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:286)
javax.faces.component.UIViewRoot._process(UIViewRoot.java:1375)
javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:38)
org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:170)
org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
com.myapps.util.LoginFilter.doFilter(LoginFilter.java:56)
I am not sure why this is happening. I am curious why this is being thrown as a javax.el.Elexception, where was this is being thrown from with in java bean code. The exact line of code where this is happening is (UserAuthBean.java:106)
context.addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO,
UIStringUtil.getUIString("msgKey"),
UIStringUtil.getUIString("msgKey")));
UIStringUtil class has static variables and methods that help read data from resource bundles.
As I mentioned earlier, this is only happening on the production box and we are not able to reproduce it on the development box.
Please provide some help here.
It's thrown as an ELException because it happened during executing some EL expression.
You should be looking at the root cause of the exception to learn about the root cause of the exception. Look further down in the stack trace to find the root cause. The first is already present in the incomplete stacktrace you posted:
java.lang.NoClassDefFoundError: Could not initialize class com.myapps.util.UIStringUtil
This basically means that loading of the class as done by Java under the covers as follows
Class.forName("com.myapps.util.UIStringUtil");
has failed with an exception. If you're absolutely positive that the class is present in the runtime classpath, then that can only mean that any of the static variables or initializer blocks of the class has thrown an exception. Loading a class namely initializes all static variables and executes all static initilaizer blocks (haven't you ever wondered how those JDBC drivers work?).
That exception should in turn be visible as the bottommost root cause in the stack trace, after the java.lang.NoClassDefFoundError cause. Perhaps a rather self-explaining java.lang.NullPointerException?
I'm new to java, I'm trying to build a JavaFX Application on eclipse using e(fx)clipse by following a tutorial and did exactly the same, the application is very simple, when I try to compile it I get bunch of errors which I don't even understand :
Exception in Application start method
Exception in thread "main" java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:403)
at com.sun.javafx.application.LauncherImpl.access$000(LauncherImpl.java:47)
at com.sun.javafx.application.LauncherImpl$1.run(LauncherImpl.java:115)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.IllegalStateException: Location is not set.
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2021)
at ch.makery.address.controler.MainApp.start(MainApp.java:29)
at com.sun.javafx.application.LauncherImpl$5.run(LauncherImpl.java:319)
at com.sun.javafx.application.PlatformImpl$5.run(PlatformImpl.java:206)
at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:173)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:29)
at com.sun.glass.ui.win.WinApplication$2$1.run(WinApplication.java:67)
... 1 more
please can you tell me what I'm missing.
You have to set the location of the FXML file in your loader, be sure that you are providing the correct PATH to your FXML file.
PS: Netbeans is the best choice for a JavaFX beginner, start Here.
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.