You are not logged in.

#1 2013-11-25 11:34:59

Depado
Member
Registered: 2013-02-28
Posts: 49

Eclipse/Netbeans with Tomcat/GlassFish

Hi.

It has been now a couple of days since I started to search for a solution to my problem. Now I'm pretty sure the internet has no "premade" solution for me, so I come to you and hope for help.

I'm willing (forced) to use Java to create a Dynamic Web Application Project (Which is a project template included in Eclipse JEE). The main issue is : There is no way I can launch a Java Servlet Container like Tomcat or GlassFish. First of all some informations on my system (take my hand and follow me to the magical wonders of a developper's computer... Nah kidding) :

Uname : Linux silence 3.12.0-1-ARCH #1 SMP PREEMPT Wed Nov 6 09:06:27 CET 2013 x86_64 GNU/Linux
Apache : Yes but not enabled at startup (so not active)
No weird service running in the background
Deactivated IpTables (for testing purpose)

Eclipse (from aur : eclipse-jee)
Version: Kepler Service Release 1
Build id: 20130919-0819

NetBeans
Product Version: NetBeans IDE 7.4 (Build 201310111528)
Updates: NetBeans IDE is updated to version NetBeans 7.4 Patch 1

Tomcat v7.0 Server (installed in /usr/share/tomcat7)
GlassFish 4.0

Java: 1.7.0_45; OpenJDK 64-Bit Server VM 24.45-b08
Runtime: OpenJDK Runtime Environment 1.7.0_45-b31
System: Linux version 3.12.0-1-ARCH running on amd64; UTF-8; fr_FR (nb)
User directory: /home/hellsing/.netbeans/7.3
Cache directory: /home/hellsing/.cache/netbeans/7.3

Java
OpenJDK Runtime Environment (IcedTea 2.4.3) (ArchLinux build 7.u45_2.4.3-1-x86_64)
OpenJDK 64-Bit Server VM (build 24.45-b08, mixed mode)

Eclipse w/ Tomcat
First solution I tried was Eclipse with Tomcat. Installed tomcat with pacman/yaourt.
Created the server with the server wizard in Eclipse. I got several errors like "Permission Denied".
Some hours of search laters : chmod 777 -R /usr/share/tomcat7 (and did that in every symbolic linked directory like conf, log, etc)
Yay no more errors of permission. But now :

nov. 25, 2013 12:00:55 PM org.apache.catalina.core.StandardContext startInternal
Grave: Error in resourceStart()
nov. 25, 2013 12:00:55 PM org.apache.catalina.core.StandardContext startInternal
Grave: Error getConfigured
nov. 25, 2013 12:00:55 PM org.apache.catalina.core.StandardContext startInternal
Grave: Erreur de démarrage du contexte [/HelloWorld] suite aux erreurs précédentes
nov. 25, 2013 12:00:55 PM org.apache.coyote.AbstractProtocolHandler start
Infos: Starting ProtocolHandler ["http-bio-8080"]
nov. 25, 2013 12:00:55 PM org.apache.coyote.AbstractProtocolHandler start
Infos: Starting ProtocolHandler ["ajp-bio-8009"]
nov. 25, 2013 12:00:55 PM org.apache.catalina.startup.Catalina start
Infos: Server startup in 3764 ms
nov. 25, 2013 12:00:55 PM org.apache.catalina.core.StandardServer await
Grave: StandardServer.await: create[localhost:8005]: 
java.net.BindException: Ne peut attribuer l'adresse demandée
	at java.net.PlainSocketImpl.socketBind(Native Method)
	at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:376)
	at java.net.ServerSocket.bind(ServerSocket.java:376)
	at java.net.ServerSocket.<init>(ServerSocket.java:237)
	at org.apache.catalina.core.StandardServer.await(StandardServer.java:422)
	at org.apache.catalina.startup.Catalina.await(Catalina.java:707)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:653)
	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.catalina.startup.Bootstrap.start(Bootstrap.java:303)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:431)

nov. 25, 2013 12:00:55 PM org.apache.coyote.AbstractProtocolHandler pause
Infos: Pausing ProtocolHandler ["http-bio-8080"]
nov. 25, 2013 12:00:58 PM org.apache.coyote.AbstractProtocolHandler pause
Infos: Pausing ProtocolHandler ["ajp-bio-8009"]
nov. 25, 2013 12:01:01 PM org.apache.catalina.core.StandardService stopInternal
Infos: Arrêt du service Catalina
nov. 25, 2013 12:01:01 PM org.apache.catalina.util.LifecycleBase stop
Infos: The stop() method was called on component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/HelloWorld]] after stop() had already been called. The second call will be ignored.
nov. 25, 2013 12:01:01 PM org.apache.coyote.AbstractProtocolHandler stop
Infos: Stopping ProtocolHandler ["http-bio-8080"]
nov. 25, 2013 12:01:03 PM org.apache.coyote.AbstractProtocolHandler stop
Infos: Stopping ProtocolHandler ["ajp-bio-8009"]

The error message is in French (it means "java.net.BindException: Can't bind the requested address")
So yeah. I kind of gave up with Eclipse+Tomcat.

NetBeans + Tomcat
Second solution was to do exactly the same with NetBeans (which also has a JEE support).
Bad luck : Same error. But I got some additionnal informations that Eclipse didn't gave me (BAD BAD ECLIPSE !)

