How to run java servlet without using Web.xml?

How to run servlet without using Web.xml? From a book, I know that web.xml descriptor is optional, but the book doesn't tell us how to run java servelet without web.xm descriptor. So how to do that? Thanks a lot.

How to run servlet without using Web.xml?But Tomcat now uses a web.xml for its global server-wide configuration.
If you'd like to invoke a servlet with:
http://host/servlet/ServletName
you have to enable the invoker servlet.
[from an HTML]
  <FORM METHOD="POST" ACTION="/servlet/HGrepSearchSJ">
[from resin.conf of Resin Web Server 2.1.12]
  <!--
     - The "invoker" servlet invokes servlet classes from the URL.
     - /examples/basic/servlet/HelloServlet will start the HelloServlet
     - class.  In general, the invoker should only be used
     - for development, not on a deployment server, because it might
     - leave open security holes.
    -->
  <servlet-mapping url-pattern='/servlet/*' servlet-name='invoker'/>
[from TOMCAT5.0.19/conf/web.xml, a global server-wide web.xml file]
  <!-- The "invoker" servlet, which executes anonymous servlet classes      -->
  <!-- that have not been defined in a web.xml file.  Traditionally, this   -->
  <!-- servlet is mapped to URL pattern "/servlet/*", but you can map it    -->
  <!-- to other patterns as well.  The extra path info portion of such a    -->
  <!-- request must be the fully qualified class name of a Java class that  -->
  <!-- implements Servlet (or extends HttpServlet), or the servlet name     -->
  <!-- of an existing servlet definition.     This servlet supports the     -->
  <!-- following initialization parameters (default values are in square    -->
  <!-- brackets):                                                           -->
  <!--                                                                      -->
  <!--   debug               Debugging detail level for messages logged     -->
  <!--                       by this servlet.  [0]                          -->
    <servlet>
        <servlet-name>invoker</servlet-name>
        <servlet-class>
          org.apache.catalina.servlets.InvokerServlet
        </servlet-class>
        <init-param>
            <param-name>debug</param-name>
            <param-value>0</param-value>
        </init-param>
        <load-on-startup>2</load-on-startup>
    </servlet>
---comment out below----------------------------------------------------------
    <!-- The mapping for the invoker servlet -->
