Hi all,
I´m somewhat lost trying to get a first sample Web Service to work
with IDEA 5.0.2 and the webservices plugin 0.4 build 5.
I've installed Tomcat 5.5.15 with Axis. Tthe Axis happyness page shows
Axis is happy and the EchoHeaders.jws sample compiles and works fine.
So I created a new "Web Module" project in IDEA, leaving all to
default values, put a simple method in a class in a package in /src,
hit "Enable Web Service Support", built the Project, "Generate Wsdl
from Java Code", configured Run/Debug to use local Tomcat (default
values).
Using a web browser to access http://localhost:8080/ (= deployment
root/app context/startup page) results in Tomcat showing error 404
(http://localhost:8080/axis and everything else is ok).
The "Run" dialog in IDEA shows the web module is deployed ok, but
trying to do Tools/"Deploy Java Class as Web Service" says:
"The web server is not running - launch the webservices web module in
local Tomcat run/debug session".
Any clues? Thanks!
On Sat, 14 Jan 2006 18:12:24 +0300 (MSK), AdvancedTools
<no_mail@jetbrains.com> wrote:
>Most likely problem with root context. Try changing context to nonempty one.
Does not seem to help - below are the steps I´ve taken so far and the
results. I´d greatly appreciate if you could have a look on it.
May serve as tutorial sometime?
-
8< -
Install Tomcat: c:\programme\apache group\tomcat 5.5
(path to jdk 1.5.0_06 jre)
extract apache-tomcat-5.5.15-admin.zip to tomcat-directory
extract webapps\axis directory from axis-bin-1_3.zip to
tomcat\webapps\axis
extract to "c:\programme\apache group\tomcat
5.5\webapps\axis\WEB-INF\lib":
activation.jar from jaf-1_0_2-upd2.zip
mail.jar from javamail-1_3_3_01.zip
xmlsec-1.3.0.jar from xml-security-bin-1_3_0.zip
set PATH:
...;c:\Programme\Java\jdk1.5.0_05\bin;[...]
set CLASSPATH:
.;c:\Programme\Java\jdk1.5.0_05\lib\tools.jar
set JAVA_HOME:
C:\Programme\Java\jdk1.5.0_05
set AXIS_HOME:
c:\programme\apache group\tomcat 5.5\webapps\axis\WEB-INF
set AXIS_LIB:
c:\programme\apache group\tomcat 5.5\webapps\axis\WEB-INF\lib
set AXISCLASSPATH:
%AXIS_LIB%\axis.jar;%AXIS_LIB%\commons-discovery.jar;
start Tomcat service
test Tomcat/Axis
http://localhost:8080/axis/happyaxis.jsp
ok - core and optional components present
http://localhost:8080/axis/EchoHeaders.jws?method=list
ok
stop Tomcat service
IDEA:
New Project "aWebServiceTest"
Project JDK: 1.5.0_06
Single Module
Web Module
Module Name: "aWebService"
Module content root: c:\intellij-ws\aWebService
Application Server: Tomcat
(home=base directory: c:\programme\apache group\tomcat 5.5\
Libraries: commons-el, jasper-compiler-jdt, jasper-compiler,
jasper-runtime, jsp-api, naming-factory-dbcp, naming-factory,
naming-resources, servlet-api)
Deployment Descriptors:
Web Module Deployment Descriptor:
C:\intellij-ws\aWebService\WEB-INF\web.xml (2.3)
Tomcat Context Descriptor:
C:\intellij-ws\aWebService\META-INF\context.xml (5.x)
Web resource directory:
C:\intellij-ws\aWebService\resources
relative path in deployment directory: /
Web module exploded directory:
C:\intellij-ws\aWebService\exploded
Source directory:
src
Compiler output path:
C:\intellij-ws\aWebService\exploded\WEB-INF\classes
src -> new package "aWebServicePackage"
src/aWebServicePackage -> new class "aWebServiceClass"
aWebServiceClass:
package aWebServicePackage;
public class aWebServiceClass {
public double aWebServiceMethod(String job, double x) {
if ("Square".equalsIgnoreCase(job))
return x * x;
if ("Root".equalsIgnoreCase(job))
return Math.sqrt(x);
return 0.;
}
}
Compile aWebServiceClass
Generate WSDL from Java Code (Default, Document, Literal, 1.1)
Enable Web Service Support (Module aWebService)
Run/Edit Configurations:
Server: Tomcat Server: Local, Name: "local tomcat"
Application Server: "Tomcat", Startup page: "http://localhost:8080/"
Deployment: Module "aWebService": Deployment Source: Configure:
Create web module exploded directory
C:\intellij-ws\aWebService\exploded
exclude, synchronize
Create web module war file
C:\intellij-ws\aWebService\aWebService.war
"aWebService.war", Application context: /
Startup/connection: default (C:\Programme\Apache Group\Tomcat
5.5\bin\catalina.bat)
Run:
cmd /c "C:\Programme\Apache Group\Tomcat 5.5\bin\catalina.bat" run
Using CATALINA_BASE: C:\Dokumente und
Einstellungen\x\.IntelliJIdea50\system\tomcat_local_tomcat_ef0ba776
Using CATALINA_HOME: C:\Programme\Apache Group\Tomcat 5.5
Using CATALINA_TMPDIR: C:\Programme\Apache Group\Tomcat 5.5\temp
Using JRE_HOME: C:\Programme\Java\jdk1.5.0_03
14.01.2006 18:25:06 org.apache.coyote.http11.Http11AprProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
14.01.2006 18:25:07 org.apache.coyote.ajp.AjpAprProtocol init
INFO: Initializing Coyote AJP/1.3 on ajp-8009
14.01.2006 18:25:07 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 927 ms
14.01.2006 18:25:07 org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
14.01.2006 18:25:07 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.15
14.01.2006 18:25:07 org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
log4j:WARN No appenders could be found for logger
(org.apache.catalina.startup.TldConfig).
log4j:WARN Please initialize the log4j system properly.
- Unable to find config file. Creating new servlet engine config
file: /WEB-INF/server-config.wsdd
log4j:WARN No appenders could be found for logger
(org.apache.catalina.session.ManagerBase).
log4j:WARN Please initialize the log4j system properly.
14.01.2006 18:25:12 org.apache.coyote.http11.Http11AprProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
14.01.2006 18:25:12 org.apache.coyote.ajp.AjpAprProtocol start
INFO: Starting Coyote AJP/1.3 on ajp-8009
14.01.2006 18:25:12 org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
14.01.2006 18:25:12 org.apache.catalina.startup.Catalina start
INFO: Server startup in 5481 ms
accessing http://localhost:8080: Tomcat: HTTP Status 404
accessing http://localhost:8080/aWebService: Tomcat: HTTP Status 404
Deploy Java Class as WSDL: "Web server not running ..."
Stop
Run (Deployment - Module "aWebService" - Deployment Source:
"aWebService.war" - Application Context: /aWebService => startup page:
"http://localhost:8080/aWebService/"):
accessing http://localhost:8080: Tomcat: HTTP Status 404
accessing http://localhost:8080/aWebService: Tomcat: HTTP Status 404
Stop
-
8< -
Greets, gd.
When selecting Tomcat run configuration, one can specify context to be used for running web module in 'Deployment' tab (it will mount your web module under http://localhost:8080/SomeContext ).
Actually, Axis library manipulations is not needed.
Yo tengo el mismo problema con la versión del plugin 0.4 build 6. Tengo configurado el run/debug para que el web module arranque como http://localhost:8081/sgrnet, pero no consigo que me detecte que la aplicación está lanzada.
También me ha dado problemas el plugin con el plugin Struts Assistant (v0.99), ya que hay que desactivar el code completion de este último plugin para que no haya conflictos. Con la última versión del Idea no ha habido problema porque te avisa del hecho sin más al iniciar, pero con una versión anterior se colgaba al iniciar debido a la incompatibilidad de plugins.
Efectivamente el problema anterior se ha corregido cambiando el puerto de mi tomcat al 8080, pero ahora, obtengo a cambio el siguiente error cuando quiero "deployar" una clase como un servicio web.
Axis Servlet is not present => invoke 'Enable Web Wervice Support' action for module.
Por supuesto he seguido previamente todos los pasos, y ya he hecho lo que se me solicita, tengo todas las librerías de axis en el proyecto, el web.xml está cambiado e incluso cuando en el navegador introduzco:
http://localhost:8080/prueba/servlet/AxisServlet
El servlet de Axis funciona correctamente.
No sé qué puedo estar haciendo mal, a ver si alguien me puede ayudar.
Un saludo y muchas gracias.