Showing posts with label eclipse. Show all posts
Showing posts with label eclipse. Show all posts

Monday, October 25, 2010

Why can't I view JSPs on my Linux box?

This is a bit insane I must say. I have the following setup: Eclipse Helios, 64-bit JDK (1.6.0_21), Tomcat 6 (6.0.29), and a pretty straightforward JSP that does nothing other than evaluate the date.

I get this crap all the time:

javax.servlet.ServletException: java.lang.NoClassDefFoundError: javax/el/ELResolver
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:268)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
test.test01.MainServlet.goToPage(MainServlet.java:50)
test.test01.MainServlet.doGet(MainServlet.java:36)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)


root cause


java.lang.NoClassDefFoundError: javax/el/ELResolver
java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
java.lang.ClassLoader.defineClass(ClassLoader.java:616)
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
java.net.URLClassLoader.access$000(URLClassLoader.java:58)
java.net.URLClassLoader$1.run(URLClassLoader.java:197)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(URLClassLoader.java:190)
sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229)
java.lang.ClassLoader.loadClass(ClassLoader.java:307)
java.lang.ClassLoader.loadClass(ClassLoader.java:296)
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
java.lang.ClassLoader.loadClass(ClassLoader.java:296)
java.lang.ClassLoader.loadClass(ClassLoader.java:248)
org.apache.jasper.runtime.JspFactoryImpl.getJspApplicationContext(JspFactoryImpl.java:209)
org.apache.jsp.WEB_002dINF.jsp.search_jsp._jspInit(search_jsp.java:22)
org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:52)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:159)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
test.test01.MainServlet.goToPage(MainServlet.java:50)
test.test01.MainServlet.doGet(MainServlet.java:36)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
 I have checked everything I can think of (JAVA_HOME, CATALINA_HOME variables) and all check out okay. The project in eclipse is a dynamic web project and has all the $CATALINA_HOME/lib jar files in it including the el-api.jar file.

So what gives? The real annoying thing about this whole process is that I can export the war file, pop it onto my windows machine and it works just fine! I tried doing the same with Tomcat on Ubuntu and running it from there directly but am no better off. So, anyone know what the heck I am doing wrong?

Tuesday, April 28, 2009

How do I set JAVA_HOME in Ubuntu so it works

