Problem while jsp Servlet communication

dear,
i made a login.jsp and Validate.java (servlet), jsp is front-end while validate.java is backend servlet connect to database and check the login from the database, but when i run the example, i didnt show any result eventhough i have generated html page from servlet. Error is validate unreachable but i have coppied it inot correct directory (webapp/web-inf/classes)

Vijay,
Actually I looking for the same answer... I created an applet that connects to a servlet to do some database process.
The problem is that I got an java.security socket error when the client try to create an HttpServletConnection with the servlet...
Luis

Similar Messages

  • Security problems while applet servlet communication

    hi,
    iam using sun server for my application..iam calling an applet in a jsp page..when this applet loads it displays values which r retreived from other server using servlets..in applet init method iam calling a method called getDocClassDesc which is in applettoservet.java..in this method i will pass parameters to a servlet called interaction servlet..in servlet i will retreive parameter and call a bean method for getting docclassdesc..my problem is when i load this in browser it is not loading applet.and not showing anything..at the bottom of browser status bar showing that search applet not inited...
    what could be the problem..is it of permission policy of settings..if so i do set these things in sun server..give me the code also..
    if not any other problem plz give me hints..
    if i just display normal aplet without retreiving from servlet it is working fine..but when communicaion with servlet and retreivel then nothing..plz help me..
    regards,
    sam

    Trace would help maybe:
    To turn the full trace on (windows) you can start the java console, to be found here:
    C:\Program Files\Java\j2re1.4...\bin\jpicpl32.exe
    In the advanced tab you can fill in something for runtime parameters fill in this:
    -Djavaplugin.trace=true -Djavaplugin.trace.option=basic|net|security|ext|liveconnect
    if you cannot start the java console check here:
    C:\Documents and Settings\userName\Application Data\Sun\Java\Deployment\deployment.properties
    add or change the following line:
    javaplugin.jre.params=-Djavaplugin.trace\=true -Djavaplugin.trace.option\=basic|net|security|ext|liveconnect
    The trace is here:
    C:\Documents and Settings\your user\Application Data\Sun\Java\Deployment\log\plugin...log

  • Big Problem in Applet-Servlet Communication-(Help)

    I wrote an method to send serialized objects from Applet to Servlet,
    the method is as following:
    private ObjectInputStream postObjects (URL servlet, Serializable objs[], String sessionID) throws Exception {
    ObjectInputStream in = null;
    ObjectOutputStream out = null;
    try{
    URLConnection con = servlet.openConnection();
    con.setDoInput(true);
    con.setDoOutput(true);
    con.setUseCaches(false);
    con.setRequestProperty("Content-Type","application/x-java-serialized-object");
    con.setAllowUserInteraction(false);
    con.setRequestProperty("Cookie", sessionID);
    out = new ObjectOutputStream(con.getOutputStream());
    int numObjects = objs.length;
    for(int x = 0; x < numObjects; x++){
    out.writeObject(objs[x]);
    out.flush();
    out.close();
    in = new ObjectInputStream(con.getInputStream());
    }catch(Exception e){
    e.printStackTrace(System.err);
    throw e;
    }finally{
    return in;
    when I call this method, I got the following error message in Applet console,
    my platform is Salaris 5.8 + iPlanet 6.0.
    java.io.EOFException
         at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2150)
         at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2619)
         at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:726)
         at java.io.ObjectInputStream.<init>(ObjectInputStream.java:251)
         at com.shinewave.lms.core.client.ServletProxy.postObjects(ServletProxy.java:255)
         at com.shinewave.lms.core.client.ServletProxy.doInitialize(ServletProxy.java:76)
         at com.shinewave.lms.core.client.APIAdapterApplet.LMSInitialize(APIAdapterApplet.java:60)
    java.lang.NullPointerException
         at com.shinewave.lms.core.client.ServletProxy.doInitialize(ServletProxy.java:77)
         at com.shinewave.lms.core.client.APIAdapterApplet.LMSInitialize(APIAdapterApplet.java:60)
    java.lang.NullPointerException
         at com.shinewave.lms.core.client.ServletProxy.doInitialize(ServletProxy.java:82)
         at com.shinewave.lms.core.client.APIAdapterApplet.LMSInitialize(APIAdapterApplet.java:60)
    Please help me to solve this problem, thank you very much.

    Hi..
    Sorry abt this. But I was hoping if u could help out on this..
    I am trying to implement a applet to servlet communication...
    wherin the servlet would read data from the database... and send it back to the applet which gets displayed on the applet...
    But the problem is that the applet is not able to establish a connection with the servlet..
    I am also using another supportive class whose object is basically passed from the servlet to the applet..
    could u help me..
    below is the piece of code...
    APPLET:
    import java.net.*;
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.io.*;
    import java.util.*;
    public class TestApplet extends JApplet implements ActionListener
         JButton btnLoad;
         JTextField tfEmpno, tfFname, tfLname, tfSalary;
         URL url;
    private String webServerStr = null;
    private String hostName = "sandy";
    private int port = 8085;
    private String servletPath = "/jdbcTest.DBDetailsServlet";     
    public TestApplet()
         super();
    // suppress Warning Message
    getRootPane().putClientProperty"defeatSystemEventQueueCheck",Boolean.TRUE);
         public void actionPerformed(ActionEvent ae)
              if(btnLoad.getText().equals("Load"))
                   if(loadData())
                        btnLoad.setText("Save");
              else
                   btnLoad.setText("Load");
    //               saveData();
         public void init()
              setBackground(Color.pink);
              tfEmpno = new JTextField(10);
              tfFname = new JTextField(10);
              tfLname = new JTextField(10);
              tfSalary= new JTextField(10);
              JPanel panel = new JPanel();
              panel.setLayout(new FlowLayout());
              panel.add(tfEmpno);
              panel.add(tfFname);
              panel.add(tfLname);
              panel.add(tfSalary);
              getContentPane().add(panel, BorderLayout.CENTER);
              JPanel bottom = new JPanel(new FlowLayout());
              btnLoad = new JButton("Load");
              btnLoad.addActionListener(this);
              bottom.add(btnLoad);
              getContentPane().add(bottom, BorderLayout.SOUTH);
         public boolean loadData()
              try
         System.out.println("Web Server host name: " + hostName);
         webServerStr = "http://" + hostName + ":" + port + servletPath;
         System.out.println("Web String full = " + webServerStr);
                   String servletGET = webServerStr + "?"
         + URLEncoder.encode("UserOption") + "="
         + URLEncoder.encode("AppletDisplay");     
    //               url = new URL(getCodeBase(),"http://sandy:8080/servlet/jdbcTest.DBDetailsServlet");
                   System.out.println("Complete Servlet Url => " + servletGET);
                   url = new URL(servletGET);
                   URLConnection con = url.openConnection();
                   con.setUseCaches(false); // Turn off caching.
                   InputStream in = con.getInputStream();
                   System.out.println("\nsuccess ....... con.getInputStream() ");
                   ObjectInputStream ois = new ObjectInputStream(in);
                   System.out.println("\nsuccess ....... new ObjectInputStream(in) ");
                   Object object = ois.readObject();
                   System.out.println("\nGot the object from servlet...");
                   if(object != null)
                        System.out.println("\nObject NOT null ...");
                        ArrayList result = (ArrayList) object;
                        jdbcTest.EmployeeValue empval = (jdbcTest.EmployeeValue) result.get(0);
                        tfEmpno.setText(""+empval.getEmp_no());
                        tfFname.setText(empval.getFname());
                        tfLname.setText(empval.getLname());
                        tfSalary.setText(""+empval.getSalary());
                        System.out.println("\nObject processed " + result);
                        repaint();
                   return true;
              catch(Exception e)
                   e.printStackTrace();
                   System.out.println("\n\n loadData()=> E X C E P T I O N : " + e + "\n");
                   return false;               
         public void saveData()
              //yet to be implemented..
    SERVLEt:
    package jdbcTest;
    import java.util.*;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class DBDetailsServlet extends HttpServlet
         public void doGet(HttpServletRequest req,HttpServletResponse res )throws ServletException, IOException
              System.out.println("\nInside the doGet()\n");
              ArrayList results = getDetails();
              ObjectOutputStream oos = new ObjectOutputStream(res.getOutputStream());
              oos.writeObject(results);
         public void doPost(HttpServletRequest req,HttpServletResponse res )throws ServletException, IOException
              System.out.println("\nInside the doPost()\n");
              doGet(req,res);
         public ArrayList getDetails()
              try
                   System.out.println("\nServlet : inside GetDetails...");
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   java.sql.Connection con = java.sql.DriverManager.getConnection("jdbc:odbc:SandyDSN","","");
                   java.sql.Statement stmt = con.createStatement();
                   System.out.println("\n Statement created..");
                   java.sql.ResultSet rs = stmt.executeQuery("SELECT * FROM EMP WHERE EMP_NO = 222");
                   System.out.println("\n Query Executed...");
                   ArrayList results = new ArrayList();
                   while(rs.next())
                        EmployeeValue empval = new EmployeeValue();
                        empval.setEmp_no(rs.getLong("EMP_NO"));
                        empval.setFname(rs.getString("FNAME"));
                        empval.setLname(rs.getString("LNAME"));
                        empval.setSalary(rs.getLong("SALARY"));
                        results.add(empval);
                   System.out.println("\n Resultset Obtained...");
                   stmt.close();
                   con.close();
                   return results;
              catch(Exception e)
                   System.out.println("Error while retreiving details....." + e);
                   return null;
         public boolean saveDetails(EmployeeValue empval)
              try
                   return true;
              catch(Exception e)
                   System.out.println("Error while updating details....." + e);
                   return false;
    The utility class EMployeeValue is as below:
    package jdbcTest;
    import java.io.*;
    class EmployeeValue implements Serializable
         private long emp_no;
         private String fname;
         private String lname;
         private long salary;
         public EmployeeValue()
              super();
         public EmployeeValue(long eno, String fn, String ln,long sal)
              super();
              setEmp_no(eno);
              setFname(fn);
              setLname(ln);
              setSalary(sal);
         public long getEmp_no()
              return emp_no;
         public java.lang.String getFname()
              return fname;
         public java.lang.String getLname()
              return lname;
         public long getSalary()
              return salary;
         public void setEmp_no(long newEmp_no)
              emp_no = newEmp_no;
         public void setFname(java.lang.String newFname)
              fname = newFname;
         public void setLname(java.lang.String newLname)
              lname = newLname;
         public void setSalary(long newSalary)
              salary = newSalary;

  • Metadata problem with JSP/servlet application

    Hi,
    I developed a JSP/servlet test application that makes
    use of kodo 2.2.3 STANDARD EDITION for its persitence.
    I successfully compile and annotate the application.
    I am also able to successfully generate the db
    schema with schematool.
    Unfortunately, when I run the application using
    Resin 2.0.2, Kodo is unable to initialize properly.
    Initially it was not able to find "system.prefs" file.
    I fixed that by putting "system.prefs" in WEB-INF\classes.
    Unfortunately, Kodo is still unable to initialize and
    gives the following message:
    The system could not initialize; the following registered
    persistent types are missing metadata
    or have not been enhanced:
    [class com.dpov.purchaseorder.PurchaseOrder,
    class com.dpov.catalog.Product,
    class com.dpov.uidgen.counter.Counter,
    class com.dpov.catalog.dao.jdo.CategoryHierarchyEntry,
    class com.dpov.catalog.dao.jdo.CategoryHierarchyDAO,
    class com.dpov.pricelist.PriceInfo,
    class com.dpov.pricelist.PriceList,
    class com.dpov.catalog.Category,
    class com.dpov.lineitem.LineItem,
    class com.dpov.dealer.Dealer,
    class com.dpov.user.User,
    class com.dpov.customer.Customer].
    I use "system.jdo" to describe metadata for the enhancer.
    I tried to put it both in WEB-INF\lib and WEB-INF\classes but
    it still fails.
    Please note that:
    1) my classpath variable is not set
    2) my application's class file are in WEB-INF\classes
    3) kodo jars are in WEB-INF\lib
    4) mysql jdbc driver is in WEB-INF\lib
    5) system.prefs is in WEB-INF\classes
    6) system.jdo is in WEB-INF\classes
    Thanks in advance,
    Andrea
    system.prefs
    <?xml version="1.0"?>
    <prefs>
    <kodo-license-key>VALID KEY!</kodo-license-key>
    <db>
    <username></username>
    <password></password>
    <url>jdbc:mysql://localhost/kodo</url>
    <driver>org.gjt.mm.mysql.Driver</driver>
    <dictionary>
    com.solarmetric.kodo.impl.jdbc.schema.dict.MySQLDictionary
    </dictionary>
    <warn-on-persistent-type-failure>true</warn-on-persistent-type-failure>
    </db>
    <tm-location>java:/TransactionManager</tm-location>
    </prefs>
    system.jdo
    <?xml version="1.0"?>
    <jdo>
    <package name="com.dpov.uidgen.counter">
    <class name="Counter" />
    </package>
    <package name="com.dpov.customer">
    <class name="Customer" />
    </package>
    <package name="com.dpov.user">
    <class name="User" />
    </package>
    <package name="com.dpov.dealer">
    <class name="Dealer" />
    </package>
    <package name="com.dpov.catalog">
    <class name="Product" />
    </package>
    <package name="com.dpov.catalog">
    <class name="Category" />
    </package>
    <package name="com.dpov.catalog.dao.jdo">
    <class name="CategoryHierarchyDAO">
    <field name="categories">
    <collection element-type="com.dpov.catalog.Category"/>
    </field>
    </class>
    </package>
    <package name="com.dpov.catalog.dao.jdo">
    <class name="CategoryHierarchyEntry">
    <field name="attributeValues">
    <map key-type="String" value-type="CategoryHierarchyEntry"/>
    </field>
    <field name="productIds">
    <collection element-type="String"/>
    </field>
    </class>
    </package>
    <package name="com.dpov.lineitem">
    <class name="LineItem" />
    </package>
    <package name="com.dpov.purchaseorder">
    <class name="PurchaseOrder">
    <field name="lineItems">
    <collection element-type="com.dpov.lineitem.LineItem"/>
    </field>
    </class>
    </package>
    <package name="com.dpov.pricelist">
    <class name="PriceInfo" />
    </package>
    <package name="com.dpov.pricelist">
    <class name="PriceList">
    <field name="priceInfos">
    <map key-type="String" value-type="PriceInfo"/>
    </field>
    </class>
    </package>
    </jdo>

    Hi,
    I fixed my problem by setting the system wide variable (WindowsXP)
    CLASSPATH to r:\\dealershop\\WEB-INF\\classes.
    Thanks,
    Andrea
    andrea costantinis wrote:
    Hi,
    I developed a JSP/servlet test application that makes
    use of kodo 2.2.3 STANDARD EDITION for its persitence.
    I successfully compile and annotate the application.
    I am also able to successfully generate the db
    schema with schematool.
    Unfortunately, when I run the application using
    Resin 2.0.2, Kodo is unable to initialize properly.
    Initially it was not able to find \"system.prefs\" file.
    I fixed that by putting \"system.prefs\" in WEB-INF\\classes.
    Unfortunately, Kodo is still unable to initialize and
    gives the following message:
    The system could not initialize; the following registered
    persistent types are missing metadata
    or have not been enhanced:
    [class com.dpov.purchaseorder.PurchaseOrder,
    class com.dpov.catalog.Product,
    class com.dpov.uidgen.counter.Counter,
    class com.dpov.catalog.dao.jdo.CategoryHierarchyEntry,
    class com.dpov.catalog.dao.jdo.CategoryHierarchyDAO,
    class com.dpov.pricelist.PriceInfo,
    class com.dpov.pricelist.PriceList,
    class com.dpov.catalog.Category,
    class com.dpov.lineitem.LineItem,
    class com.dpov.dealer.Dealer,
    class com.dpov.user.User,
    class com.dpov.customer.Customer].
    I use \"system.jdo\" to describe metadata for the enhancer.
    I tried to put it both in WEB-INF\\lib and WEB-INF\\classes but
    it still fails.
    Please note that:
    1) my classpath variable is not set
    2) my application\'s class file are in WEB-INF\\classes
    3) kodo jars are in WEB-INF\\lib
    4) mysql jdbc driver is in WEB-INF\\lib
    5) system.prefs is in WEB-INF\\classes
    6) system.jdo is in WEB-INF\\classes
    Thanks in advance,
    Andrea

  • Problem in Applet Servlet communication in cluster

              Our new production server has been configured with
              clusters very recently.The application is running fine if and only if one instance
              of weblogic is running.The application has two applets that communicate through a
              servlet and the servlet is hosted by both the WL servers in the cluster.
              Please consider the following scenario :
              1. JSP#1(having embedded tag for Applet#1) is served by, say, WLInstance#1.
              2. JSP#2(having embedded tag for Applet#2) is served by, say, WLInstance#2.
              3. Applet#1 is loaded by BrowserInstance#1.
              4. Applet#2 is loaded by BrowserInstance#2.
              The way I understand applet-servlet communication is as follows :
              The servlets are invoked through the url-pattern specified in web.xml - if the applet
              is making use of a certain url-pattern that is mapped to servlet, then the call from
              that applet will
              eventually invoke a servlet on any of the two instances till a session is established,
              at which point all subsequent requests from the same browser window/frame will go
              to the servlet hosted on the instance where the http session was created.
              (Please correct me, if I am wrong.)
              So, Applet#1 will always talk to the servlet hosted by WLInstance#1 and Applet#2
              will always talk to the servlet hosted by WLInstance#2.
              In our case, the servlet is maintaining data structures to store all the messages
              sent by diffterent instances of Applets.
              The applets periodically polls the messages from those data structures.Once the messages
              are polled, those are deleted from
              the data structures.
              As there are two different instances of the servlet, Applet#1 never gets messages
              posted by Applet#2.
              Is there a way to make this data structure global to both the servlet instances?
              Thanks and best regards,
              Subir Das
              

              "Subir Das" <[email protected]> wrote:
              >So, Applet#1 will always talk to the servlet hosted by WLInstance#1 and
              >Applet#2
              >will always talk to the servlet hosted by WLInstance#2.
              This statement is not entirely true.
              Suppose WLInstance#1 were to be brought down (for whatever reason), Applet#1 will
              then talk to servlet hosted by WLInstance#2.
              Server pinning could be modified by different load balancing algorithms, configurable
              via containers (or hardware).
              So don't count on which servlet instance your applet is going to be served by.
              Instead consider to give a second look into the design of the servlet data structure
              (object):
              1.Read from data store, if it has been persisted.
              2.If the data is client related then consider sticking the data into session, which
              would then replicate to other WL instances.
              3.Stateless EJB in a cluster ? Don' know much about this(yet).
              My 2 cents..Good luck.
              Rama
              

  • Problem while assigning Servlet to Execute queue

    Hi,
    We implement a IMS S-CSCF on BEA container 2.2.
    A call for us may be several times reentrant. Meaning that for one call we have to handle at least three different dialogs but in major use cases, it will be 6 or 7 for our next deployment.
    We are currently facing to bottlenecks problems and BEA support advised me to try to check if assigning servelt to execute queue could improve the preformances.
    I just wanted to make a try with one of our servlet but I have an exception java.lang.NoClassDefFoundError: org/jaxen/JaxenException.
    Here is what I did:
    In web.xml I have:
    <web-app>
    <distributable/>
    <servlet>
    <servlet-name>register</servlet-name>
    <servlet-class>com.netcentrex.scscf.registrar.RegistrarServlet</servlet-class>
    <init-param>
    <param-name>wl-dispatch-policy</param-name>
    <param-value>REGISTRARQueue</param-value>
    </init-param>
    <load-on-startup/>
    </servlet>
    <listener>
    <listener-class>com.bea.wcp.sip.engine.server.ContextEventHook</listener-class>
    </listener>
    </web-app>
    In sip.xml I have:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE sip-app
    PUBLIC "-//Java Community Process//DTD SIP Application 1.0//EN"
    "http://www.jcp.org/dtd/sip-app_1_0.dtd">
    <sip-app>
    <display-name>SIP Servlet based Registrar</display-name>
    <distributable/>
    <context-param>
    <param-name>usc.configFile</param-name>
    <param-value>/etc/neotip/usc.ini</param-value>
    </context-param>
    <context-param>
    <param-name>icscf.configFile</param-name>
    <param-value>/etc/neotip/icscf.ini</param-value>
    </context-param>
    <context-param>
    <param-name>usc.dnsSrvFile</param-name>
    <param-value>/etc/neotip/uscDnsSrv.cache</param-value>
    </context-param>
    <listener>
         <listener-class>com.netcentrex.scscf.session.SessionServlet</listener-class>
    </listener>
    <servlet>
    <servlet-name>register</servlet-name>
    <servlet-class>com.netcentrex.scscf.registrar.RegistrarServlet</servlet-class>
    <load-on-startup/>
    </servlet>
    <servlet>
         <servlet-name>session</servlet-name>
         <servlet-class>com.netcentrex.scscf.session.SessionServlet</servlet-class>
         <load-on-startup/>
    </servlet>
    <servlet>
         <servlet-name>route</servlet-name>
         <servlet-class>com.netcentrex.scscf.fork.RouteServlet</servlet-class>
         <load-on-startup/>
    </servlet>
    <servlet>
         <servlet-name>icscf</servlet-name>
         <servlet-class>com.netcentrex.scscf.embeddedI.IEmbeddedServlet</servlet-class>
         <load-on-startup/>
    </servlet>
    <servlet-mapping>
    <servlet-name>register</servlet-name>
    <pattern>
    <equal>
         <var>request.method</var>
         <value>REGISTER</value>
    </equal>
    </pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>session</servlet-name>
    <pattern>
         <and>
              <not>
              <equal>
                        <var>request.method</var>
                        <value>REGISTER</value>
              </equal>
              </not>
              <not>
         <exists>
                   <var>request.uri.param.uscroute</var>
              </exists>
              </not>
              <not>
         <exists>
                   <var>request.uri.param.icscfroute</var>
              </exists>
              </not>
         </and>
    </pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>route</servlet-name>
    <pattern>
         <and>
              <not>
              <equal>
                        <var>request.method</var>
                        <value>REGISTER</value>
              </equal>
              </not>
              <exists>
              <var>request.uri.param.uscroute</var>
         </exists>
         </and>
    </pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>icscf</servlet-name>
    <pattern>
         <and>
              <not>
              <equal>
                        <var>request.method</var>
                        <value>REGISTER</value>
              </equal>
              </not>
              <exists>
         <var>request.uri.param.icscfroute</var>
         </exists>
         </and>
    </pattern>
    </servlet-mapping>
    <session-config>
         <session-timeout>30</session-timeout>
    </session-config>
    </sip-app>
    In msi-config.xml, we have:
    <Server Cluster="BEA_ENGINE_TIER_CLUST" EnabledForDomainLog="false"
    ListenAddress="192.168.150.26" ListenPort="8001" Name="engine1"
    NativeIOEnabled="true" NetworkAccessPoints="sipchannel"
    ServerVersion="8.1.5.0" StdoutDebugEnabled="true"
    StdoutEnabled="true" StdoutSeverityLevel="64">
    <NetworkAccessPoint ListenAddress="192.168.150.34"
    ListenPort="5060" Name="sipchannel" Protocol="sip"
    PublicAddress="192.168.150.34" SourcePorts="41000-42000"/>
    <SSL Enabled="false" IdentityAndTrustLocations="KeyStores" Name="engine1"/>
    <Log FileCount="10" FileMinSize="60000" Name="engine1" NumberOfFilesLimited="true"/>
    <ExecuteQueue Name="sip.transport.Default" QueueLength="2048" ThreadCount="25"/>
    <ExecuteQueue Name="REGISTRARQueue" QueueLength="2048" ThreadCount="25"/>
    <ExecuteQueue Name="sip.transport.Default" QueueLength="2048" ThreadCount="25"/>
    <ExecuteQueue Name="weblogic.kernel.Default"/>
    <ExecuteQueue Name="sip.timer.Default" QueueLength="2048" ThreadCount="25"/>
    <ExecuteQueue Name="sip.tracing.local" QueueLength="1024"
    ThreadCount="1" ThreadsMaximum="1" ThreadsMinimum="1"/>
    <ExecuteQueue Name="sip.tracing.domain" QueueLength="1024"
    ThreadCount="1" ThreadsMaximum="1" ThreadsMinimum="1"/>
    </Server>
    Then when I launch a SIP REGISTRATION operation I get the following trace:
    2007-05-30 17:37:03,649 ERROR RegistrarServlet [ExecuteThread: '23' for queue: 'sip.transport.Default'] : Error while processing request: REGISTER sip:netcentrexbench.net SIP/2.0
    P-Charging-Vector: icid-value=AyretyU0dm+1970294253=0465138796
    P-Access-Network-Info: ADSL;dsl-location="netcentrexbench.net;1.2.3.4"
    CSeq: 2 REGISTER
    Call-ID: [email protected]
    Supported: path
    Via: SIP/2.0/UDP 192.168.254.56:5063;branch=z9hG4bK-19606-1-2
    From: dench0 <sip:[email protected]>;tag=1
    Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO
    To: dench0 <sip:[email protected]>
    Authorization: Digest username="dench0",realm="netcentrexbench.net",cnonce="6b8b4567",nc=00000001,qop=auth,uri="sip:192.168.150.34:5060",nonce="NQei3RIBAAA=le+kkCcrZcahXxQ7M6r7dw==",response="b824a93822b267ddfaa07f4039d99d95",algorithm=MD5
    Content-Length: 0
    Contact: sip:[email protected]:5063
    User-Agent: LYNX_BENCH
    Path: <sip:[email protected]:5063;lr>
    Require: path
    Expires: 36000
    Max-Forwards: 70
    java.lang.NoClassDefFoundError: org/jaxen/JaxenException
    at org.dom4j.DocumentFactory.createXPath(DocumentFactory.java:230)
    My first doubt is that I think I should get "ERROR RegistrarServlet [ExecuteThread: '23' for queue: 'REGISTRARQueue'] " instead of "ERROR RegistrarServlet [ExecuteThread: '23' for queue: 'sip.transport.Default'] "
    First question: did I miss something or did something wrong in the configuration?
    Second question: is it really possible to assign a single servlet (from an application containing many other servlets) to a dediacted execute queue?
    Third question: any help is welcome :-)
    Thanks in advance,
    Lionel,

    At teh end I found the basic :-) problem on my exception but anyway , the used execute queue for REGISTER is always sip.transport.default
    Help on this point is welcome!
    Thanks

  • Synchronized problem in JSP/Servlet, please help me.

    Hi, all
    I have many processes in one JSP page or Servlet program of my project.
    When many people visit at one time, then the project throws some SQL/DB Errors.
    I have updated it and test it many times, I think, that is a synchronized problem.
    At last I used ��synchronized (this){my JSP/Servlt SQL/DB processes}�� to synchronize
    The process. Then the errors removed.
    And now I think that too danger to use the ��synchronized (this){}�� to synchronized.
    If use it then some other problem may be growling on. Such as when one people need to use
    This service others must to wait, the process may be too slow! And when an exception throws
    from the SQL/DB or some other place, what I do? Need any advice from you.
    Sincerely
    Urey
    *** my JSP/Servlt Server is tomcat ***

    As Chuck points out, there isn't a new instance of the Servlet/JSP for each request - they are probably all calling the same instance so any state will be shared. If your Connection is stored as a member variable then you'll have problems with it already being in use if two people hit the page at the same time.
    Limited resources such as database connections should ideally be pooled anyway to ensure that you're not opening them all the time and that you can control how many are open across the entire application. Then you'd simply need to get a fresh connection out of the pool at the top of the page and make sure you put it back when you're done.
    Incidentally, although it might work, synchronizing the database access in the JSP would be a bad idea since you'd just create a queue of requests waiting to use the one Connection whereas you really need a number of Connections to deal with everyone simultaneously.
    If you need some example code for a simple JSP using a database connection pool (DataSource) just say.
    Hope this helps.

  • Problem while using servlets

    hello sir,
    I am having problem working with the hellosevlet example.I am not getting any error nor any response from the server. I have try this on JWS and weblogic appication server. but I have the same problem. do I have to make any setting in my server? or what else is the problem?
    midlet code
    import java.io.*;
    import javax.microedition.io.*;
    import javax.microedition.lcdui.*;
    import javax.microedition.midlet.*;
    public class FirstServlet extends MIDlet {
    private Display display;
    String url =      
    "http://localhost:8080/servlet/HelloServlet";
    public FirstServlet() {
    display = Display.getDisplay(this);
    public void startApp() {
    try {
    invokeServlet(url);
    } catch (IOException e) {
    System.out.println("IOException " + e);
    e.printStackTrace();
    public void pauseApp() { }
    public void destroyApp(boolean unconditional) { }
    void invokeServlet(String url) throws IOException {
    HttpConnection c = null;
    InputStream is = null;
    StringBuffer b = new StringBuffer();
    TextBox t = null;
    try {
    c = (HttpConnection)Connector.open(url);
    c.setRequestMethod(HttpConnection.GET);
    c.setRequestProperty("User-Agent", "Profile/MIDP-1.0 Configuration/CLDC-1.0");
    c.setRequestProperty("Content-Language", "en-CA");
    is = c.openDataInputStream();
    int ch;
    while ((ch = is.read()) != -1) {
    b.append((char) ch);
    t = new TextBox("First Servlet",
         b.toString(), 1024, 0);
    } finally {
    if(is!= null) {
    is.close();
    if(c != null) {
    c.close();
    display.setCurrent(t);
    servlet code
    import java.io.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class HelloServlet extends GenericServlet {
    public void service(ServletRequest request,
         ServletResponse response)
    throws IOException, ServletException {
    response.setContentType("text/plain");
    PrintWriter out = response.getWriter();
    out.println("Servlet invoked!");
    out.println(new Date());
    firstserlvet.jad
    MIDlet-1: MyFirstServlet, , FirstServlet
    MIDlet-Description: My First Servelt
    MIDlet-Info-URL: http://java.sun.com/j2me/
    MIDlet-Jar-Size: 1068
    MIDlet-Name: MyFirstServlet
    MIDlet-Vendor: Sun Microsystems. Inc
    MIDlet-Version: 1.0.0
    MIDlet-jar-URL: firstservlet.jar
    MicroEdition-Configuration: CLDC-1.0
    MicroEdition-Profile: MIDP-1.0
    -------------

    Hi, in your MIDlet code, since you are opening up a HTTPConnection. So logically, your servlet should extend
    HTTPServlet as well instead of Generic Servlet.
    As for your URL address, try not to use localhost, instead use the IP address 127.0.0.1 if you want to connect to localhost or the actual IP address of your computer if you want to connect remotely.
    You can find the actual IP address this way if you are using Win 98
    1) Go to command prompt (MS Dos Prompt)
    2) Type "winipcfg"
    For Win 2000
    1) Go to command prompt
    2) Type "ipconfig"
    For Linux
    1) Go to terminal mode
    2) Type "ifconfig"

  • Problem while calling servlet from java bean

    I am trying to call a servlet from java bean in cep.
    My java bean:
    package com.bea.wlevs.example.algotrading;
    import com.bea.wlevs.ede.api.StreamSink;
    import com.bea.wlevs.example.algotrading.event.MarketEvent;
    import javax.xml.bind.JAXBContext;
    import javax.xml.bind.Unmarshaller;
    import java.io.BufferedReader;
    import java.io.BufferedWriter;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.OutputStreamWriter;
    import java.io.StringReader;
    import java.net.MalformedURLException;
    import java.net.URL;
    import java.net.URLConnection;
    public class MarketEventBean implements StreamSink {
         String s=null;
         public void onInsertEvent(Object event) {
              if (event instanceof MarketEvent) {
                   MarketEvent marketEvent = (MarketEvent) event;
                   try {
                        JAXBContext cxt = JAXBContext.newInstance(MarketEvent.class);
                        Unmarshaller unmarsh = cxt.createUnmarshaller();
                        StringReader strReader = new StringReader(marketEvent.getString_1());
                        MarketEvent obj = (MarketEvent) unmarsh.unmarshal(strReader);
                        s=obj.getSymbol();
                        System.out.println("data: " + s);
                   } catch(Exception e) {
                        e.printStackTrace();
                   try {
                        System.out.println("test1");
         URL url = new URL("http://172.18.21.94:7001/AppServletrecv-Model-context-root/ReceiveServlet");
         URLConnection conn = url.openConnection();
              System.out.println("test2");
         conn.setDoOutput(true);
              System.out.println("test3");
         BufferedWriter out =
         new BufferedWriter( new OutputStreamWriter( conn.getOutputStream() ) );
         out.write("symbol="+s);
              System.out.println("test4");
         out.flush();
         System.out.println("test5");
         out.close();
         System.out.println("test6");
         BufferedReader in =
         new BufferedReader( new InputStreamReader( conn.getInputStream() ) );
              System.out.println("test7");
         String response;
         while ( (response = in.readLine()) != null ) {
         System.out.println( response );
         in.close();
         catch ( MalformedURLException ex ) {
         // a real program would need to handle this exception
         catch ( IOException ex ) {
         // a real program would need to handle this exception
    My servlet code:
    package model;
    import javax.servlet.http.HttpServlet;
    import java.io.IOException;
    import java.io.PrintWriter;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    public class ReceiveServlet extends HttpServlet {
    private final static String _SYMBOL = "symbol";
    public void doPost(HttpServletRequest request, HttpServletResponse response) {
    * Get the value of form parameter
    // private final static String USERNAME = "username";
    String symbol = request.getParameter( _SYMBOL );
    * Set the content type(MIME Type) of the response.
    response.setContentType("text/html");
    * Write the HTML to the response
    try {
    PrintWriter out = response.getWriter();
    out.println("<html>");
    out.println("<head>");
    out.println("<title> A very simple servlet example</title>");
    out.println("</head>");
    out.println("<body>");
    out.println("<h1>Hello " + symbol +"</h1>");
    out.println("</body>");
    out.println("</html>");
    out.close();
    } catch (IOException e) {
    Web.xml:
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <web-app 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"
    version="2.5" xmlns="http://java.sun.com/xml/ns/javaee">
    <servlet>
    <servlet-name>ReceiveServlet</servlet-name>
    <servlet-class>model.ReceiveServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>ReceiveServlet</servlet-name>
    <url-pattern>/ReceiveServlet</url-pattern>
    </servlet-mapping>
    </web-app>
    My servlet is running in weblogic server.
    But when I am running this program in weblogic server side there is no log.
    Edited by: 856272 on Jun 23, 2011 6:43 AM

    I would run both sides in a debugger and see what code is getting invoked

  • Problem while compiling Servlet

    M using Tomcat.
    Environment variables :
    Variable :::::::::::::::: Values
    %TOMCAT_HOME% ::::::::::: C:\Tomcat\bin
    CLASSPATH :::::::::::::::: .;C:\jdk 1.4.2\lib;C:\jsdk2.1 \servlet.jar;C:\Tomcat\lib\servlet.jar;
    PATH ::::::::::::::::::::: ;C:\jdk 1.4.2\bin
    JAVA_HOME :::::::::::::::: C:\jdk 1.4.2
    Now problem is that When m trying to compile GreetingServlet.java
    problems are:::
    GreetingServlet.java:31: cannot resolve symbol
    symbol : method Println (java.lang.String)
    location: class java.io.PrintWriter
    out .Println("<BODY>");
    ^
    GreetingServlet.java:32: cannot resolve symbol
    symbol : method Println (java.lang.String)
    location: class java.io.PrintWriter
    out .Println("<p>"+message +","+name+"</p>");
    ^
    GreetingServlet.java:33: cannot resolve symbol
    symbol : method Println (java.lang.String)
    location: class java.io.PrintWriter
    out .Println("<p> Thanks ("+email+")</p>");
    ^
    GreetingServlet.java:34: cannot resolve symbol
    symbol : method Println (java.lang.String)
    location: class java.io.PrintWriter
    out .Println("<p> -The Pro Java Team.</p>");
    ^
    GreetingServlet.java:35: cannot resolve symbol
    symbol : method Println (java.lang.String)
    location: class java.io.PrintWriter
    out .Println("</BODY>");
    ^
    GreetingServlet.java:36: cannot resolve symbol
    symbol : method Println (java.lang.String)
    location: class java.io.PrintWriter
    out .Println("</HTML>");
    ^
    Source Code:
    import javax.servlet.* ;
    import javax.servlet.http.* ;
    import java.io.* ;
    import java.util.* ;
    public class GreetingServlet extends HttpServlet{
    protected void doPost (HttpServletRequest request,
                   HttpServletResponse response)
                        throws ServletException, IOException {
         String name = request.getParameter ("name");
         String email = request.getParameter ("email");
         String message = null;
         GregorianCalendar calendar = new GregorianCalendar();
         if (calendar.get(Calendar.AM_PM) == Calendar.AM) {
              message =" Good Morning";
         else {
              message = " Good Afternoon";
         response.setContentType("text/html");
         PrintWriter out = response.getWriter();
         out .println("<HTML>");
         out .Println("<BODY>");
         out .Println("<p>"+message +","+name+"</p>");
         out .Println("<p> Thanks ("+email+")</p>");
         out .Println("<p> -The Pro Java Team.</p>");
         out .Println("</BODY>");
         out .Println("</HTML>");
         out .close();
    Thanks in Advance
    Please its an urjent.
    Hoping to get the solution soon from cream like you in Programming.

    hi
    it could be you have caps P.
    try:
    "println" instead of "Println".

  • JSP/Servlet communication

    Hi all
    I want to populate a list containing domain objects in a servlet and then send the list to a JSP but without storing them in a HttpSession. I'm leaning toward storing the list as a ServletRequest attribute and then reading the attribute from the JSP - is this a good convention?
    Thanks!

    let me rephrase that, what's the best way of sending domain objects via a servlet to a JSP without using http sessions?

  • Problem with Applet Servlet communication

    Hi All,
    i am very new to java and servlets......
    i am using a applet to call a servlet whose .class file is stored in WEB_INF/classes directory of tomcat..
    so what URL address i should use in the new URL( ) constructor ????
    presently i have done in this manner..
    URL urlServlet = new URL("http://l0.0.2.65:8080/myapp.ServletDB");
    URLConnection con = urlServlet.openConnection();
    where ServletDB is the name of the servlet .class file
    whose address is as follows...
    C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\myapp\WEB-INF\classes\ServletDB.class
    Please help me....
    thank you in advance
    vijay

    Specify Servlet Mapping in web.xml and use that mapped URL
    <servlet>
          <servlet-name>getItems</servlet-name>    
    <servlet-class>myapp.ServletDB</servlet-class>
      </servlet>
    <servlet-mapping>
          <servlet-name>getItems</servlet-name>
          <url-pattern>/ServletDB</url-pattern>
      </servlet-mapping>look at servlet mapping- url-pattern
    Now u should use that mapped url while creating URL connection
    here is the code.
    URL urlServlet = new URL("http://l0.0.2.65:8080/ServletDB");
    URLConnection con = urlServlet.openConnection();[Java Servlet tutorials|http://www.jsptube.com]

  • HttpURLConection.getInputStream() problem in applet/servlet communication

    I have set property con.setRequestProperty("Content-type",
    "application/octet-stream");
    in java applet that is supposed to communicate with servlet
    Also I have set resp.setContentType("application/octet-stream");
    in servlets Service method,
    But when I try ro getinput stream back in applet It gives an 405 error on DOS Prompt at this line
    DataInputStream in =new DataInputStream(con.getInputStream());
    On debugging I found from con.getContentType() just before this
    line that it returns text/html;charset=ISO-8859-1 (which i suppose
    should be application/octec-stream)
    I don't have any more clues please help.

    search the forum........

  • Netscape problem with applet servlet communication

    Netscape always seems to get in the way when you use applets, right?
    I have a nice set of code from a book that shows how to do applet->servlet stuff.
    But although I'm doing this all in the privacy of my own localhost Netscape immediately put a spanner in the works with a security exception and wouldn't let the servlet respond.
    Anyone know what to do here.
    The answer is to use Internet Explorer, possibly, but I'm in linux, and I can't get Opera to work with java yet.
    Anyone got any ideas? Thanks.

    I encountered a security exception with Netscape in Linux when attempting applet-servlet stuff but that's prpbably because I haven't got the plugin for that yet...in fact I don't know if a plugin is available for sure...let me know if you do. As a matter of fact I plan on using the HTMLConverter this weekend to find out if it'll download a plugin.
    The applet-servlet thing runs fine in IE and Netscape on my Windows box as long as the plugins are there and I use the appropriate plugin tags in the HTML
    Post what you find out,
    Brad

  • Applet to servlet communication

    Hi all,
    I am having a problem about applet servlet communication.
    I am having a string array object in the applet which I want to
    pass it to the servlet for further processing.
    Please help me to solve this problem.It is very urgent.
    If you can send me the code for that I would be very thankful to you all.
    Feel free to mail me at [email protected]

    I guess you are stugling with the sollution of how to send an object from an applet to the
    servlet:
    Sollution is here:
    http://forum.java.sun.com/thread.jspa?threadID=625045&messageID=3562787
    Assuming that all these posts are about solving the same problem:
    http://forum.java.sun.com/thread.jspa?threadID=642015&messageID=3783853#3783853
    http://forum.java.sun.com/thread.jspa?threadID=642013&messageID=3783839#3783839
    http://forum.java.sun.com/thread.jspa?threadID=641689&messageID=3779038#3779038
    http://forum.java.sun.com/thread.jspa?threadID=641685&messageID=3779004#3779004

Maybe you are looking for