nov. 25, 2013 11:57:09 AM org.apache.catalina.core.ApplicationContext log
Infos: SessionListener: contextDestroyed()
nov. 25, 2013 11:57:09 AM org.apache.catalina.core.ApplicationContext log
Infos: ContextListener: contextDestroyed()
nov. 25, 2013 12:22:31 PM org.apache.catalina.core.ApplicationContext log
Infos: ContextListener: contextInitialized()
nov. 25, 2013 12:22:31 PM org.apache.catalina.core.ApplicationContext log
Infos: SessionListener: contextInitialized()
nov. 25, 2013 12:22:31 PM org.apache.catalina.core.ApplicationContext log
Infos: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 'org.apache.jasper.compiler.TldLocationsCache@46bfd6ca')
nov. 25, 2013 12:22:36 PM org.apache.catalina.core.StandardContext listenerStop
Grave: Exception lors de l'envoi de l'évènement contexte détruit (context destroyed) à l'instance de classe d'écoute websocket.drawboard.DrawboardContextListener
java.lang.NoClassDefFoundError: javax/websocket/Endpoint
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2918)
	at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1174)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1669)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1547)
	at websocket.drawboard.DrawboardContextListener.contextDestroyed(DrawboardContextListener.java:32)
	at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4980)
	at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5626)
	at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
	at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1575)
	at org.apache.catalina.core.ContainerBase$StopChild.call(ContainerBase.java:1564)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.ClassNotFoundException: javax.websocket.Endpoint
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1702)
	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1547)
	... 17 more

nov. 25, 2013 12:22:36 PM org.apache.catalina.core.ApplicationContext log
Infos: SessionListener: contextDestroyed()
nov. 25, 2013 12:22:36 PM org.apache.catalina.core.ApplicationContext log
Infos: ContextListener: contextDestroyed()

What ? Is there a missing dependency on my system ? Isn't Tomcat supposed to come and just damn work ?

Messing With Eclipse Settings
BACK TO ECLIPSE (capslock this time because I really don't like Eclipse)
I tried some few other things for Tomcat to work.
1. Installing Tomcat in a custom folder (installing Tomcat through Eclipse directly) : Same error. You mad ?
2. Changing the root and conf files of Tomcat (Because I'm just lost and don't know what I'm doing) : Same error and still no progress.

Back to Netbeans
(Netbeans I choose you !)
Let's just install another Java Servlet Container. What about GlassFish ? Sounds nice. Nice name, nice icon, nice... errors.
I installed it. Right after the declaration of the server, I try to start it.
"Can't start : Admin port is occupied by null"
Well yes. Null is occupying the port. Logical stuff.

Let's see if anything is blocking the port 4848 or 8080 then.
(Don't worry I did that before for tomcat too)

netstat | grep ":8080" → No result
netstat | grep ":4848" → No result

No way there is any kind of application running on that port.

I'm desperate. Does anyone have any kind of clue or maybe just a small hint on what to do ? (No I'm not going to install windows and there is no virus in my bios)

EDIT : I don't know if I posted my problem in the right place. Please move my post if I did not. Thanks.

With ♥, Depado

Last edited by Depado (2013-11-25 11:43:50)

Offline

#2 2013-11-25 14:53:10

mrunion
Member
From: Jonesborough, TN
Registered: 2007-01-26
Posts: 1,938
Website

Re: Eclipse/Netbeans with Tomcat/GlassFish

This will not help you at all unless it gives you inspiration!

I use(d) NetBeans to "play" with a J2EE app. I told it to use GlassFish and it DOWNLOADED Glassfish to my home folder, set it up and RAN it with absolutely no issues.

Maybe one of the intro videos here can help you figure it out? http://www.programming-simplified.com/index.html


Matt

"It is very difficult to educate the educated."

Offline

#3 2013-11-25 15:09:07

Depado
Member
Registered: 2013-02-28
Posts: 49

Re: Eclipse/Netbeans with Tomcat/GlassFish

As I said in the OP, I already tried Netbeans+GlassFish. The installation goes fine, I can launch the standalone server in command line, but when I try to launch my project with GlassFish it tells me :

Could not start GlassFish Server: Administration port is occupied by null

I don't mind using another Server but it keep not working...

Offline

#4 2013-11-26 10:08:49

satanselbow
Member
Registered: 2011-06-15
Posts: 538

Re: Eclipse/Netbeans with Tomcat/GlassFish

You rather suggest that you installed tomcat / glassfish independently from netbeans?

There are working glassfish/tomcat servers (netbeans specific tweaked - at a guess) that work very well out of the box and are included in the "ALL"  or "JavaEE" editions of netbeans. This would be preferable to trying to hack an independent package into the IDE.

Offline

#5 2013-11-26 16:44:05

Depado
Member
Registered: 2013-02-28
Posts: 49

Re: Eclipse/Netbeans with Tomcat/GlassFish

Netbeans doesn't provide the Tomcat (when I add a new server, Netbeans asks for Tomcat's directory). Though I installed Glassfish through Netbeans.
The only version I can see in aur/pacman is community/netbeans. The rest are packages for compatibility with C/C++/Others (UML too), but there is no version "ALL" or "JavaEE".
I guess I do have the JEE version since I can create dynamic web applications through Netbeans.

Offline

#6 2013-11-27 09:19:22

satanselbow
Member
Registered: 2011-06-15
Posts: 538

Re: Eclipse/Netbeans with Tomcat/GlassFish

You may want to swap out OpenJDK for the official version as compatibility isn't always guaranteed - any sort of development would require the "proper" java stack in my opinion.

Apologies - tomcat does need to be installed separately. It is quite a while since I have had to reinstall netbeans / reconfigure it wink 

Have you configured tomcat and have it running without error in the background?

https://wiki.archlinux.org/index.php/Tomcat
https://wiki.archlinux.org/index.php/Netbeans

Offline

Board footer

Powered by FluxBB