I am taking a course in Enterprise Application Development. I am new to JSF. I am trying to deploy my app using Glassfish 3.1 using JSF and Netbeans IDE.
The error I get is listed below.
Error occurred during deployment: Exception while preparing the app : Unable to load the EJB module. DeploymentContext does not contain any EJB. Check the archive to ensure correct packaging for F:\Seagate\docs backup\NetBeansProjects\ent-app-dev\Slamka_Project1\build\web.
If you use EJB component annotations to define the EJB, and an ejb or web deployment descriptor is also used, please make sure that the deployment descriptor references a Java EE 5 or higher version schema, and that the metadata-complete attribute is not set to true, so the component annotations can be processed as expected. Please see server.log for more details.
Below are the references to EJB I have made.
import javax.ejb.LocalBean;
import javax.ejb.Stateless;
import javax.ejb.EJB;
#EJB
Any help would be appreciated.
EDIT: This is a Java Web Application.
EDIT
WAR FILE STRUCTURE TREE
META-INF/MANIFEST.MF
WEB-INF/classes
WEB-INF/lib/primefaces-2.1.1.jar
WEB-INF/web.xml
index.shtml
My file does not have an EJB tag in teh xhtml document. it has what is listed below.
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:c="http://java.sun.com/jsf/core">
Changing the web.xml web-app attribute version to 2.5 or higher resolved this issue.
Updated web-app element of web.xml will be,
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
So you have web application, it's not ejb-jar, it's web module that sould be packeged to *.war archive.
Structure should be
*.war/META-INF/persistence.xml
*.war/META-INF/MANIFEST.MF
*.war/WEB-INF/sun-web.xml
*.war/WEB-INF/web.xml
*.war/WEB-INF/classes/ - compiled classes in packages
*.war/WEB-INF/lib/ - libs
*.war/index.jsp - home page
example of sun-web.xml
<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN" "http://www.sun.com/software/appserver/dtds/sun-web-app_2_5-0.dtd">
<sun-web-app>
<context-root>/app</context-root>
</sun-web-app>
if you are using Maven, you can use maven-war-plugin
Turns out the issue was a typo in a SQL statement (1 and l [lower case L]) and I needed to do a "Clean and build" on the project. Thank you for those who put effort into helping me solve my issue.
Related
I am struggling for the past 6-7 hrs trying to figure out what went wrong with my Apache Tomcat Server. In all of my projects, the jdk version got switched to 1.6 from 1.8.
To solve the version conflict, I verified whether compiled version and JVM of Tomcat version are same by taking help from here.
For multiple contexts with the same path error, I know i need to remove duplicate Context tags in server.xml. So, first I check in Servers project (which gets created itself when you add Apache Tomcat Server in Eclipse) and find none there. So, I delve deep into the directory(Eclipse WorkSpace) metadata\.plugins\org.eclipse.wst.server.core\tmp3\conf and removed the duplicate Context tags over there, with help taken from here.
Now when i create a new Dynamic Web Project, everything works fine and I am able to see the web page. But if I try to access any of the HTML, XHTML files of those old project in which the jdk got changed, this org.apache.catalina.LifecycleException continues to pop up and the server fails to start, and consequently these duplicate Context tags continues to build up again and again every time i start the server.
None of my old Web application projects seems to work now.
java.util.concurrent.ExecutionException:
org.apache.catalina.LifecycleException: Failed to start component
[StandardEngine[Catalina].StandardHost[localhost].StandardContext
[/EdBurns_ChrisSchalk]].....
SEVERE: A child container failed during start
java.util.concurrent.ExecutionException:
org.apache.catalina.LifecycleException: Failed to start component
[StandardEngine[Catalina].StandardHost[localhost]]
....
Caused by: java.lang.RuntimeException: Unexpected element value kind in
annotation: 0
How to prevent these context tags being build up again and again in server.xml.
Secondly, how to get back those old web projects to working state again?
I had a similar error and fixed it by following steps:
1. Under Servers project (which gets created itself when you add Apache Tomcat Server in Eclipse), open server.xml
2. Comment out the line
<Context docBase=... />
This will prevent multiple context tags to be created upon each request
1) Stop the server
2) Clean Tomcat's work directory
If you are not using annotation based Servlet then please remove annotation #WebServlet("/YourServletName") from the starting of the servlet. This annotation confuses the mapping with web.xml, after removing this annotation Tomcat server will work properly.
This seems to be an issue with local Maven repository. (i.e. .m2 folder) may be due to some corrupt .jar file
For me, the following actions helped to overcome this issue.
On my local file system, I've deleted the directory .m2 (Maven local repository)
In Eclipse, updated the project (select Maven > Update Project)
Ran the app again on Tomcat server.
Went through the various resources on the net but none of them helped then i deleted the existing server and added the same server again and now it is working fine and the steps are
Window>>ShowView>>Servers>>RightClick>>Delete
and then add the server again as you have added previously.
If you are using the following stack:
Server Version: Apache Tomcat/9.0.21
Servlet Version: 4.0 JSP Version: 2.3
Then try adding <absolute-ordering /> to your web.xml file. So your file looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
<display-name>spring-mvc-crud-demo</display-name>
<absolute-ordering />
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
......
In my case, the servlet-api.jar file in jre/lib/ext in the jdk directory conflicts with the servlet-api.jar file in tomcat, removing the servlet-api.jar in jre/lib/ext in the jdk directory can solve the problem.
Just make sure build with correct web.xml configuration.I have update web.xml with tomcat configuration and it worked for me.
Sample :-
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5">
<display-name>simulator</display-name>
<description>simulator app</description>
<!-- File upload -->
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<!-- excel simulation -->
<display-name>simulator</display-name>
<description>simulator app</description>
<!-- File upload -->
<welcome-file-list>
<welcome-file>InsertPage.html</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>FileUploadServlet</servlet-name>
<servlet-class>clari5.excel.FileUploadServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>FileUploadServlet</servlet-name>
<url-pattern>/excelSimulator/FileUploadServlet</url-pattern>
</servlet-mapping>
</web-app>
One of the problems that can cause this is when you forget to put the / character in the WebServlet annotation #WebServlet("/example") #WebServlet("example")
I hope it works, it worked for me.
Below solution worked for me:
Navigate to Project->Clean..
Clean all the projects referenced by Tomcat server
Refresh the project you're trying to run on Tomcat
Try to run the server afterwards
I think it is jar file version problem. I had the same issue and I fixed it by changing the commons-codec-1.6.jar file from the build path. Earlier I was using latest version 1.10. Gradually I decreased the versions and 1.6 version fixed my issue.
Go to the task manager, kill the java processes and turn the server back on.
should work fine.
I've ported an application from JEE6 to JEE7 (glassfish 3.1.2.2 to 4.1),
I've upgraded the META-INF/validation.xml with latest version (as stated here): http://antoniogoncalves.org/2013/06/04/java-ee-7-deployment-descriptors/):
<validation-config
xmlns="http://jboss.org/xml/ns/javax/validation/configuration"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://jboss.org/xml/ns/javax/validation/configuration validation-configuration-1.1.xsd"
version="1.1">
<message-interpolator>com.infomaxgroup.adaecommerce.validation.DatabaseMessageInterpolator</message-interpolator>
</validation-config>
The custom messageinterpolator is never called, so I've tried to set a name of a non existent class:
<message-interpolator>foo.foo.foo.Bar</message-interpolator>
and tried to insert an error (xxx after the opening tag):
<message-interpolatorxxx>foo.foo.foo.Bar</message-interpolator>
I've no exception into log, seems like that validation.xml (that my JEE6 application processes good) is not loaded at all into my ported JEE7 application...
Any idea on how to solve the issue ?
Many thanks in advance...
Solved from myself,
the problem was that validation.xml must be placed into META-INF/validation.xml folder of the "ejb module", into my JEE6 application I had that file into WEB-INF folder of the "web module" (strangely the JEE6 application works good...), now my JEE7 application correctly load validation.xml configuration and works using the message interpolator, very good !
I am learning "how to create portal application", went through some documents and tutorials. I found we need one application server, one portal container and one IDE.
please help me to understand it.
I want to create a portlet and deploy it on weblogic server. so what the things i required.
means: any plugin in eclipse
portlet container
application server
etc.....
Thanks
I've just got the pluto portlet container up and running. The tutorials for pluto are a bit sketchy and most contain errors that can throw you off course. As such, I've made this as thorough as I can.
I've since managed to get pluto running under WebLogic, albeit not perfectly (discussed later). So, I think your aims are:
Install a portlet container: e.g. pluto
Create a HelloWorld portlet, deploy it and publish it
Perhaps, deploy the portlet so that it runs under WebLogic? Not sure if this is what you intend.
Portlet communication
Build more heavyweight portlets that do what you want
Upgrade portal implementation (e.g. JetSpeed)
So, here goes:
1. Install a portlet container: e.g. pluto
I recommend you start with the pluto portlet as this is the reference implementation and adheres to version 2 of the spec (JSR-286). Download the binary distribution from:
http://portals.apache.org/pluto/v20/getting-started.html
This comes housed within a tomcat 6 webserver. So, to run a basic portlet, you just need to configure and start tomcat. The pluto web application can be found in the webapps directory.
To understand more about tomcat, see here:
http://www.puschitz.com/InstallingTomcat.html#InstallingTomcatSoftware
Note that this is slightly complicated (for good reason) as it recommends creating separate instances of tomcat. This tutorial really only takes an hour though so I'd recommend it in advance of your portlet work so that you have a good foundation.
In simple terms though, to start up pluto (well, tomcat), you just need to set your ${CATALINA_HOME} to be your tomcat installation directoy (pluto-2.0.2) and execute {pluto_install_dir}/bin/startup.sh. You can access the pluto portal from a browser with:
http://localhost:8080/pluto/portal
2. Create a HelloWorld portlet, deploy it and publish it
Happily, the pluto tutorial is nearly good enough to get you going. Unbelievably, all the tutorials I found had flaws or errors. With a little help, you should get this going though. It is at the same place:
http://portals.apache.org/pluto/v20/deploying.html
The directory structure shown under "Portlet Assembly" is slightly wrong. The webapp folder should be at the same level as the java folder, under main.
Here is a sample HelloWorld portlet that presents using direct output in the response (like a servlet):
package com.mycompany.portlet;
//imports omitted...
public class HelloWorldPortlet extends GenericPortlet{
protected void doView(RenderRequest request,RenderResponse response)
throws PortletException, IOException {
response.setContentType("text/html");
response.getWriter().println("Hello World");
}
}
Here's an example WEB-INF/portlet.xml:
<?xml version="1.0" encoding="UTF-8"?>
<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
version="1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd
http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd">
<portlet>
<description>HelloWorld Description</description>
<portlet-name>HelloWorldPortlet</portlet-name>
<display-name>Hello World Display Name</display-name>
<portlet-class>com.mycompany.portlet.HelloWorldPortlet</portlet-class>
<expiration-cache>-1</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
</supports>
<supported-locale>en</supported-locale>
<portlet-info>
<title>Hello World</title>
<short-title>Hello World</short-title>
<keywords>Hello,pluto</keywords>
</portlet-info>
</portlet>
</portlet-app>
Here's an example WEB-INF/web.xml:
<web-app id="WebApp_ID">
<display-name>Hello World Portlet</display-name>
<taglib>
<taglib-uri>http://java.sun.com/portlet</taglib-uri>
<taglib-location>tld/portlet.tld</taglib-location>
</taglib>
</web-app>
Put portlet.tld (the prtlet 2.0 version) in your tld directory. Note we aren't using JSPs so this will be empty. For a good (but broken) JSP based tutorial, see here:
http://www.ibm.com/developerworks/java/library/j-pluto/
Build using the mvn build script supplied in:
http://portals.apache.org/pluto/v20/deploying.html
If you don't add the automatic deployment section of the build script the move the build war to your pluto (tomcat) webapps.
Within your browser, you must publish your new HelloWorld webapp from the admin page within the pluto portal (add page -> add portlet). A new tab should be added containing your portlet.
3. Deploy the portlet under WebLogic
Add the pluto libraries to your WebLogic lib. I put these in your domain library directory (which contains a readme indicating this is for adding jars to be dynamically loaded on 10.2.3). This is ${MYDOMAIN}/lib. The jars to locate there are as follows:
http://portals.apache.org/pluto/v20/embedding.html
Add the pluto web application and any referenced (published) webapps into your WLS upload directory. This means including testsuite which is provided with pluto and your new helloworld webapp.
Configure WLS to be able to access your portlets:
The pluto webapps are security configured for users pluto and tomcat. So, you have to add a new "pluto" user to your WLS security realm [Security Realms -> myRealm]
Configure webapp security to map the security role to the WLS user. This means creating ${MYUPLOAD}/pluto/WEB-INF/weblogic.xml. Here add a "security-role-assignment" entry for principal pluto (your new WebLogic user).
Note that the testsuite/WEB-INF/web.xml is only authorised for user tomcat. Change this to pluto.
Add portlet_2_0.tld to ${UPLOAD}/testsuite/WEB-INF/tld (make tld dir). This is available at: http://svn.apache.org/repos/asf/portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/tld/portlet_2_0.tld
Several of the testsuites will still fail under WLS. There are outstanding issues between apache and the community. They see it as a WLS issue (on the apache pluto jira at https://issues.apache.org/jira/browse/PLUTO-571).
There is an issue where by the portlet is actually presented outside the portlet frame (div) when using JSP rendering. Not got to the bottom of this yet.
4. Portlet Communication
Have two portlets interoperating. Refer to:
http://publib.boulder.ibm.com/infocenter/wpexpdoc/v6r1/index.jsp?topic=/com.ibm.wp.exp.doc_v6101/dev/pltcom_pubrndrprm.html
5. Build more heavyweight portlets
Refer to more complex webapp tutorial using JSPs at:
http://www.ibm.com/developerworks/java/library/j-pluto/
//Warning: portlet 1.0 (JSR-168) and contains errors
Then try your own...
6. Upgrade portal implementation
Try out JetSpeed for example. Refer to:
http://portals.apache.org/jetspeed-2/
When I created new dynamic web project in Eclipse, automatically created web.xml showed the following error:
cvc-elt.1: Cannot find the declaration of element 'web-app'
and a red background on this line:
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
I want to know why this error occur and how to get rid of this error.
I used Eclipse version 3.1, Apache Tomcat 5.0 and JDK 1.4 in my project. I'm pretty new to Eclipse.
You need to add the DOCTYPE element to the start of the XML:
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
I'm seeing this on Eclipse 4.1, Apache Tomcat 7.x, and JDK 1.6. It apparently has something to do with caching the XSD files. Some people provide an alternate syntax of web.xml that uses DTDs instead of schemas. But I've had success with one solution which suggested merely turning off caching. The better option, also at that last link, is to download and install the XSDs manually.
Update: I decided to try to download one of the XSDs myself and try to install it in the Eclipse XML catalog manually. It became obvious that the Java XSD server was having problems---which is apparently what Eclipse saw when it tried to download and cache the XSD. Perhaps when Oracle/Sun gets its act together and the server starts working again, then Eclipse will stop giving this error. In the meantime, I'll have to turn off caching and see how far I get.
Update: Once the Sun server comes back up for a little while, download the XSD file and store it in some semi-permanent place locally. Then go into the Eclipse preferences, search for the XML Catalog, and give it a reference to the XSD file. I've verified this prevents Eclipse from trying to download and cache the file. This is the best solution if you can't trust the Sun servers---and apparently you can't.
Error: cvc-elt.1.a: Cannot find the declaration of element 'web-app'
Issue:
This error is related to the web.xml file of Eclipse IDE Dynamic Web Project
The main root cause of this error is different Java Enterprises Edition (JEE) support.
From August 13, 2019 Java EE Servlet API is maintained by Jakarta EE Servlet API
As these package names are changed from:
javax.servlet.*; ---> to ---> jakarta.servlet.*;
javax.servlet.http.*; ---> to ---> jakarta.servlet.http.*;
Your IDE might still populating the old doc type declaration for xml files to be compatible with javax package
Solution:
If you're using new version of Tomcat or other Java Server Application, check whether they're working with new jakarta package or old javax package.
Tomcat 10 is already migrated to Jakarta EE so if you're using Tomcat 10 you can use the jakarta doctype declaration mentioned below.
Correct Declaration for Old Version javax package
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd" version="4.0">
Correct Declaration for New Version jakarta package
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://jakarta.ee/xml/ns/jakartaee" xmlns:web="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_5_0.xsd http://xmlns.jcp.org/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="5.0">
Things I am working with:
Eclipse IDE for Enterprise Java and Web Developers
Version: 2021-12 (4.22.0)
Build id: 20211202-1639*
Apache Tomcat
Version 10.0.7
I also came across this problem and didn't found something reasonable. For quick solution. Delete your workspace entirely and take clone of project again. You won't see the problem again. It helped me.
For me its working now
Replace with this -
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
I received this error when I unknowingly lost the internet connection meaning the xsd was not available. Reconnecting solved it
Deleting the workspace and creating a new workspace has helped me to resolve this error. I was getting this error for the ZK web application
This issue is related to Eclipse auto-generated web.xml file.
In new versions of Java EE, you must change Java EE to Jakarta EE.
As a sample change your <web-app> opening tag as this [5/7/2022]:
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://jakarta.ee/xml/ns/jakartaee"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee
https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
version="6.0">
I'm learning how to develop SOAP web services with Java.
So far now I've been following this excellent tutorial
http://web.archive.org/web/20120626005333/http://java.sun.com/developer/technicalArticles/J2SE/jax_ws_2/
It all goes well, I have my web service working from the command line with it's embedded server and then, with the help of NetBeans I deployed it on Tomcat.
I'd like to know the steps to manually deploy it on Tomcat, in order to learn how it's done and because I don't like depending on an IDE.
I mean, I'd like to know how everything could be done from the command line and a text editor.
I've also found this link that explains how to manually deploy a servlet to Tomcat,
http://linux-sxs.org/internet_serving/c292.html
but I couldn't find any article telling how to deploy a web service.
Thanks a lot.
How to MANUALLY build and deploy a jax-ws web service to tomcat
I was trying to figure out how to MANUALLY build and deploy a web service for learning pourposes.
I began with this excellent article
http://java.sun.com/developer/technicalArticles/J2SE/jax_ws_2/
(new URL: http://www.oracle.com/technetwork/articles/javase/jax-ws-2-141894.html)
The idea was to do the whole thing using only a notepad and the command line.
The only way I could achieve was by deploying a web service with netbeans, and then having a look at the war generated file at \dist\.war (it's just a zip file, you can open it with 7zip)
I leave this in case anybody is interested and for documentation purposes...
If anybody knows an easier way please let me know!!!
tested on:
C:\tomcat6\bin>version
Server version: Apache Tomcat/6.0.26
Server built: March 9 2010 1805
Server number: 6.0.26.0
OS Name: Windows XP
OS Version: 5.1
Architecture: x86
JVM Version: 1.6.0_18-b07
JVM Vendor: Sun Microsystems Inc.
saludos
sas
1. create the following dir c:\java\src\ws
2. create thew following file c:\java\src\ws\Adder.java
// c:\java\src\ws\Adder.java
package ws;
import javax.jws.WebService;
#WebService
public class Adder {
public double add( double value1, double value2 ) {
return value1 + value2;
}
}
3. standing at c:\java\src\ execute
c:\java\src> javac ws\Adder.java
file c:\java\src\ws\Adder.class will be generated
4. create the following directory structure with the following files
c:\tomcat6\webapps\adder_ws
META-INF
context.xml
WEB-INF
classes
ws
Adder.class
lib
activation.jar
webservices-api.jar
webservices-extra.jar
webservices-extra-api.jar
webservices-rt.jar
webservices-tools.jar
sun-jaxws.xml
web.xml
5. copy compiled file
copy c:\java\src\ws\Adder.class c:\tomcat6\webapps\adder_ws\WEB-INF\classes\ws\Adder.class
6. c:\tomcat6\webapps\adder_ws\META-INF\context.xml
<?xml version="1.0" encoding="UTF-8"?>
<Context antiJARLocking="true" path="/adder_ws"/>
7. c:\tomcat6\webapps\adder_ws\WEB-INF\web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<listener>
<listener-class>com.sun.xml.ws.transport.http.servlet.WSServletContextListener</listener-class>
</listener>
<servlet>
<servlet-name>Adder</servlet-name>
<servlet-class>com.sun.xml.ws.transport.http.servlet.WSServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Adder</servlet-name>
<url-pattern>/add</url-pattern>
</servlet-mapping>
<!-- not needed
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
-->
</web-app>
8. Config WEB-INF\sun-jaxws.xml
file : c:\tomcat6\webapps\adder_ws\WEB-INF\sun-jaxws.xml
<?xml version="1.0" encoding="UTF-8"?>
<endpoints version="2.0" xmlns="http://java.sun.com/xml/ns/jax-ws/ri/runtime">
<endpoint implementation="ws.Adder" name="Adder" url-pattern="/add"/>
</endpoints>
9. Copy libraries
files at c:\tomcat6\webapps\adder_ws\WEB-INF\lib
copy netbeans files from
[netbeans dir]\enterprise\modules\ext\metro\*.*
and
[netbeans dir]\ide\modules\ext\jaxb\activation.jar
10. restart apache
Shutdown : c:\tomcat6\bin\shutdown.bat
Startup : c:\tomcat6\bin\startup.bat
11. Test
Open a web browser and go to http://localhost:8080/adder_ws/add?wsdl
you can also use a tool like soapui (http://www.soapui.org/) to test the web service
that's it, I guess now I'll have a look at the way eclipses does it...
here's another useful article
it kind of answer my very own question
http://java.dzone.com/articles/jax-ws-deployment-five-minute
Following articles has step by step guide to manually build and deploy JAX-WS web services. It uses Ant as build tool.
Building JAX-WS Web service
I would expect the deployable to be the same for a web service and a servlet. Namely, a .war file. So you should be able to deploy it in the same fashion.
I see that nobody has mentioned JAX-WS Tutorials from Mkyong.com.
In the "JAX-WS Security in Tomcat" section on the "JAX-WS Tutorial" page, there is a short, to the point and with pictures tutorial, just what the OP wanted:
Deploy JAX-WS web services on Tomcat