<!--
    <servlet-mapping>
        <servlet-name>invoker</servlet-name>
        <url-pattern>/servlet/*</url-pattern>
    </servlet-mapping>
-->

Similar Messages

  • Can i run a servlet without a web.xml file for servlet mapping?

    Hello everyone.
    The code i want to run compiles and everythink looks ok.
    It produces the .class file.
    I run Tomcat 4.1 and i build my Web site with Dreamweaver.
    I have a form in a page and i want to send the data upon form completion to a database i already have build with MySql.
    The database is up and running and the server is set-up ok.
    I have changed the port in Tomcat to run on port 80.
    The directory i have my site is
    Tomcat41\webapps\ROOT\se
    and the directory where i keep the servlet class is
    Tomcat41\webapps\ROOT\se\WEB-INF\servlet
    I have a web.xml file to map the servlet and placed it in
    Tomcat41\webapps\ROOT\se\WEB-INF
    In the Form action i write action:"/servlets/Classes/GroupRegistration"
    and I RECEIVE AN 404 ERROR FROM APACHE.
    Somethink is wrong .
    The following is the code from the GroupRegistration.java file
    and follws the web.xml file.
    Please Help.
    import java.sql.*;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class GroupRegistration extends HttpServlet
    Connection con;
    public void doPost (HttpServletRequest req, HttpServletResponse res)
                             throws ServletException, java.io.IOException
         handleForm(req, res);
    public void init() throws ServletException {
         try{
         /* Loading the driver for the database */
         Class.forName("com.mysql.jdbc.Driver");
         Connection Con = DriverManager.getConnection("jdbc:mysql://localhost/se?user=luser&password=");
         catch (ClassNotFoundException e) {
         throw new UnavailableException("Couldn't load JdbcOdbcDriver");
         catch (SQLException e) {
         throw new UnavailableException("Couldn't get db connection");
         private void handleForm(HttpServletRequest req, HttpServletResponse res)
         throws ServletException {
         //ServletOutputStream out = res.OutputStream();
         //res.setContentType("text/html");
         //Extract the form Data Here
         String group = req.getParameter("GroupNo");
         String Name1 = req.getParameter("Name1");
         String LoginID1 = req.getParameter("LoginID1");
         String Name2 = req.getParameter("Name2");
         String LoginID2 = req.getParameter("LoginID2");
         String Name3 = req.getParameter("Name3");
         String LoginID3 = req.getParameter("LoginID3");
         String Name4 = req.getParameter("Name4");
         String LoginID4 = req.getParameter("LoginID4");
         String URL = req.getParameter("URL");
         String Title2 = req.getParameter("Title2");
         String date = req.getParameter("date");
         String INSERT = "INSERT INTO registration (groupno, name1, loginid1, name2, loginid2, name3, loginid3, name4, loginid4, url, topic, date) VALUES (" + group + "," + Name1 + "," + LoginID2 + "," + Name2 + "," + LoginID2 + "," + Name3 + "," + LoginID3 + "," + Name4 + "," + LoginID4 + "," + URL + "," + Title2 + "," + date + ")";
         PreparedStatement pstmt = null;
         try{
         pstmt = con.prepareStatement(INSERT);
         pstmt.executeUpdate();
         catch (SQLException e) {
         throw new ServletException(e);
         finally {
         try {
         if (pstmt != null)pstmt.close();
         catch (SQLException ignored){
    The web.xml file
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <web-app 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" version="2.4">
    <servlet>
    <servlet-name>GroupRegistration</servlet-name>
    <servlet-class>GroupRegistration</servlet-class>
    </servlet>
    <servlet-maping>
    <servlet-name>GroupRegistration</servlet-name>
    <url-pattern>/myGroupRegistration</url-patern>
    </servlet-mapping>
    </web-app>
    I apreciate your time.
    Thanks for any help.

    and the directory where i keep the servlet class is
    Tomcat41\webapps\ROOT\se\WEB-INF\servletOthers have pointed out that "servlet" should be "classes", but there is another mistake that hasn't been spotted. If you want your servlet to appear in the root context, you should use:
    Tomcat41\webapps\ROOT\WEB-INF\classes
    If you want your servlet to appear under the /se context, then you should use:
    Tomcat41\webapps\se\WEB-INF\classes
    and also, in the latter case, your form action should be /se/myGroupRegistration.

  • What is the best way to find a file on the servers disk without using web.xml?

              What is the best way to find a file on the servers disk without using web.xml?
              I want to find a configuration file not contained within the war file I have
              created. Is there a way to pass information into the ServletContext with out
              rebuilding the ear or war files? Tomcat 4.0 can do this in its server configuration
              files. Does BEA have the equivalent?
              Regards,
              Eric
              

    You can specify the path to the file as a system property
              eg
              java -Dconfig.file.location=./mydirecotry/myfile.txt com.test.MyApp
              "Eric White" <[email protected]> wrote in message
              news:[email protected]..
              >
              > What is the best way to find a file on the servers disk without using
              web.xml?
              > I want to find a configuration file not contained within the war file I
              have
              > created. Is there a way to pass information into the ServletContext with
              out
              > rebuilding the ear or war files? Tomcat 4.0 can do this in its server
              configuration
              > files. Does BEA have the equivalent?
              >
              > Regards,
              > Eric
              

  • How to run the servlet without getting message window?

    while running servlet,i got a message window that 'Do you want to save:val?'how to rectify this problem while running servlet.
    Actually i saved the servlet files as HTTP and Generic.java respectively.
    In web.xml file,the content is as follows
    <servlet>
    <init-param>
         <param-name>title</param-name>
         <param-value>GenericServlet Example</param-value>
         </init-param>
         <init-param>
    <param-name>heading</param-name>
    <param-value>Servlet Program</param-value>
    </init-param>
    <servlet-name>G</servlet-name>
    <servlet-class>Generic</servlet-class>
    </servlet>
    <servlet>
    <servlet-name>H</servlet-name>
    <servlet-class>HTTP</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>G</servlet-name>
    <url-pattern>/generic</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>H</servlet-name>
    <url-pattern>/http</url-pattern>
    </servlet-mapping>
    ======================================================
    The html file is as follows
    <html>
    <body>
    <form action="generic" method="get">
    User Name<input type=text name=t1><br>
    Password<input type=password name=t2><br>
    <input type="submit" value="GenericServlet Output">
    </form>
    <form action="val" method="get">
    User Name<input type=text name=t3><br>
    Password<input type=password name=t4><br>
    <input type="submit" value="HttpServlet Output">
    </form>
    </body>
    </html>
    ======================================================
    I executed the servlet as http://localhost:8080/stalin/sample.html
    and clicked the sumit button in the html page.
    During that time i got a problem but not getting the output.The problem is I got a message window?
    can anyone help me clarify my doubt plz

    That would occur if either the content type in the header is wrong (e.g. it is not text nor image, those content types with which the useragent used is associated), or if you have set content disposition in the header to attachment instead of inline.
    So, doublecheck the headers.

  • How to run java application without having java environment in  a machine

    can i run java application without having java environment(JVM) in a machine.I mean i dont have installed j2se or jdk in my machine.And i have an j2ee application running on another host which is built in swings.I want to access that application in my machine
    can any one help regarding my problem

    If you only need to access the program from one machine and you are running a Unix-like operating system (e.g., Linux, Solaris), you can use the remote display capabilities of X11. In this case you have to choose the host where the app will be displayed when you start it:
    $ DISPLAY=<hostname>:0.0
    $ export DISPLAY
    $ java ...
    If you want to be able to display it on both machines at the same time, or if you are using windows, then try something like VNC (http;//www.realvnc.com). Or if you are running windows and your version supports it, you can use windows remote desktop.

  • How to run java file by using another applet file  ??

    how to compile and run java file by using another applet or japplet file .

    how to understand what you are talking about.

  • How to run a vi without using menu button on top

    i got to execute or run the labview program without using the menu button.There should be a button on front panel clicking on to it must run the vi.

    Hello, i am also new to labview but i experienced that you can use
    a while loop for this.
    You need to connect while loop with an boolean button,
    so everything which is included within the while loop will start only if
    the boolean button is "True".
    best regards
    Sven Zörner
    mitu_patnaik wrote:
    > i got to execute or run the labview program without using the menu
    > button.There should be a button on front panel clicking on to it must
    > run the vi.

  • Calling ejbs from servlets without using web apps.

    i am trying to instantiate and ejb from a servlet but it gives me the
              following error. the configuration and code that generated this error is
              attached below.
              oddly enough the same chunk of code works fine in a stand alone client if
              j2ee.jar;weblogic\classes and weblogicaux.jar are included in the classpath.
              any help would be appreciated.
              peter
              -8787844: in servlet.Webmedx.init
              -8787844: null
              java.lang.ClassCastException
              at
              com.sun.corba.ee.internal.javax.rmi.PortableRemoteObject.narrow(Porta
              bleRemoteObject.java:296)
              at
              javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
              at webmedx.servlet.Webmedx.init(Webmedx.java:23)
              at javax.servlet.GenericServlet.init(GenericServlet.java:258)
              at
              weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubIm
              pl.java:474)
              at
              weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStub
              Impl.java, Compiled Code)
              at
              weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubI
              mpl.java:422)
              at
              weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.
              java:187)
              at
              weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
              pl.java:118)
              at
              weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
              textImpl.java:760)
              at
              weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
              textImpl.java:707)
              at
              weblogic.servlet.internal.ServletContextManager.invokeServlet(Servlet
              ContextManager.java:251)
              at
              weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.jav
              a:369)
              at
              weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:269)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled
              Code)
              configuration:
              WebLogic startup settings are presently:
              CLASSPATH Prefix
              \weblogic\lib\weblogic510sp5boot.jar;\j2ee\lib\j2ee.jar;\web
              logic\lib\servlet.jar;\weblogic\lib\jaxp.jar;\weblogic\lib\parser.jar
              CLASSPATH
              \weblogic\lib\weblogic510sp5boot.jar;\j2ee\lib\j2ee.jar;\web
              logic\lib\servlet.jar;\weblogic\lib\jaxp.jar;\weblogic\lib\parser.jar;\weblo
              gic\
              jre1_2\lib\tools.jar;\weblogic\jre1_2\jre\lib\rt.jar;\weblogic\jre1_2\jre\li
              b\i1
              8n.jar;C:\weblogic\license;C:\weblogic\classes\boot;C:\weblogic\classes;C:\w
              eblo
              gic\lib\weblogicaux.jar;C:\weblogic\eval\cloudscape\lib\cloudscape.jar
              JAVA_HOME \weblogic\jre1_2
              WEBLOGIC_LICENSEDIR C:\weblogic\license
              WEBLOGIC_HOME C:\weblogic
              system properties:
              java.security.manager
              java.security.policy=\weblogic\weblogic.policy
              weblogic.system.home=\weblogic
              java.compiler=symcjit
              weblogic.class.path=\weblogic\lib\weblogic510sp5.jar;\weblog
              ic\license;\weblogic\classes;\weblogic\lib\weblogicaux.jar
              INITIAL_HEAP 64 MB
              MAX_HEAP 64 MB
              SERVERCLASSPATH
              \weblogic\lib\weblogic510sp5boot.jar;\j2ee\lib\j2ee.jar;\web
              logic\lib\servlet.jar;\weblogic\lib\jaxp.jar;\weblogic\lib\parser.jar;\weblo
              gic\
              jre1_2\jre\lib\rt.jar;\weblogic\jre1_2\jre\lib\i18n.jar;C:\weblogic\classes\
              boot
              ;C:\weblogic\eval\cloudscape\lib\cloudscape.jar
              Type "wlconfig -help" for program usage.
              code:
              public void init() throws ServletException{
              try{
              Log.debug("in servlet.Webmedx.init");
              Properties h = new Properties();
              h.put(Context.INITIAL_CONTEXT_FACTORY,
              "weblogic.jndi.WLInitialContextFactory");
              h.put(Context.PROVIDER_URL, "t3://localhost:7001");
              Context initial = new InitialContext(h);
              Object objref = initial.lookup("webmedx/pool");
              webmedxpoolhome =
              (WebmedxPoolHome)PortableRemoteObject.narrow(objref,WebmedxPoolHome.class);
              }catch(Exception ex){
              Log.error(ex);
              

    The problem before was that you were trying to load the same class from
              2 different class paths. The ClassCastException is very un-intuitive in this
              case.
              Peter Ghosh wrote:
              > however, when i added it to the classpath prefix (not the
              > weblogic.classpath) it seemed to do the trick. very odd.
              > thanks,
              > peter
              >
              > "Peter Ghosh" <[email protected]> wrote in message
              > news:[email protected]...
              > > i tried that but no luck. any other suggestions?
              > > peter
              > >
              > > "Ohad Shany" <[email protected]> wrote in message
              > > news:[email protected]...
              > > > Is your EJB classes on the servlet classpath?
              > > > (weblogic.httpd.servlet.classpath property)
              > > >
              > > > I had some strange casting problem when my EJB classes was on the
              > servlet
              > > > classpath
              > > > and it was gone when i moved them to the weblogic.class.path . Worth a
              > > try.
              > > >
              > > > OHAD
              > > >
              > > > Peter Ghosh wrote:
              > > >
              > > > > i am trying to instantiate and ejb from a servlet but it gives me the
              > > > > following error. the configuration and code that generated this error
              > is
              > > > > attached below.
              > > > > oddly enough the same chunk of code works fine in a stand alone client
              > > if
              > > > > j2ee.jar;weblogic\classes and weblogicaux.jar are included in the
              > > classpath.
              > > > > any help would be appreciated.
              > > > > peter
              > > > >
              > > > > -8787844: in servlet.Webmedx.init
              > > > > -8787844: null
              > > > > java.lang.ClassCastException
              > > > > at
              > > > > com.sun.corba.ee.internal.javax.rmi.PortableRemoteObject.narrow(Porta
              > > > > bleRemoteObject.java:296)
              > > > > at
              > > > > javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
              > > > > at webmedx.servlet.Webmedx.init(Webmedx.java:23)
              > > > > at javax.servlet.GenericServlet.init(GenericServlet.java:258)
              > > > > at
              > > > > weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubIm
              > > > > pl.java:474)
              > > > > at
              > > > > weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStub
              > > > > Impl.java, Compiled Code)
              > > > > at
              > > > > weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubI
              > > > > mpl.java:422)
              > > > > at
              > > > > weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.
              > > > > java:187)
              > > > > at
              > > > > weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
              > > > > pl.java:118)
              > > > > at
              > > > > weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
              > > > > textImpl.java:760)
              > > > > at
              > > > > weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletCon
              > > > > textImpl.java:707)
              > > > > at
              > > > > weblogic.servlet.internal.ServletContextManager.invokeServlet(Servlet
              > > > > ContextManager.java:251)
              > > > > at
              > > > > weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.jav
              > > > > a:369)
              > > > > at
              > > > > weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:269)
              > > > >
              > > > > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled
              > > > > Code)
              > > > >
              > > > > configuration:
              > > > >
              > > > > WebLogic startup settings are presently:
              > > > >
              > > > > CLASSPATH Prefix
              > > > > \weblogic\lib\weblogic510sp5boot.jar;\j2ee\lib\j2ee.jar;\web
              > > > > logic\lib\servlet.jar;\weblogic\lib\jaxp.jar;\weblogic\lib\parser.jar
              > > > > CLASSPATH
              > > > > \weblogic\lib\weblogic510sp5boot.jar;\j2ee\lib\j2ee.jar;\web
              > > > >
              > >
              > logic\lib\servlet.jar;\weblogic\lib\jaxp.jar;\weblogic\lib\parser.jar;\weblo
              > > > > gic\
              > > > >
              > >
              > jre1_2\lib\tools.jar;\weblogic\jre1_2\jre\lib\rt.jar;\weblogic\jre1_2\jre\li
              > > > > b\i1
              > > > >
              > >
              > 8n.jar;C:\weblogic\license;C:\weblogic\classes\boot;C:\weblogic\classes;C:\w
              > > > > eblo
              > > > > gic\lib\weblogicaux.jar;C:\weblogic\eval\cloudscape\lib\cloudscape.jar
              > > > > JAVA_HOME \weblogic\jre1_2
              > > > > WEBLOGIC_LICENSEDIR C:\weblogic\license
              > > > > WEBLOGIC_HOME C:\weblogic
              > > > > system properties:
              > > > > java.security.manager
              > > > > java.security.policy=\weblogic\weblogic.policy
              > > > > weblogic.system.home=\weblogic
              > > > > java.compiler=symcjit
              > > > >
              > > > > weblogic.class.path=\weblogic\lib\weblogic510sp5.jar;\weblog
              > > > > ic\license;\weblogic\classes;\weblogic\lib\weblogicaux.jar
              > > > > INITIAL_HEAP 64 MB
              > > > > MAX_HEAP 64 MB
              > > > > SERVERCLASSPATH
              > > > > \weblogic\lib\weblogic510sp5boot.jar;\j2ee\lib\j2ee.jar;\web
              > > > >
              > >
              > logic\lib\servlet.jar;\weblogic\lib\jaxp.jar;\weblogic\lib\parser.jar;\weblo
              > > > > gic\
              > > > >
              > >
              > jre1_2\jre\lib\rt.jar;\weblogic\jre1_2\jre\lib\i18n.jar;C:\weblogic\classes\
              > > > > boot
              > > > > ;C:\weblogic\eval\cloudscape\lib\cloudscape.jar
              > > > >
              > > > > Type "wlconfig -help" for program usage.
              > > > >
              > > > > code:
              > > > >
              > > > > public void init() throws ServletException{
              > > > > try{
              > > > > Log.debug("in servlet.Webmedx.init");
              > > > > Properties h = new Properties();
              > > > > h.put(Context.INITIAL_CONTEXT_FACTORY,
              > > > > "weblogic.jndi.WLInitialContextFactory");
              > > > > h.put(Context.PROVIDER_URL, "t3://localhost:7001");
              > > > > Context initial = new InitialContext(h);
              > > > > Object objref = initial.lookup("webmedx/pool");
              > > > > webmedxpoolhome =
              > > > >
              > > > >
              > >
              > (WebmedxPoolHome)PortableRemoteObject.narrow(objref,WebmedxPoolHome.class);
              > > > > }catch(Exception ex){
              > > > > Log.error(ex);
              > > > > }
              > > > > }
              > > >
              > >
              > >
              

  • How to run java program from website?

    Hello
    I'd like to know how to run java program from my web page.
    I'd like to push some button in this web page so java program that would be on my server
    would pop-up. Can it be done automaticaly upon running this web site? (without any buttons - I just enter website and program pops up).
    Cheers

    I rather thought about RMI. But I could try servlets. So how it would look like?.
    I would make http request in browser (enter address) and program would show up in its window?. And I would not have to change anything in my program?. This program would run then on both boxes?. One remotely and one not?.
    But I would have to learn some basics, I've never worked with servlets. Could you suggest some good sites about it?. With ready examples so I could tweak them to my purpose.
    Message was edited by:
    macmacmac

  • Running servlet without using 8080 on url

    Hello
    I want to run a servlet without having to use 8080 on the url ex. myserver.com:8080/test/servlet/helloserv
    I set up Apache and Tomcat to work together, since the examples work fine without the using 8080. But when I create a new context outside of webapps folder, and tried to run the servlet it says that page can't be found but when I add the port 8080(for tomcat), it works fine. How do I fix this problem so that I don't need to put the 8080 in order to run the servlet.
    Thanks a lot.

    use port 80 assuming it is not used already....change it in server.xml file
    Hello
    I want to run a servlet without having to use 8080 on
    the url ex. myserver.com:8080/test/servlet/helloserv
    I set up Apache and Tomcat to work together, since the
    examples work fine without the using 8080. But when I
    create a new context outside of webapps folder, and
    tried to run the servlet it says that page can't be
    found but when I add the port 8080(for tomcat), it
    works fine. How do I fix this problem so that I don't
    need to put the 8080 in order to run the servlet.
    Thanks a lot.

  • How to run java using xcode?

    i have to install "java developer " but i can't find, where i can run Java, Please give me information about "how to run java use xcode " ?

    Download the SDK from Oracle, code, enjoy.

  • How to create Java client to use WCC web services

    I'm trying to create a Java client to use web services available with Web Center Content.
    I generated stubs using "cxf-codegen-plugin" and I wrote following code (very trivial):
    DocInfo docInfo = null;
    *try {*
    docInfo = new DocInfo(new URL("http://vmxp43:16200/cs/idcplg?IdcService=GET_SOAP_WSDL_FILE&wsdlName=DocInfo&idcToken=1344065729220:B443F7C3DED844B594F32E0B3914E576&IsSoap=1"));
    *} catch (MalformedURLException e) {*
    e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
    DocInfoSoap docInfoSoap = docInfo.getDocInfoSoap();
    DocInfoByIDResult docInfoByIDResult =  docInfoSoap.docInfoByID(new Integer(2), null);
    At the moment I'm obtaining following error:
    Exception in thread "main" javax.xml.ws.WebServiceException: Failed to access the WSDL at: http://vmxp43:16200/cs/idcplg?IdcService=GET_SOAP_WSDL_FILE&wsdlName=DocInfo&idcToken=1344065729220:B443F7C3DED844B594F32E0B3914E576&IsSoap=1. It failed with:
    *     Invalid WSDL http://vmxp43:16200/cs/idcplg?IdcService=GET_SOAP_WSDL_FILE&wsdlName=DocInfo&idcToken=1344065729220:B443F7C3DED844B594F32E0B3914E576&IsSoap=1, expected {http://schemas.xmlsoap.org/wsdl/}definitions found html at (lineLine number = 3*
    Column number = 30
    System Id = http://vmxp43:16200/cs/idcplg?IdcService=GET_SOAP_WSDL_FILE&wsdlName=DocInfo&idcToken=1344065729220:B443F7C3DED844B594F32E0B3914E576&IsSoap=1
    Public Id = null
    Location Uri= http://vmxp43:16200/cs/idcplg?IdcService=GET_SOAP_WSDL_FILE&wsdlName=DocInfo&idcToken=1344065729220:B443F7C3DED844B594F32E0B3914E576&IsSoap=1
    CharacterOffset = 133
    *     at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.tryWithMex(RuntimeWSDLParser.java:151)*
    *     at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:127)*
    *     at com.sun.xml.internal.ws.client.WSServiceDelegate.parseWSDL(WSServiceDelegate.java:254)*
    *     at com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:217)*
    *     at com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:165)*
    *     at com.sun.xml.internal.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:93)*
    *     at javax.xml.ws.Service.<init>(Service.java:56)*
    *     at com.stellent.docinfo.DocInfo.<init>(DocInfo.java:39)*
    *     at eu.europa.efsa.virtual.library.services.client.TestDocInfo.main(TestDocInfo.java:23)*
    *Caused by: javax.xml.stream.XMLStreamException: Invalid WSDL http://vmxp43:16200/cs/idcplg?IdcService=GET_SOAP_WSDL_FILE&wsdlName=DocInfo&idcToken=1344065729220:B443F7C3DED844B594F32E0B3914E576&IsSoap=1, expected {http://schemas.xmlsoap.org/wsdl/}definitions found html at (lineLine number = 3*
    Column number = 30
    System Id = http://vmxp43:16200/cs/idcplg?IdcService=GET_SOAP_WSDL_FILE&wsdlName=DocInfo&idcToken=1344065729220:B443F7C3DED844B594F32E0B3914E576&IsSoap=1
    Public Id = null
    Location Uri= http://vmxp43:16200/cs/idcplg?IdcService=GET_SOAP_WSDL_FILE&wsdlName=DocInfo&idcToken=1344065729220:B443F7C3DED844B594F32E0B3914E576&IsSoap=1
    CharacterOffset = 133
    *     at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:120)*
    *     ... 7 more*
    Please, any comment will be appreciated.

    Now I'm trying following code.
    DocInfo docInfo = new DocInfo();
    DocInfoSoap docInfoSoap = docInfo.getDocInfoSoap();
    DocInfoByIDResult docInfoByIDResult =  docInfoSoap.docInfoByID(new Integer(2), null);
    The error I obtain is:
    Exception in thread "main" com.sun.xml.internal.ws.client.ClientTransportException: The server sent HTTP status code 401: Unauthorized
         at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.checkStatusCode(HttpTransportPipe.java:196)
         at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:168)
         at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:83)
         at com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:105)
         at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
         at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
         at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
         at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
         at com.sun.xml.internal.ws.client.Stub.process(Stub.java:211)
         at com.sun.xml.internal.ws.client.sei.SEIStub.doProcess(SEIStub.java:124)
         at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:98)
         at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)
         at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:107)
         at $Proxy28.docInfoByID(Unknown Source)
         at eu.europa.efsa.virtual.library.services.client.TestDocInfo.main(TestDocInfo.java:20)
    Is there a way to pass right username and password?
    How can I understand which the user actually used?

  • How to run java on computer without java from flash drive

    Im running a chess club at school and the school computers, you aren't allowed to install on the hard drive.
    Is there a way to put an ide and the java folder containing the jre and jdk on a flashdrive and run the ide and run programs solely from the lfashdrive?

    Yes. put the JDK (not the separate JRE) on the flash drive. The JDK contains a JRE.
    Plug the flashdrive into a computer you control. If that computer already has the desired JDK installed, copy the JDK directory (all of it) to the flash drive. Otherwise, do an install of the JDK to the flash drive.
    To run Java application programs use a command that provides the full path to the java.exe program, for instance (in Windows)
    *<drive letter>:\<some directories>java <the name of your program>*
    You could create a bat file to make this easier to type.
    You can't run applets or anything else that depends on Registry entries.

  • Any way to invoke a servlet without using "action=" in HTML

    Hello,
    Is there any way to invoke a servlet without using "action=" attribute of Form tag in the HTML form.
    I.e. if I need to run the servlet from a hyperlink, how could it be possible?
    Or If I need to run a servlet from a "window.Open()" method using java script, how could it be possible?
    The error I am facing...
    HTTP Status 405 - HTTP method GET is not supported by this URL
    type Status report
    message HTTP method GET is not supported by this URL
    description The specified HTTP method is not allowed for the requested resource (HTTP method GET is not supported by this URL).
    Thanks,
    Sandeep

    Maybe your URL needs to use POST.

  • How to run a servlet in tomcat 5.5

    Hi,iam new to servlets,please help me regarding running a servlet in tomcat 5.5,
    I just want an example servlet to run first,
    the below is the code for the same :-
    //ExampleServlet.java
    package sig;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class ExampleServlet extends HttpServlet {
         public void init(ServletConfig config) throws ServletException{
              super.init(config);
         public void service(HttpServletRequest req,HttpServletResponse res)throws ServletException,IOException{
              PrintWriter out = res.getWriter();
              out.println("<HTML>");
              out.println("<BODY>");
              out.println("<p>Hello World</p>");
              out.println("</BODY>");
              out.println("</HTML>");
    I have created a new folder named "SignatureServlet" under the "webapps" folder of tomcat and have created a "WEB-1NF" folder under it,
    again i have kept my "ExampleServlet.class" inside the "WEB-1NF->classes" folder and the entries for my servlet in the "web.xml" file are:-
    <servlet>
    <servlet-name>ExampleServlet</servlet-name>
    <servlet-class>ExampleServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>ExampleServlet</servlet-name>
    <url-pattern>/ExampleServlet</url-pattern>
    </servlet-mapping>
    still when iam trying to access the servlet using "http://localhost:8080/ExampleServlet/"
    iam getting a HTTP:404 error
    The requested resource () is not available.,
    please help

    You better ask this on a Tomcat forum...
    Timo

Maybe you are looking for

  • I have more than one apple id and need to coordinate them

    I have more than one Apple ID and cant coordinate them over my devices

  • Recent change from interleave to fastpath

    Hello I recently requested an change in the latency type for my internet from interleave to fastpath (my son plays online games and said it would be better) so I emailed the moderation team on this site for the change of which they have done. But now

  • Backup of nohup.out

    Hi, I am working on an application in which logs are log in nohup.out file. So the file size is increasing continuously and the it is too large. I want to take the backup of nohup.out file without starting the weblogic server in a regular interval of

  • Error - 41453 while uploading the data

    Hi, I am trying uploading the data with external ID's. I am getting error 41453 and none of the record is getting upload in CRM. Does any one can share their experience with such error. Nisman

  • HT1414 How do I email chat history in whatsapp?

    Hi all, I have noticed there is a function of email chat history in whatsapp and now I have urgent need for saving the conversation. However, no matter how many times i tried to send it from my phone, there's nothing in my email. Please help! Thanks