I recently installed Ubuntu 9.04. And then I installed eclipse. I am trying to start it from an icon (yes, its via an icon... don't judge!) and am having an issue with setting the JAVA_HOME and PATH variables correctly.

When I kick off from a bash shell, the PATH is correct. But not from the panel in gnome. Of course, in the bash shell, I have both those variables set in ~/.bashrc. However, when I log in via the gdm, that file does not get read. I am trying to figure out what file gets read when I login so I can set the JAVA_HOME variable. I tried adding it to /etc/environment file, but I am at a loss as to how to add $JAVA_HOME/bin to the $PATH variable. For now, I start eclipse via the icon using

/usr/local/eclipse -vm /usr/local/jdk1.6.0_13/bin/java
and that works just fine for me...

Do I need the Java EE editor to work with Tomcat

I am pretty certain that all I have at work is a regular Java IDE and I am able to muck about with Tomcat... mind you, I don't deploy anything onto Tomcat via a 'Server' option. So, how come I can't do that easily with my regular IDE? I tried to install the Java EE development patches via Eclipse and it threw an error at me. I've seen the same requirement for some glassfish tutorials I was following before.

Is it because of that 'Server' feature that I need the EE version of Eclipse? I don't mind installing it, I was just curious. Anyone know?

Sunday, March 30, 2008

I win!

Damn you eclipse, you drove me nuts for a while. DAMN. I spent good chunks of my nights and weekends fighting you. I was about to give up and go back to Windows Vista. Damn. I need to update all my newly found Goran Bregović music anyway. Quite a few people mused about what it could be. They were right, somewhat. So, what was it in the end? Lets see.

I install ubuntu. I have no idea what version... The installer decided to install x86_64. Why? Well, I have a 64-bit compatible chip. Well, when you go to eclipse.org and download eclipse, they figure out somehow that I am running a 64-bit version of the OS and let me download the 64-bit version of eclipse. I didn't notice. I installed eclipse. All is good. Or so I thought. I try and fire it up. Nothing happens except for the error. You would think that something so large would log something somewhere. No such luck. I looked in the obvious place: ~/.eclipse. I ran eclipse -clean. No luck.

I searched google. Ubuntu docs say to use apt-get install eclipse. I tried that. No luck. And it installed all sorts of gcj nonsense that I don't really want. I want Sun JDK. More searching ensued. Hours went by. I watched Borat along the way. Its just as much fun the second time around (I watched it the first time on my second trip to Washington DC). Yet more searching. I checked all sorts of things. I tried to launch it manually. You know with all the 50 arguments it needs to start. Still no luck. And quite frustratingly, no log file that says 'Oh by the way, you need blah' or 'you are missing something X that I need in order to run properly'. Grrrrrr.

I ended up searching for stuff specific to Ubuntu and Eclipse and Linux and somehow I ended up on an eclipse.org page. They mention a log file in there too. I didn't find one anywhere. But it was at that point that I ran a uname -a. I had previously also tried to try and start eclipse using Java 1.5 (release 15) but still no luck. Well, uname -a told me I was running x86_64. I kept going. I downloaded the x64 version of Sun's JDK. Hmmm. I installed it. It wanted to overwrite stuff in the 32-bit JDK folder. I decided to wipe out all the 32-bit JDKs. I installed the 64-bit JDK. I ran ./eclipse once more. Would you believe it, I was asked to pick a workspace!

So much for all that checking. Silly me, I should have checked all that before I went about searching google. One issue I still have though is: if eclipse won't start, how the <deleted expletive> am I supposed to know that it is a 64-bit version of eclipse and requires a 64-bit JVM (or a modified start process with a -d32 flag or something)?

Oh well, so much for all that. I have eclipse running. Let that be a lesson to all of you. 64-bit computing is a pain in the ass.

Thursday, March 27, 2008

Getting Eclipse to work in Linux

Getting Eclipse to start in Linux is a nighmare. You can't just double click on stuff like in Windows. Right now, the error I get when I try and start eclipse, I get the error:


JVM terminated. Exit code=13
/usr/local/jdk1.6.0_05/bin/java
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m
-jar /usr/local/eclipse/plugins/org.eclipse.equinox.launcher_1.0.1.R33x_v20080118.jar
-os linux
-ws gtk
-arch x86_64
-showsplash
-launcher /usr/local/eclipse/eclipse
-name Eclipse
--launcher.library /usr/local/eclipse/plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.0.3.R33x_v20080118/eclipse_1023.so
-startup /usr/local/eclipse/plugins/org.eclipse.equinox.launcher_1.0.1.R33x_v20080118.jar
-exitdata aa8030
-vm /usr/local/jdk1.6.0_05/bin/java
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m
-jar /usr/local/eclipse/plugins/org.eclipse.equinox.launcher_1.0.1.R33x_v20080118.jar
I launched the thing using
/usr/local/eclipse/eclipse -vm /usr/local/jdk1.6.0_05/bin/

Lets see how it goes... I am not giving up yet.

Saturday, March 1, 2008

Questions, questions

I have been trying to do use Eclipse and do some things with it (like use Acceleo) but have had very little luck with it. I have an Eclipse project with nothing in it.

I also have questions on stuff I store in the database and how to get them out of there. I wonder if there is a way to write an object to the database and read it out as is (and also take parts of it out as well); I recall hearing that as a feature in SQL Server 2008.

What options exist for source control? I am wondering if there is some really light-weight source control thing that integrates into Eclipse?

I'll blog more as I can find them, but for now, I have to go do other stuff...