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".

Similar Messages

  • Problem in compiling servlets

    Hi
    I have j2sdk1.4.0 and i am using J2ee application server.My problem is while compiling i get error as "javax.servlet" package not found.Can anybody suggest me how to give the classpath for successful compilation.
    regrds
    Vaijayanthi

    hi vaiju
    basically it gets struck while finding as well loading the appropriate library files when there is a request for servlet.. tats where it gave the error of javax.servlet is missing..
    all servlet and jsp related files (class files) reside in this javax.servlet package.. its there javax.servlet jar or simply servlet.jar or even you can use the j2ee.jar which the superset of all of these..
    you can any one of the following 2 things:
    (1) you can either set the classpath of your pc to point to or include the location where it contains any of these .jar files
    (2) you can put the reqd lib files in the container's (web/app server's) location which it internally maintains for searching while loading/running the applications...
    here you have two options
    (a) either you can include the jar files with the individual applications (your applications WEB-INF/lib folder, which you can find inside the <TOMCAT_HOME>/webapps/ YOUR_APP_ROOT/WEB-INF/lib folder)
    (b) you can put the jar files in the common place of the container in case of being required by several applications (in case of tomcat, you can put in <TOMCAT_HOME>/common/lib folder).
    Dont forget to mention this in the build.xml file in case if you use ANT tool to build your application. you can set the <property> for the classpath.
    Hope this helps...
    Good luck to your journey in Servlets....

  • K9copy - kdelibs problem while compiling

    hello!
    got the PKGBUILD from the aur.
    http://aur.archlinux.org/packages/k9cop … y/PKGBUILD
    while compiling i had this problem:
    checking if UIC has KDE plugins available... no
    configure: error: you need to install kdelibs first.
    make: *** No targets specified and no makefile found. Stop.
    i have installed all depencies of k9copy (newest versions)!
    anyone has an idea?
    thx for any help!

    user5606182 wrote:
    How to identify which is causing?
    Login as DMTAPPS and issue
    SELECT  *
      FROM  USER_ERRORS
      WHERE NAME = 'DMT_UTILITY_PKG';Or select from all_errors/dba_errors:
    SELECT  *
      FROM  USER_ERRORS
      WHERE OWNER = 'DMTAPPS'
        AND NAME = 'DMT_UTILITY_PKG';SY.

  • Problem while compiling the Device Driver source code onSolaris 8 intel pla

    Hello!
    We are writing Device Driver for PCI (PMC) based HS serial
    communication card on Solaris 8(intel edition).The Processor
    used is Celeron/Pentium III.
    We are facing following problems.
    1) Kindly let us know the cc compiler options for xarch=isa.
    2) Presently we have included following header files.
         #include <sys/ddi.h>
         #include <sys/sunddi.h>
    3)We tried to compile our driver soure file (pmc.c) using
    FORTE DEVELOPER 6 UPDATE 1 with the following command.
         # cc -Xa -D_KERNEL -c pmc.c
    4) The compiler is not able to reach to our source code. It prematurely fails
    while compiling the system header files
    5) The errors were reported during Preprocessor
    compilation in /SYS/*.h header files.
    cc: Warning: using -Xa, ignoring all other -X options
    "/usr/include/iso/limits_iso.h", line 54: warning: macro redefined: SHRT_MIN
    "/usr/include/iso/limits_iso.h", line 56: warning: macro redefined: USHRT_MAX
    "/usr/include/iso/limits_iso.h", line 59: warning: macro redefined: UINT_MAX
    "/usr/include/sys/vnode.h", line 486: syntax error before or at: rlim64_t
    "/usr/include/sys/vnode.h", line 486: warning: undefined or missing type for: rlim64_t
    "/usr/include/sys/vnode.h", line 487: warning: undefined or missing type for: cred_t
    "/usr/include/sys/vnode.h", line 487: warning: undefined or missing type for: ssize_t
    "/usr/include/vm/page.h", line 468: undefined or not a type: pgcnt_t
    6)Kindly let us know :-
    a) if any Environment variables to be set.
    b) What all the system include headre files are required & in what sequence if any.
    Expecting a early reply .
    Can anybody help us.
    Thanking you for your kind co-operation.
    A.P.SINGH
    INDIA               

    Try to use cc comiler from /opt/SUNWspro/bin/ like
    /opt/SUNWspro/bin/cc -Xa -D_KERNEL -c pmc.c

  • 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

  • Problem in compiling servlet

    hi
    i'm trying to compile a simple servlet
    my directory structure is as follows
    c:\pr1
    |
    |____src
    |
    |______chservlet.java
    |
    |____classes
    |
    |____etc
    |
    |______web.xml
    c:\Tomcat5.0
    |
    |____webapps
    |
    |______ch1
    |
    |____WEB-INF
    |
    |____classes
    and the list of variables is as follows
    TOMCAT_HOME=c:\Tomcat 5.0\bin
    JAVA_HOME=c:\jsdk1.4
    classpath = %CLASSPATH%;c:\Tomcat 5.0\common\lib\servlet-api.jar
    now when i'm trying to compile the servlet by giving the following command
    javac -classpath ".;c:\Tomcat5.0\common\lib\servlet-api.ajr" -d classes c:\pr1\src\chservlet.java
    i'm getting the error package..
    javax.servlet.* doesnt exist
    can anybody help me at the earliest
    Regards
    jaismeen

    sorry guys..for starting each time new thread..just registered myself to the site yesterday after facing this problem..so cudnt get familiar with its working..
    i have given the commands as follows..
    set classpath=c:\Tomcat5.0\common\lib\servlet-api.jar,%classpath%
    set path=c:\jsdk1.4\bin;%path%
    javac c:\pr1\src\chservlet.java
    getting the following errors
    C:\>javac c:\pr1\src\chservlet.java
    c:\pr1\src\chservlet.java:1: package javax.servlet does not exist
    import javax.servlet.*;
    ^
    c:\pr1\src\chservlet.java:2: package javax.servlet.http does not exist
    import javax.servlet.http.*;
    ^
    c:\pr1\src\chservlet.java:5: cannot resolve symbol
    symbol : class HttpServlet
    location: class chservlet
    public class chservlet extends HttpServlet
    ^
    c:\pr1\src\chservlet.java:7: cannot resolve symbol
    symbol : class HttpServletRequest
    location: class chservlet
    public void doGet(HttpServletRequest req,HttpServletResponse res) throws IOExcep
    tion
    ^
    c:\pr1\src\chservlet.java:7: cannot resolve symbol
    symbol : class HttpServletResponse
    location: class chservlet
    public void doGet(HttpServletRequest req,HttpServletResponse res) throws IOExcep
    tion
    ^
    5 errors
    was just wondering.ihave windows xp..so does it effect in anyway(it shud not)
    and if name of the servlet is given wrong then it shudnt give these set of errors..it shud give kind a"cudnt find the file name"
    and i have checked the classpath..servlet-api.jar is present and is in this location
    c:\Tomcat 5.0\common\lib
    and i had tried giving the command
    jar -tvf servlet-api.jar..
    it gives the list of classes..which shows..its present in the directory
    jdk is present in c:\jsdk1.4
    location of servlet is c:\pr1\src\chservlet.java
    servlet code is as follows
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    public class chservlet extends HttpServlet
    public void doGet(HttpServletRequest req,HttpServletResponse res) throws IOException
    PrintWriter out =res.getWriter();
    java.util.Date today= new java.util.Date();
    out.println("<html>"+
    "<body>"+
    "<h1 align=center>HF\'s Chapter1 Servlet<h1>"
    +"<br>"+today+"</body>"+"</html>");
    even i tried copynig servlet-api.jar in the same directory as the servlet and compiling it..
    it gives the same set of errors
    am just wondering what cud be the problem.sure..must b very smal..but i m not progressing much
    regards

  • Problem in compiling servlet class - using Tomcat

    Hi,
    I have a servlet pgm that I'm trying to compile.I using Tomcat application server.I have my servlet class in D:\servlet_wrk\project1\src
    and my deployment descriptor in D:\servlet_wrk\project1\etc
    my CLASSPATH var is set to C:\Sun\AppServer\jdk\bin
    and
    my PATH var is set to C:\Sun\AppServer\bin.
    When I compile my servlet class Ch1Servlet.java in the command line from the directory
    D:\servlet_wrk\project1 using the command
    javac -classpath D:\applications\tomcat-5.5.12\common\lib\servlet-api.jar -d classes src/Ch1Servlet.java,
    it says error:cannot read: src/Ch1Servlet.java
    Can somebody help me to solve this problem and help me to compile my servlet class.
    Thanks.

    Thanks...as u said I tried putting dir & found that
    my file was saved as Ch1Servlet.java.txt instead for
    Ch1Servlet.java......So that was a problem.Now I'm
    able to compile.Oh, yeah. Notepad will do that to you. I think when you save in Notepad if you put quotes around the name "Whatever.java" then it won't add the .txt.
    But on compiling I'm getting the following error
    package java.servlet.* does not exist
    package java.servlet.http.* does not exist
    package java.io.* does not exist
    Do u the reason for this??? The servlet stuff is java[b]x.servlet. For the io stuff, I don't know, I'd have to see your code. Either you have a typo or a corrupt installation.

  • 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

  • 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"

  • Error while compiling Servlet

    Hello everyone,
    I am quite new to the Java Technology.
    I have this simple servlet program which gives me an error when I try to compile it.
    The error is as follows:
    TestServlet.java:1: package javax.servlet does not exist
    import javax.servlet.*;
    ^
    TestServlet.java:2: package javax.servlet.http does not exist
    import javax.servlet.http.*;
    ^
    Is this anything to do with the classpath or path settings?
    Any help would be highly appreciated.
    Thanks in advance,

    I have this file called servlet.jar which has some
    .class files.And this file is in the classpath.Just open it with WInZip or some ZIP viewing utility and check if the required classes are present.

  • 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 'dll' files in Form Server..Urgent

    Hi!
    I'm trying to compile the library(dll) in form server and getting a message that "can not open that file".At the same time able to compile 'fmb' files which is in the same directory.
    Could you please help me?
    Thank you,
    Denish

    I am also working on Forte. Forte has an inbuilt Tomcat. You dont need to copy any files to any where in the file mount system. You need to specify the External / Internal Browser settings, So that when you try to execute it, the .jsp file can be displayed in the browser. I havent faced any problem as you said.
    Uma
    http://www.javagalaxy.com

  • 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

  • Problem regarding compiling servlet

    Can any body pl help me
    I have installed tomcat 4.0 And suceesfully compiled all the jar file in <catalina Home>/Apache Tomcat 4.0/Common/lib including servlet.jar , when i want to compile i am getting httpservlet error like this.
    examp.java:6: cannot resolve symbol
    symbol : class HttpServlet
    location: class examp
    public class examp extends HttpServlet {
    ^
    Pl help me in this regard
    Thanking you
    anantha

    I am very new to Servlet..
    I have installed tomcat 4.0 And suceesfully compiled all the jar file in <catalina Home>/Apache Tomcat 4.0/Common/lib including servlet.jar
    I am getting " examp.java:1: package javax.servlet does not exist
    import javax.servlet.*;" .Please tell me how to solve this pbm
    Thanks
    anantha

  • Occi problems while compiling in linux

    hi guys
    i've been trying to compile the occi programming examples but i always get the following error.
    /tmp/ccNNJ2Rg.o(.occipool::gnu.linkonce.t.(void)+0x18): In function `occipool::occipool(void)':
    : undefined reference to `oracle::occi::Environment::createEnvironment(oracle::occi::Environment::Mode, void *, void *(*)(void *, unsigned int), void *(*)(void *, void *, unsigned int), void (*)(void *, void *))'
    /tmp/ccNNJ2Rg.o(.gnu.linkonce.t._._8occipool+0x15): In function `occipool::~occipool(void)':
    : undefined reference to `oracle::occi::Environment::terminateEnvironment(oracle::occi::Environment *)'
    /tmp/ccNNJ2Rg.o(.occipool::gnu.linkonce.t.select(void)+0x497): In function `occipool::select(void)':
    : undefined reference to `oracle::occi::SQLException type_info function'
    /tmp/ccNNJ2Rg.o(.occipool::gnu.linkonce.t.select(void)+0x4c8): In function `occipool::select(void)':
    : undefined reference to `oracle::occi::SQLException::SQLException(oracle::occi::SQLException const &)'
    /tmp/ccNNJ2Rg.o(.occipool::gnu.linkonce.t.select(void)+0x513): In function `occipool::select(void)':
    : undefined reference to `oracle::occi::SQLException::getErrorCode(void) const'
    /tmp/ccNNJ2Rg.o(.occipool::gnu.linkonce.t.select(void)+0x55c): In function `occipool::select(void)':
    : undefined reference to `oracle::occi::SQLException::getMessage(void) const'
    /tmp/ccNNJ2Rg.o(.occipool::gnu.linkonce.t.select(void)+0x5b2): In function `occipool::select(void)':
    : undefined reference to `oracle::occi::SQLException::~SQLException(void)'
    /tmp/ccNNJ2Rg.o(.occipool::gnu.linkonce.t.select(void)+0x60d): In function `occipool::select(void)':
    : undefined reference to `oracle::occi::SQLException::~SQLException(void)'
    collect2: ld returned 1 exit status
    i tried following the instructions in this forum about installing gcc 2.95.3. since i was using 3.2.2. I installed gcc ok but i still get the same problem. i think its something to do with the shared libraries or include paths but i cannt figure how. any help will be appreciated. am running redhat 9.0 and oracle 9 rs 2.
    regards solomon

    Hi all.
    I've same problems. I try to download and install 2.95.3 from http://gcc.gnu.org/releases.html (since there isn't any refercence to 2.96!) but the problems persist again.
    So I tryed to analyze the library with 'nm -CD $ORACLE_HOME/lib/libocci' and I saw there isn't no exported symbols, then I rebuild it with the object files found in $ORACLE_HOME/lib/libocci9.a' and now the library exports all function oracle::... but when I try to recompile the example demo/occidml I get the error
    /opt/gcc2.95/bin/g++ -o occidml -I. I/opt/oracle/oracle92/rdbms/public -L/opt/oracle/oracle92/lib -L/opta/oracle/oracle92/rdbms/lib -locci -lclntsh 'cat $ORACLE_HOMElib/sysliblist' occidml.cpp
    /opt/oracle/oracle92/lib/libocci.so: undefined reference to '__ctype-toupper'
    collect2: ld returned 1 exit status
    WHERE I CAN DOWNLOAD THE gcc2.96????

Maybe you are looking for

  • What causes selectOneChoice to be rendered as text instead of drop down?

    I notice that my UIInput components are being rendered as HTML text rather than their normal HTML tags when I specify a value in EL. For example, the selectOneChoice component is rendered as: &lt!-- Start: oracle.adf.SelectOne["ruleSelection"] --&gt&

  • How to add delimiters to the csv output sent to outlook?

    Hi, our application server 10.1.2 host oracle reports, we need to send the csv output of the oracle reports to the emails of clients, we can send in format = 'ascii' but delimiter such as double quote("), comma(,) can not be added.

  • [SOLVED]File journal: what's the recomended journal file size??

    After checking the journaling file journalctl --disk-usage Journals take up 679.5M on disk I have found that i have 680M of journal files, it's a good idea to limit these files to a smaller amount??? I'm using an 120GB ssd. I was thinking limit those

  • How to detect it left side Alt or right side Alt key pressed?

    Hi, I want to know if there is a way to detect whether it is the alt key on the left of the keyboard pressed or it is the alt key on the right side of the keyboard pressed. I don't want to use JNI stuff. Is there a 100% Java solution to it? Thanks

  • Panic Attack!

    Can any one tell me what this report means, and what the probable cause is: Sat Jan 17 20:50:48 2009 panic(cpu 0 caller 0x00C29288): "AppleDART::mapAddr(0x00ff0004) not mapped for I/O\n"@AppleDART.cpp:603 Latest stack backtrace for cpu 0: Backtrace: