Servlet receiving UTF-16 parameter

I am attempting to build a servlet to receive a parameter encoded in UTF-16. At this stage, I am able to receive and process UTF-8 parameters but not UTF-16. I believe this is due to the request.getParameter() method not finding the encoded parameter name. My servlet code is:
request.setCharacterEncoding("UTF-16");
String xmlStr = request.getParameter("xml");When I send the encoded request I do:
System.out.println("Parameters:");
for (Enumeration e = request.getParameterNames() ; e.hasMoreElements() ;)
    String s = (String)e.nextElement();
    System.out.println(s);
     for (int i=0; i< s.length(); i++)
         System.out.println(s.codePointAt(i));
}and via the Tomcat stdout log get:
Parameters:
30720
27904
27648
which would indicate it received the parameter xml yet the request.getParameter("xml") returns null.
How can I retrieve the encoded parameter value?

I believe the previous problem was a combination of two issues:
1) The UTF-16 was being encoded in little endian, Java was reading it as big endian.
2) The JVM appears to append the character <fffd> to each query parameter and each value. This is defined in Unicode to be a 'Replacement Character' and since it is included as part of the parameter causes that parameter not to match that being searched for.
My new issue is this:
I can find and thus retrieve the xml parameter from the request, however, it appears to take no notice of the encoding specified. I have printed the bytes contained in the complete input string and verified they contain the null (00) character for the half width latin characters. However, once request.getParameter() is called, these characters are lost and the resultant string is invalid UTF-16.
So <xml> goes from x00 x3c, x00 x78, x00 x6d, x00 x6e, x00 x3e (10 bytes) to x3c, x78, x6d, x6e, x3e (5 bytes)
How can I correctly parse my request parameter as being UTF-16 encoded?

Similar Messages

  • How to Receive soap input parameter value in BPEL

    Hi
    Please provide the solution to receive the input parameter value from a soap call i.e. . invoking a BPEL process from a PL/SQL client and with input parameter value.
    Following Xpath expression does not work ,if a value is passed from SOAP input parameter
    bpws:getVariableData('receiveInput_process_InputVariable','payload',/client:Test_ExternalcallProcessRequest/client:input).
    This works fine only if avalue is passed from 'client' partnerlink(from console).
    Please do the needful.

    Hi
    Thank you for your response
    sample PL/SQL code to call a BPEL process along with some input parameter
    req P_A2a_Call_Bpelprocess.request;
    resp P_A2a_Call_Bpelprocess.response;
    inputvar VARCHAR2(100) := ' START PROCESS';
    ls_method VARCHAR2(25) := 'process';
    ls_namespace VARCHAR2(100) := 'xmlns="http://xmlns.oracle.com/Helloworld"';
    ls_url     VARCHAR2(254) := 'http://nooslux036t.gl.2wglobal.com:7777/orabpel/A2A/Helloworld/1.0';
    BEGIN
    req := P_A2a_Call_Bpelprocess.new_request(ls_method, ls_namespace);
    P_A2a_Call_Bpelprocess.add_parameter(req, 'input', 'xsd:string', inputvar);
    resp := P_A2a_Call_Bpelprocess.invoke(req, ls_url,ls_method);
    The input value is 'START PROCESS' and Can I get this value from Xpath experssion usiing bpws:getVariableData or any other function? .Please let me know.
    sample Xpath expression to get 'client' partnerlink data.
    bpws:getVariableData('receiveInput_process_InputVariable','payload',/client:Test_ExternalcallProcessRequest/client:input).
    Thanks in advance

  • Servlet Receives IOException

              Hi,
              Listed below is an exception that comes normally when we launch
              our application on WebLogic. We have hosted the application on
              a Unix Box with the following config.
              Here are the details:
              Unix Box(RAM 1 GB, CPU 1 400 MHZ,HD 70 GB).
              AppServer(weblogic5.1.0)
              Java Heap --> -ms30m -mx60m
              Tue Mar 13 11:19:14 GMT+05:30 2001:<E> <ServletContext-General>
              Servlet failed with Exception
              java.io.IOException: Broken pipe
              at java.net.SocketOutputStream.socketWrite(Native Method)
              at java.net.SocketOutputStream.write(SocketOutputStream.java:87)
              at weblogic.servlet.internal.ChunkUtils.writeChunks(ChunkUtils.java:88)
              at weblogic.servlet.internal.ResponseHeaders.writeHeaders(ResponseHeaders.java:336)
              at weblogic.servlet.internal.ServletResponseImpl.writeHeaders(ServletResponseImpl.java:603)
              at weblogic.servlet.internal.ServletOutputStreamImpl.flush(ServletOutputStreamImpl.java:101)
              at weblogic.servlet.internal.ServletOutputStreamImpl.writeStream(ServletOutputStreamImpl.java:430)
              at weblogic.servlet.FileServlet.sendFile(FileServlet.java:199)
              at weblogic.servlet.FileServlet.service(FileServlet.java:56)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:105)
              at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:742)
              at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:686)
              at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:247)
              at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:361)
              at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:261)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              Tue Mar 13 11:19:16 GMT+05:30 2001:<E> <ServletContext-General>
              Servlet failed with Exception
              java.io.IOException: Broken pipe
              at java.net.SocketOutputStream.socketWrite(Native Method)
              at java.net.SocketOutputStream.write(SocketOutputStream.java:87)
              at weblogic.servlet.internal.ChunkUtils.writeChunks(ChunkUtils.java:88)
              at weblogic.servlet.internal.ResponseHeaders.writeHeaders(ResponseHeaders.java:336)
              at weblogic.servlet.internal.ServletResponseImpl.writeHeaders(ServletResponseImpl.java:603)
              at weblogic.servlet.internal.ServletOutputStreamImpl.flush(ServletOutputStreamImpl.java:101)
              at weblogic.servlet.internal.ServletOutputStreamImpl.writeStream(ServletOutputStreamImpl.java:430)
              at weblogic.servlet.FileServlet.sendFile(FileServlet.java:199)
              at weblogic.servlet.FileServlet.service(FileServlet.java:56)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
              

    Rajah,
              These message doesn't indicate anything wrong. This is a known issue in wls5.1.
              Basically these messages are indicating that browser stopped receiving response while server is still writing
              response. (May be because user clicked on browser stop or network failure.......)
              Thanks,
              Kumar.
              Rajah wrote:
              > Hi,
              >
              > Listed below is an exception that comes normally when we launch
              > our application on WebLogic. We have hosted the application on
              > a Unix Box with the following config.
              >
              > Here are the details:
              >
              > Unix Box(RAM 1 GB, CPU 1 400 MHZ,HD 70 GB).
              > AppServer(weblogic5.1.0)
              >
              > Java Heap --> -ms30m -mx60m
              >
              > Tue Mar 13 11:19:14 GMT+05:30 2001:<E> <ServletContext-General>
              > Servlet failed with Exception
              > java.io.IOException: Broken pipe
              > at java.net.SocketOutputStream.socketWrite(Native Method)
              > at java.net.SocketOutputStream.write(SocketOutputStream.java:87)
              > at weblogic.servlet.internal.ChunkUtils.writeChunks(ChunkUtils.java:88)
              > at weblogic.servlet.internal.ResponseHeaders.writeHeaders(ResponseHeaders.java:336)
              > at weblogic.servlet.internal.ServletResponseImpl.writeHeaders(ServletResponseImpl.java:603)
              > at weblogic.servlet.internal.ServletOutputStreamImpl.flush(ServletOutputStreamImpl.java:101)
              > at weblogic.servlet.internal.ServletOutputStreamImpl.writeStream(ServletOutputStreamImpl.java:430)
              > at weblogic.servlet.FileServlet.sendFile(FileServlet.java:199)
              > at weblogic.servlet.FileServlet.service(FileServlet.java:56)
              > at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
              > at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:105)
              > at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:742)
              > at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:686)
              > at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:247)
              > at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:361)
              > at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:261)
              > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
              >
              > Tue Mar 13 11:19:16 GMT+05:30 2001:<E> <ServletContext-General>
              > Servlet failed with Exception
              > java.io.IOException: Broken pipe
              > at java.net.SocketOutputStream.socketWrite(Native Method)
              > at java.net.SocketOutputStream.write(SocketOutputStream.java:87)
              > at weblogic.servlet.internal.ChunkUtils.writeChunks(ChunkUtils.java:88)
              > at weblogic.servlet.internal.ResponseHeaders.writeHeaders(ResponseHeaders.java:336)
              > at weblogic.servlet.internal.ServletResponseImpl.writeHeaders(ServletResponseImpl.java:603)
              > at weblogic.servlet.internal.ServletOutputStreamImpl.flush(ServletOutputStreamImpl.java:101)
              > at weblogic.servlet.internal.ServletOutputStreamImpl.writeStream(ServletOutputStreamImpl.java:430)
              > at weblogic.servlet.FileServlet.sendFile(FileServlet.java:199)
              > at weblogic.servlet.FileServlet.service(FileServlet.java:56)
              > at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
              

  • Servlet receiving response????

    We would like to set up a servlet that sends a request to an outside
              website, receives the response from that website, parses the html stream and
              then displays HTML to the browser.
              Does anyone know where we can find any documentation or examples on this or
              does anyone have any ideas that may get us started in the right direction?
              Thanks!
              Paul
              

              Do a Google search on URLConnection example
              Mike
              "Paul Zila" <[email protected]> wrote:
              >We would like to set up a servlet that sends a request to an outside
              >website, receives the response from that website, parses the html stream
              >and
              >then displays HTML to the browser.
              >
              >Does anyone know where we can find any documentation or examples on this
              >or
              >does anyone have any ideas that may get us started in the right direction?
              >
              >Thanks!
              >Paul
              >
              >
              

  • Using MSXML2.ServerXMLHttp in MS SQL 2012 - receiving error "The Parameter is incorrect".

    I have a procedure used to make http post requests to a REST web service external to my SQL server, using MSXML2.ServerXMLHttp via POST request. This procedure works without issue in SQL 2008 r2, but upon upgrade to 2012, begins to fail with the message
    : "The Parameter is incorrect."
    It is failing when I attempt to exec the 'send' method on line 137. I cannot find any documentation about how the MSXML2.ServerXMLHttp object needs to be treated differently in 2012. I found a similar question here: http://social.technet.microsoft.com/Forums/sqlserver/en-US/a6de1eea-5fe9-4087-809b-524c98f20a4d/msxml6dll-methodsend-dont-work-in-windows-server-2012-and-sql-2008r2?forum=sqlxml 
    But it isn't resovled - just indications to file a bug report - and one solution that says to just copy the DLL from 2008 over to 2012 to fix the issue. Is that really the right solution here or does someone have information on how to do this properly with
    2012?
    Here is my procedure:
    CREATE procedure [dbo].[HTTP_REQUEST](@response varchar(4000) out, 
    @method varchar(64),
    @p1name varchar(256) = null,
    @p1value varchar(max) = null,
    @p2name varchar(256) = null,
    @p2value varchar(max) = null,
    @p3name varchar(256) = null,
    @p3value varchar(max) = null,
    @p4name varchar(256) = null,
    @p4value varchar(max) = null,
    @p5name varchar(256) = null,
    @p5value varchar(max) = null,
    @p6name varchar(256) = null,
    @p6value varchar(max) = null,
    @parent_table varchar(30) = null
    As
    Declare
    @obj int
    ,@hr int
    ,@status int
    ,@msg varchar(255)
    ,@apiKey varchar (64)
    ,@params varchar (max)
    SET @apiKey = (Select a.default_value from T_DEFAULTS a WHERE a.parent_table = @parent_table AND a.field_name = 'm2apiKey')
    SET @params = ''
    If @apiKey is null
      Begin
    select @msg = 'Invalid mail2 APIKey'
    RAISERROR(@msg, 11, 2) WITH SETERROR
    return -101
      End
    If @method is null
      Begin
    select @msg = 'No valid mail2 API method provided'
    RAISERROR(@msg, 11, 2) WITH SETERROR
    return -101
      End
    exec @hr = sp_OACreate 'MSXML2.ServerXMLHttp', @obj OUT
    if @hr <> 0 begin Raiserror('sp_OACreate MSXML2.ServerXMLHttp.3.0
    failed', 16,1) return end
    exec @hr = sp_OAMethod @obj, 'open', NULL, 'POST', 'http://api.someapiurl.net/REST/', true
    if @hr <>0 begin set @msg = 'sp_OAMethod Open failed' goto eh end
    exec @hr = sp_OAMethod @obj, 'setRequestHeader', NULL, 'Content-Type',
    'application/x-www-form-urlencoded'
    if @hr <>0 begin set @msg = 'sp_OAMethod setRequestHeader failed' goto
    eh end
    --Set Timeouts
    exec @hr = sp_OAMethod @obj, 'setTimeouts',NULL,5000,5000,10000,10000
    if @hr <>0 begin set @msg = 'sp_OAMethod setTimeouts failed' goto
    eh end
    --Add Method
    SET @params = '&method='+@method
    --Add API key
    SET @params = @params + '&key='+@apiKey
    --Add p1 if present
    IF @p1name IS NOT NULL
    BEGIN
    SET @params = @params + '&' + @p1name + '=' + @p1value
    END
    --Add p2
    IF @p2name IS NOT NULL
    BEGIN
    SET @params = @params + '&' + @p2name + '=' + @p2value
    END
    --Add p3
    IF @p3name IS NOT NULL
    BEGIN
    SET @params = @params + '&' + @p3name + '=' + @p3value
    END
    --Add p4
    IF @p4name IS NOT NULL
    BEGIN
    SET @params = @params + '&' + @p4name + '=' + @p4value
    END
    --Add p5
    IF @p5name IS NOT NULL
    BEGIN
    SET @params = @params + '&' + @p5name + '=' + @p5value
    END
    --Add p6
    IF @p6name IS NOT NULL
    BEGIN
    SET @params = @params + '&' + @p6name + '=' + @p6value
    END
    --SELECT @params
    --Send the request
    exec @hr = sp_OAMethod @obj, send, NULL, @params
    if @hr <>0 begin set @msg = 'sp_OAMethod Send failed' goto eh end
    --Get the status
    exec @hr = sp_OAGetProperty @obj, 'status', @status OUT
    if @hr <>0 begin set @msg = 'sp_OAGetProperty read status failed on get status' goto
    eh
    end
    if @status <> 200 begin set @msg = 'sp_OAMethod http status ' +
    str(@status) goto eh end
    if @status = 200 begin print 'sp_OAMethod http status is 200:Successful ' +
    str(@status) + @params end
    exec @hr = sp_OAGetProperty @obj, 'responseText', @response OUT
    if @hr <>0 begin set @msg = 'sp_OAGetProperty read response failed on get response text error code' + convert(varchar,@hr) goto
    eh end
    exec @hr = sp_OADestroy @obj
    return
    eh:
    exec @hr = sp_OADestroy @obj
    Raiserror(@msg, 16, 1)
    return
    Many thanks for the input - 
    Chris

    How can I fix the problem? changing the OS? I just bought the new server. I do?
    thanks
    Miky
    Rambaldi

  • Why my servlet receives NoClassDefFoundError : javax/servlet/http/HttpSession

    I developed an application which has one servlet.
    The war context-root that has the servlet is 'workflowclient'.
    When invoking the servlet with URL "http://localhost/workflowclient/WfAgentManagerSRMIServlet, an exception with NoClassDefFoundException is raised.
    Why ?
    The fortune example operates well.
    Please let me know how to solve this problem.

    Hi,
    I would like to go through your code, if it isn't properietry, please send me the codes so that I can have a look and test at my end to provide you results.
    Thanks & Regards
    Ganesh .R
    Developer Technical Support
    Sun Microsystems
    http://www.sun.com/developers/support

  • Hi all - Am receiving the "bad parameter" error when trying to save a PDF w/ Reader 10.1.0

    I've read through various topics and many point to the source of the PDF, but using other versions of Reader.
    Other users - not using version 10.1.0 - but previous version, do not have this problem.
    I am not sure if the client is able to download and install another version of Reader, as their network is locked down.
    Any tips or suggestions?
    OS = Win7.

    Pls try updating to the latest version of Adobe Reader i.e. 10.1.4 and see if it solves your problem. The new version has lots of fixes which may solve your issue.

  • Parameter to servlet

    Hi, somebody can tell me how a generic servlet can get a parameter from a JSP/JSF/ADF page?
    Thanks

    Thanks Shay. But I´m work with login and psw. If I use servlet url, I show psw in the url. I would like a sample code kind:
    public void doPost(HttpServletRequest request,
    HttpServletResponse response) throws ServletException, IOException {response.setContentType(CONTENT_TYPE);
    FacesContext fc = FacesContext.getCurrentInstance();
    ExternalContext ec = fc.getExternalContext();
    HttpServletRequest request1 = (HttpServletRequest)fc.getExternalContext().getRequest();
    String nome = request1.getParameter("username");
    String psw = request.getParameter("password");
    etc, etc, etc...
    Is it exist? When I try use that code, I receive a nullPointException...
    Any idea?

  • Applet servlet communication problem again

    applet send the data to servlet, servlet receive the data and send a message back to applet, but there is an exception error.
    // servlet
    public void doPost (HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
         Connection theConnection;
         boolean check = false;
         // Get the value of a request parameter; the name is case-sensitive
            String name = "key1";
            String value = request.getParameter(name);
           try{
                //Loading Sun's JDBC ODBC Driver  
                Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                theConnection = DriverManager.getConnection("jdbc:odbc:database1", "", "");
                Statement theStatement=theConnection.createStatement();
                String sql = "SELECT col_name FROM table_name WHERE col_name ='"+value+"''";
                ResultSet rs = theStatement.executeQuery(sql);
                if(rs.next()){
                    check = true;
                theStatement.close();//Close statement
                theConnection.close(); //Close database Connection
            }catch (ClassNotFoundException e) {
            System.err.println("ClassNotFoundException : " +e);
            asdf.write(e.toString().getBytes("US-ASCII"));
            } catch (SQLException e) {
                System.err.println("SQL exception : " +e);
                asdf.write(e.toString().getBytes("US-ASCII"));
            if(check){
              try{
                   ObjectOutputStream objStream = null;
                   objStream = new ObjectOutputStream(response.getOutputStream());
                   String message = "your input is already exist in col_name in table_name ";
                   objStream.writeObject(message);
                   objStream.flush();
                   objStream.close();
               catch(Exception ex){
                    asdf.write(ex.toString().getBytes("US-ASCII"));
    //applet
    private void recordSeg()  throws ClassNotFoundException, MalformedURLException, IOException{
                *  Try to connect to the servlet
              try {
                // Construct data
                String data = URLEncoder.encode("key1", "UTF-8") + "=" + URLEncoder.encode("hello", "UTF-8");
                // Send data to sqlServlet
                URL url = new URL(http://localhost:8084/JSP/sqlServlet");
                URLConnection conn = url.openConnection();
                conn.setDoOutput(true);
                OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
                wr.write(data);
                wr.flush();
                // Get the response
                BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
                String line;
                while ((line = rd.readLine()) != null) {
                    // Process line...
                wr.close();
                rd.close();
            } catch (Exception e) {
              //receive data from sqlServlet
            try{
                URL url = new URL(server + "JSP/sqlServlet");
                 URLConnection servletConnection = url.openConnection();
                servletConnection.setUseCaches (false);
                servletConnection.setDefaultUseCaches(false);
    / *+++++++++error line (java.io.IOException: Server returned HTTP response code: 405 for URL: http://localhost:8084/JSP/sqlServlet) */
                ObjectInputStream inputFromServlet = new ObjectInputStream(servletConnection.getInputStream());
                String temp_s = inputFromServlet.readObject().toString();
                inputFromServlet.close();
            catch(Exception ex){
                errField.append("Exception ~~~~~~~~~ " +ex+ "\n");
        }

    Sorry, I have put the code tab but ...................................
    applet send the data to servlet, servlet receive the data and send a message back to applet, but there is an exception error.
    //servlet
    public void doPost (HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
         Connection theConnection;
         boolean check = false;
         // Get the value of a request parameter; the name is case-sensitive
            String name = "key1";
            String value = request.getParameter(name);
           try{
                //Loading Sun's JDBC ODBC Driver  
                Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                theConnection = DriverManager.getConnection("jdbc:odbc:database1", "", "");
                Statement theStatement=theConnection.createStatement();
                String sql = "SELECT col_name FROM table_name WHERE col_name ='"+value+"''";
                ResultSet rs = theStatement.executeQuery(sql);
                if(rs.next()){
                    check = true;
                theStatement.close();//Close statement
                theConnection.close(); //Close database Connection
            }catch (ClassNotFoundException e) {
            System.err.println("ClassNotFoundException : " +e);
            asdf.write(e.toString().getBytes("US-ASCII"));
            } catch (SQLException e) {
                System.err.println("SQL exception : " +e);
                asdf.write(e.toString().getBytes("US-ASCII"));
            if(check){
              try{
                   ObjectOutputStream objStream = null;
                   objStream = new ObjectOutputStream(response.getOutputStream());
                   String message = "your input is already exist in col_name in table_name ";
                   objStream.writeObject(message);
                   objStream.flush();
                   objStream.close();
               catch(Exception ex){
                    asdf.write(ex.toString().getBytes("US-ASCII"));
    //applet
    private void recordSeg()  throws ClassNotFoundException, MalformedURLException, IOException{
                *  Try to connect to the servlet
              try {
                // Construct data
                String data = URLEncoder.encode("key1", "UTF-8") + "=" + URLEncoder.encode("hello", "UTF-8");
                // Send data to sqlServlet
                URL url = new URL(http://localhost:8084/JSP/sqlServlet");
                URLConnection conn = url.openConnection();
                conn.setDoOutput(true);
                OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
                wr.write(data);
                wr.flush();
                // Get the response
                BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
                String line;
                while ((line = rd.readLine()) != null) {
                    // Process line...
                wr.close();
                rd.close();
            } catch (Exception e) {
              //receive data from sqlServlet
            try{
                URL url = new URL(server + "JSP/sqlServlet");
                 URLConnection servletConnection = url.openConnection();
                servletConnection.setUseCaches (false);
                servletConnection.setDefaultUseCaches(false);
    / /+error line (java.io.IOException: Server returned HTTP response code: 405 for URL: http://localhost:8084/JSP/sqlServlet)
                ObjectInputStream inputFromServlet = new ObjectInputStream(servletConnection.getInputStream());
                String temp_s = inputFromServlet.readObject().toString();
                inputFromServlet.close();
            catch(Exception ex){
                errField.append("Exception ~~~~~~~~~ " +ex+ "\n");
    }

  • Application vs. Servlet

    I have an application that parses an XML file whose URL is received as a parameter.
    I have created a servlet that calls this application. I changed the main methods to callable "public void MethodName()". The servlet needs to call one class and then another. It will call the first class, but throws this error when attempting to call the second:
    [Servlet Error]-[com/ibm/etools/xmlschema/beans/BaseType]: java.lang.NoClassDefFoundError: com/ibm/etools/xmlschema/beans/BaseType
    Why would this class work in an application and not in a servlet??
    Application code:
    BeFreeRequestSAXParser.java
    - this runs and then calls XMLDataParser.java
    - XMLDataParser dp = new XMLDataParser();
    dp.loadExistingInstance( uri.toString()); (Works great)
    Serlvet code:
    CustomersAlsoPurchased.java
    - this calls BeFreeRequestSAXParser (works fine)
    - BeFreeRequestSAXParser tries to call XMLDataParser but does not
    work.
    Any suggestions?

    [Servlet
    Error]-[com/ibm/etools/xmlschema/beans/BaseType]:
    java.lang.NoClassDefFoundError:
    com/ibm/etools/xmlschema/beans/BaseTypeIn general servlet containers use a modified class loader hierachy, you should consult the documentation of your servlet container. This matters, because you have to make sure any extra classes are made available when they are not part of the jdk or the container itself.
    With tomcat you either have to place them in the folder shared by all contexts or in the WEB-INF/lib, or figure out another way.
    http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html

  • Using EXECUTE IMMEDIATE with an NVARCHAR2 parameter

    Hi everyone,
    In the system I'm working on, my stored procedure receives an NVARCHAR2 parameter which contains a complete SQL statement. e.g.
    'UPDATE SomeTable SET SomeTable.Value = 0'
    I want to be able to execute this dynamically, using EXECUTE IMMEDIATE, but I've encountered a problem where this is apparently not supported (because the string is Unicode).
    It is crucial that the string stays as Unicode, because of the data that may possible be baked into the SQL statement, and so casting it off to a VARCHAR2, or changing the parameter type, is not acceptable.
    Is there a work-around for this issue? Even if it has a performance hit, it will be better than nothing :)
    I've tried something like this;
    declare
    myVal VARCHAR2(256);
    begin
    myVal := 'UPDATE SomeTable SET SomeTable.Value = 2';
    execute immediate 'BEGIN :x; END;' using myVal;
    end;
    But I get an error;
    "bind variable 'X' not allowed in this context"
    Has anyone any ideas?
    Thanks for your help,
    Chris

    uhmm, I'm not sure if this is a valid testcase. the string could still be converted into ascii or we8iso8859p1 or whatever 1byte-character set you want.
    What I think you should test is a two-byte character as part of SQL, PL/SQL resp. as in SQL all words are defined you can not enlarge it with a 2byte word. But in PL/SQL you could define your own variable. If this variable name itself contains a 2byte character, I guess it will fail.
    (I have used l_vär and l_vér as variable names in my example)
    Message was edited by:
    Leo Mannhart
    According to the PL/SQL Reference Guide PL/SQL consists of:
    PL/SQL programs are written as lines of text using a specific set of characters:
    Upper- and lower-case letters A .. Z and a .. z
    Numerals 0 .. 9
    Symbols ( ) + - * / < > = ! ~ ^ ; : . ' @ % , " # $ & _ | { } ? [ ]
    Tabs, spaces, and carriage returns
    This seems no longer up-to-date as I could define a variable l_vär for instance as long as I use a 1byte char set (like iso8859p1). The same variable name as a n-byte char set like UTF-8 will give an error as my example shows.

  • How to display XML file in browser using Servlets?

    Hi My XML file is like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:purchase_order_MT xmlns:ns0="http://filetohttp.com">
    <ORDER_HEADER_IN>
    <purchase_date/>
    <purchase_group/>
    <purchase_org/>
    </ORDER_HEADER_IN>
    <vendor/>
    <ORDER_ITEMS_IN>
    <item>
    <storage_location/>
    <plant/>
    <quantity/>
    <material/>
    </item>
    </ORDER_ITEMS_IN>
    <ORDER_SCHEDULES_IN>
    <item>
    <delivery_date/>
    </item>
    </ORDER_SCHEDULES_IN>
    </ns0:purchase_order_MT>
    My Servlet receives this XML file and it should display the above XML as it is, How to do that?
    Please help me I have posted same question in many forums but i got no proper reply.
    Thanks a lot

    If you only need to display it, consider your HttpServletRequest just as byte stream. :) Just read from ServletInputStream and write it back into ServletOutputStream of HttpServletResponse.
    If you want to process incoming XML, please give some details first, what exactly you want to do. :)

  • Mail adapter and UTF-7 encoded messages

    Hi,
    a customer of us wants to know if it is possible to receive UTF-7 encoded messages using the Mail adapter.
    Is there a configurable parameter to do this? Or is the only solution to change the Mail adapter code. If so are there examples available?
    Thanks!

    Tamil,
    The best thing would be create alerts for both the mapping and adapter alerts. If there is any mapping failure then an email will be send to you. With adapter alerts if there any errors on adapters it will send you a mail. You dont need a fault message for it.
    Check this weblogs for creating alerts:
    /people/michal.krawczyk2/blog/2005/09/09/xi-alerts--step-by-step
    /people/michal.krawczyk2/blog/2005/09/09/xi-alerts--troubleshooting-guide
    ---Satish

  • Process + Servlet to invoke process + form + database

    GetMortgageForm process
    The following illustration shows the GetMortgageForm process (see Figure 2).
    Figure 2. A LiveCycle ES process that returns an interactive form.
    Note: This document does not describe how to create a process by using Adobe LiveCycle Workbench ES. (For information, see Workbench ES Help.)
    The following table describes the steps in this diagram.
    Operation Description
    1 The user submits a custom identifier value and the operation to perform. In this situation, assume that the user is applying for a mortgage. The input parameters for this process are a string value that specifies the form name (named formName) and another string value that represents the custom identifier value (named custId).
    Note: In the Java application logic located in the Java servlet, the formName and custId process variables are referenced.
    2 The process uses the customer identifier value to perform a relational database look-up for additional customer information by using the JdbcService service's Execute SQL Statement operation. The custom identifier value acts as the primary key value.
    3 Merges customer data into an XML data source that is used to prepopulate the form. (See "Prepopulating Dynamic Forms" in Programming with LiveCycle ES.)
    4 The mortgage form is rendered with customer data located in some of the fields, such as the address field. This action is based on the Forms service's renderPDFForm operation.
    The Java servlet receives the form (return value for the process) and writes the form to a client web browser. The name of the output parameter is RenderedForm. This parameter is a process variable and its data type is FormsResult.
    Note: In the Java application logic located in the Java servlet that invokes this process, the RenderedForm process variable is referenced.
    This interactive loan form is rendered by the GetMortgageForm process (see Figure 3).
    Figure 3. An interactive form.
    Note: This document describes how to use the Invocation API to invoke a LiveCycle ES process. It is recommended that you are familiar with the Invocation API before you follow along with this document. (See "Invoking LiveCycle ES Processes" in Programming with LiveCycle ES.)
    Summary of steps
    To create a Java servlet that invokes a LiveCycle ES process, perform the following steps:
    1. Create a new web project.
    2. Create Java application logic that represents the Java servlet.
    3. Create the web page for the web application.
    4. Package the web application to a WAR file.
    5. Deploy the WAR file to the J2EE application server.
    6. Test your web application.
    Note: Some of these steps depend on the J2EE application on which LiveCycle ES is deployed. For example, the method you use to deploy a WAR file depends on the J2EE application server that you are using. This document assumes that LiveCycle ES is deployed on JBoss®.
    Creating a web project
    The first step to create a Java servlet that can invoke a LiveCycle ES process is to create a new web project. The Java IDE that this document is based on is Eclipse 3.3. Using the Eclipse IDE, create a web project and add the required JAR files to your project. Finally, add an HTML page named index.html and a Java servlet to your project.
    The following list specifies the JAR files that you must add to your web project:
    adobe-forms-client.jar
    adobe-livecycle-client.jar
    adobe-usermanager-client.jar
    adobe-utilities.jar
    For the location of these JAR files, see "Including LiveCycle ES Java library files" in Programming with LiveCycle ES.
    Note: The adobe-forms-client.jar file is required because the process returns a FormsResult object, which is defined in this JAR file.
    To create a web project:
    1. Start Eclipse and click File > New Project.
    2. In the New Project dialog box, select Web > Dynamic Web Project.
    3. Type InvokeMortgageProcess for the name of your project and then click Finish.
    To add required JAR files to your project:
    1. From the Project

    Peter - Set the Source Used attribute of P42_FK1 to "Only,..." .
    Scott

  • Jsp / Servlet / bean / upload

    Hello,
    I use a jsp to enter several fields. These fields are sent to a servlet by using a bean (recorded in the current session). Until now there is no problem. The servlet receives all information. Now I must also send 5 files which must be stored on the server. I have thus to add in my jsp 5 file fields.
    My question :
    Is it possible to integrate the FileUpload package for uploader my files without anything to change in my code (by using of a bean to exchange the data between my jsp and my servlet). ??
    In other words, it is possible to use my bean to also transport files. ??
    Tank u for u help

    Yes it is possible..
    download cos.jar from www.oreily.com for file upload..
    it will read dat from the form as two parts ..
    parameter part and file part..
    and you can implement it throgh a servlet easily..
    for more follow oreily JSP/servlets Cookbook

Maybe you are looking for

  • Soap Receiver : how to convert application/xml of payload to text/xml?

    I get a purchase order xml from SRM with payload as "MainDocument(application/xml)". The receiving system is a Webmethods service that can only accept text/xml. If I try using the testing facility of the runtime workbench (Testing tab under IE under

  • Documenting GTS Configuration

    GTS Experts, What is the best practice for documenting the configuration settings in GTS?  Are there system reports available to control and report  this, or is it expected that this information is kept manually in spreadsheets? Also, what is best pr

  • UTL FILE saving as csv file

    I have this line of code: DECLARE l_Date DATE := SYSDATE; BEGIN l_file := utl_file.fopen('UTL_TMP_DIR','ZERORISATION_'||l_Date||'.csv', 'w' ); END;I encountered this error while running my query with the line above : PLS-00103: Encountered the symbol

  • Why is my mac so LOUD?

    The fan runs all the time. I don't know if I never noticed it before, or if this is new. But I find myself wanting to turn off my computer so I can get some quiet. Is there something I can do?

  • Cuestiones sobre disoo duro lenovo Z50-70 con i7-4510u

    Buenas,el ordenador incluye de fabrica un disco duro hdd de 500 gb y uno ssd de 8gb.me gustaria saber si puedo cambiar el disco duro hdd de 500 gb que incluye el ordenador por uno ssd, aunque ya incluya uno de 8 gb y cuanto admitira la segunda entrad