How to get an XML string from a Java Bean without wrting to a file first ?

I know we can save a Java Bean to an XML file with XMLEncoder and then read it back with XMLDecoder.
But how can I get an XML string of a Java Bean without writing to a file first ?
For instance :
My_Class A_Class = new My_Class("a",1,2,"Z", ...);
String XML_String_Of_The_Class = an XML representation of A_Class ?
Of course I can save it to a file with XMLEncoder, and read it in using XMLDecoder, then delete the file, I wonder if it is possible to skip all that and get the XML string directly ?
Frank

I think so too, but I am trying to send the object to a servlet as shown below, since I don't know how to send an object to a servlet, I can only turn it into a string and reconstruct it back to an object on the server side after receiving it :
import java.io.*;
import java.net.*;
import java.util.*;
class Servlet_Message        // Send a message to an HTTP servlet. The protocol is a GET or POST request with a URLEncoded string holding the arguments sent as name=value pairs.
  public static int GET=0;
  public static int POST=1;
  private URL servlet;
  // the URL of the servlet to send messages to
  public Servlet_Message(URL servlet) { this.servlet=servlet; }
  public String sendMessage(Properties args) throws IOException { return sendMessage(args,POST); }
  // Send the request. Return the input stream with the response if the request succeeds.
  // @param args the arguments to send to the servlet
  // @param method GET or POST
  // @exception IOException if error sending request
  // @return the response from the servlet to this message
  public String sendMessage(Properties args,int method) throws IOException
    String Input_Line;
    StringBuffer Result_Buf=new StringBuffer();
    // Set this up any way you want -- POST can be used for all calls, but request headers
    // cannot be set in JDK 1.0.2 so the query string still must be used to pass arguments.
    if (method==GET)
      URL url=new URL(servlet.toExternalForm()+"?"+toEncodedString(args));
      BufferedReader in=new BufferedReader(new InputStreamReader(url.openStream()));
      while ((Input_Line=in.readLine()) != null) Result_Buf.append(Input_Line+"\n");
    else     
      URLConnection conn=servlet.openConnection();
      conn.setDoInput(true);
      conn.setDoOutput(true);           
      conn.setUseCaches(false);
      // Work around a Netscape bug
      conn.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
      // POST the request data (html form encoded)
      DataOutputStream out=new DataOutputStream(conn.getOutputStream());
      if (args!=null && args.size()>0)
        out.writeBytes(toEncodedString(args));
//        System.out.println("ServletMessage args: "+args);
//        System.out.println("ServletMessage toEncString args: "+toEncodedString(args));     
      BufferedReader in=new BufferedReader(new InputStreamReader(conn.getInputStream()));
      while ((Input_Line=in.readLine()) != null) Result_Buf.append(Input_Line+"\n");
      out.flush();
      out.close(); // ESSENTIAL for this to work!          
    return Result_Buf.toString();               // Read the POST response data   
  // Encode the arguments in the property set as a URL-encoded string. Multiple name=value pairs are separated by ampersands.
  // @return the URLEncoded string with name=value pairs
  public String toEncodedString(Properties args)
    StringBuffer sb=new StringBuffer();
    if (args!=null)
      String sep="";
      Enumeration names=args.propertyNames();
      while (names.hasMoreElements())
        String name=(String)names.nextElement();
        try { sb.append(sep+URLEncoder.encode(name,"UTF-8")+"="+URLEncoder.encode(args.getProperty(name),"UTF-8")); }
//        try { sb.append(sep+URLEncoder.encode(name,"UTF-16")+"="+URLEncoder.encode(args.getProperty(name),"UTF-16")); }
        catch (UnsupportedEncodingException e) { System.out.println(e); }
        sep="&";
    return sb.toString();
}As shown above the servlet need to encode a string.
Now my question becomes :
<1> Is it possible to send an object to a servlet, if so how ? And at the receiving end how to get it back to an object ?
<2> If it can't be done, how can I be sure to encode the string in the right format to send it over to the servlet ?
Frank

Similar Messages

  • How to get an XML string store in CLOB or LONG column ?

    How to get an XML string store in CLOB or LONG column ?
    We use XSU with the following command
    String str = qry.getXMLString();
    but all the "<" are replace by "&lt;"
    It's impossible to parse the result for XSLT transformation
    Thank's for your help
    Denis Calvayrac
    Example :
    in the column "TT_NAME"
    "<name><firstname>aaa</<firstname><lastname>bbb</lastname></name>
    I want this result
    <TT_NAME>
    <name>
    <firstname>aaa</firstname>
    <lastname>bbb</lastname>
    </name>
    </TT_NAME>
    but, I have this result
    <TT_NAME>
    &lt;name&gt;
    &lt;firstname&gt;aaa&lt;/firstname&gt;
    &lt;lastname&gt;bbb&lt;/lastname&gt;
    &lt;/name&gt;
    </TT_NAME>

    Can you post some of your code, so I can take a look ?
    Thanks

  • How to get the XML messages from JMS Queue in BPM

    I have one requirement in my application.we are sending XML messages to the JMS Queue.How to get the XML messages from JMS Queue and how to Extract the details from XMl.
    can you please send me the code to get the XML messages from the JMS Queue.
    Thank you,

    Hi,
    Sure others will have some other ideas, but here's what I typically do to get the XML from a JMS queue. Inside the Global Automatic that pops the messages off the queue you'd have logic similar to this:
    artifactInfoNodes as Any[]
    xmlObject as Fuego.Xml.XMLObject = XMLObject()
    load xmlObject using xmlText = message.textValue
    . . . Once you have this, it's a matter of deciding what you want to do with the message. Most times you'll parse the XML (using XPATH statemens), set argument variables and create a work item instance.
    Hope this helps,
    Dan

  • How do I send an attachment from my hotmail account without having to forward it first from my gmail account?

    How do I send an attachment from my hotmail account without having to forward it first from my gmail account?

    Get copies of the song files and add them to your iTunes library.

  • How to get an xml string into a Document w/o escaping mark-up characters?

    Hi,
    I am using one of the latest xerces using Java. I am pretty sure I am using xerces-2.
    I have an existing Document and I am trying to add more content to it. The new content itself is xml string. I am trying to insert this xml string into the document using document.createTextNode. I am able to insert, but somewhere it is escaping the mark-up characters (<,>,etc). When I convert the document into String, I can see, for example, <userData> instead of <userData>.
    There is an alternative option to accomplish this by creating a new document with this xml string, get the root element, import this element into my document. Execution time for this procedure is very high - means, this is very bad in terms of time-wise performance.
    Can any help on how to accomplish this (bringing an xml string into a document without escaping mark-up characters) in time-efficient way.

    So you want to treat the contents of the string as XML rather than as text? Then you have to parse it.
    Or if your reason for asking is just that you don't like the look of escaped text, then use a CDATA section to contain the text.

  • How to get access via RMI from a session bean to a remote session bean?

    I have 2 J2EE applications in two different Sun Application Servers (8.0 PE). I would like to get access from one Session Bean "SB1" into Application A to Session Bean "BrickFacade" within Application B.
    My Java Code from "SB1":
             Context ic = new InitialContext();
             Object o = ic.lookup("java:comp/env/ejb/BrickFacade");
             BrickFacadeHome brickFacadeHome2 = (BrickFacadeHome) PortableRemoteObject.narrow(o, BrickFacadeHome.class);
             brickFacade = brickFacadeHome2.create();
             Collection col = brickFacade.doSomething();
             ...I configured the remote App.server in sun-ejb-jar.xml. I found the syntax within documentation (http://docs.sun.com/source/817-6087/dgjndi.html#wp24622) but I'm not sure if I this is the right usage.
         <ejb-ref>
            <ejb-ref-name>ejb/BrickFacade</ejb-ref-name>
            <jndi-name>corbaname:iiop://161.90.176.213:3700#webclient/BrickFacade</jndi-name>
          </ejb-ref>The context lookup throws the exception:
    "IOP00110603: (BAD_PARAM) Bad host address in -ORBInitDef"
    and
    Invalid URL or IOR: corbaloc:iiop://161.90.176.213:3700
    javax.naming.ConfigurationException: Invalid URL or IOR: corbaloc:iiop://161.90.176.213:3700 [Root exception is org.omg.CORBA.BAD_PARAM:   vmcid: SUN  minor code: 603  completed: No]
    Could anyone help me? Many thanks!
    Stacktrace:
    "IOP00110603: (BAD_PARAM) Bad host address in -ORBInitDef"
    org.omg.CORBA.BAD_PARAM: vmcid: SUN minor code: 603 completed: No
         at com.sun.corba.ee.impl.logging.NamingSystemException.insBadAddress(NamingSystemException.java:148)
         at com.sun.corba.ee.impl.logging.NamingSystemException.insBadAddress(NamingSystemException.java:166)
         at com.sun.corba.ee.impl.naming.namingutil.CorbalocURL.badAddress(CorbalocURL.java:104)
         at com.sun.corba.ee.impl.naming.namingutil.CorbalocURL.handleColon(CorbalocURL.java:140)
         at com.sun.corba.ee.impl.naming.namingutil.CorbalocURL.handleIIOPColon(CorbalocURL.java:115)
         at com.sun.corba.ee.impl.naming.namingutil.CorbalocURL.<init>(CorbalocURL.java:67)
         at com.sun.corba.ee.impl.naming.namingutil.INSURLHandler.parseURL(INSURLHandler.java:41)
         at com.sun.corba.ee.impl.resolver.INSURLOperationImpl.operate(INSURLOperationImpl.java:103)
         at com.sun.corba.ee.impl.orb.ORBImpl.string_to_object(ORBImpl.java:774)
         at com.sun.jndi.cosnaming.CNCtx.setOrbAndRootContext(CNCtx.java:338)
         at com.sun.jndi.cosnaming.CNCtx.initUsingCorbanameUrl(CNCtx.java:321)
         at com.sun.jndi.cosnaming.CNCtx.initUsingUrl(CNCtx.java:247)
         at com.sun.jndi.cosnaming.CNCtx.createUsingURL(CNCtx.java:85)
         at com.sun.jndi.url.iiop.iiopURLContextFactory.getUsingURLIgnoreRest(iiopURLContextFactory.java:56)
         at com.sun.jndi.url.iiop.iiopURLContext.getRootURLContext(iiopURLContext.java:44)
         at com.sun.jndi.toolkit.url.GenericURLContext.lookup(GenericURLContext.java:182)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
         at com.sun.enterprise.naming.NamingManagerImpl.lookup(NamingManagerImpl.java:702)
         at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:108)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
         at de.emilberlinerstudios.va.ejb.testrh.sb.TestRemoteEjbBean.getBrickFacade(TestRemoteEjbBean.java:108)
         at de.emilberlinerstudios.va.ejb.testrh.sb.TestRemoteEjbBean.startTest(TestRemoteEjbBean.java:79)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at com.sun.enterprise.security.SecurityUtil$2.run(SecurityUtil.java:146)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sun.enterprise.security.application.EJBSecurityManager.doAsPrivileged(EJBSecurityManager.java:930)
         at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:151)
         at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:128)
         at $Proxy7.startTest(Unknown Source)
         at de.emilberlinerstudios.va.ejb.testrh.sb._TestRemoteEjb_Stub.startTest(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at com.sun.forte4j.j2ee.ejbtest.webtest.InvocableMethod$MethodIM.invoke(InvocableMethod.java:231)
         at com.sun.forte4j.j2ee.ejbtest.webtest.EjbInvoker.getInvocationResults(EjbInvoker.java:96)
         at com.sun.forte4j.j2ee.ejbtest.webtest.DispatchHelper.getForward(DispatchHelper.java:189)
         at org.apache.jsp.dispatch_jsp._jspService(dispatch_jsp.java:75)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:102)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:861)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:282)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:263)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:210)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:861)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:246)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
         at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:268)
         at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:236)
         at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
         at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:145)
         at java.security.AccessController.doPrivileged(Native Method)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:141)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
         at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:214)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:168)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:144)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:133)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:539)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
         at com.sun.enterprise.webservice.EjbWebServiceValve.invoke(EjbWebServiceValve.java:134)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
         at com.sun.enterprise.security.web.SingleSignOn.invoke(SingleSignOn.java:272)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
         at com.sun.enterprise.web.VirtualServerValve.invoke(VirtualServerValve.java:209)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:114)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
         at com.sun.enterprise.web.VirtualServerMappingValve.invoke(VirtualServerMappingValve.java:166)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:936)
         at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:165)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:683)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:604)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:542)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:647)
         at java.lang.Thread.run(Thread.java:534)
    |#]
    [#|2006-10-02T13:52:55.390+0200|INFO|sun-appserver-pe8.0.0_01|javax.enterprise.system.stream.out|_ThreadID=11;|2006-10-02 13:52:55 [8080-Processor4] INFO .va.ejb.testrh.sb.TestRemoteEjbBean - RemoteException when getting BrickFacade. Message:Invalid URL or IOR: corbaloc:iiop://161.90.176.213:3700
    javax.naming.ConfigurationException: Invalid URL or IOR: corbaloc:iiop://161.90.176.213:3700 [Root exception is org.omg.CORBA.BAD_PARAM:   vmcid: SUN  minor code: 603  completed: No]
         at com.sun.jndi.cosnaming.CNCtx.setOrbAndRootContext(CNCtx.java:367)
         at com.sun.jndi.cosnaming.CNCtx.initUsingCorbanameUrl(CNCtx.java:321)
         at com.sun.jndi.cosnaming.CNCtx.initUsingUrl(CNCtx.java:247)
         at com.sun.jndi.cosnaming.CNCtx.createUsingURL(CNCtx.java:85)
         at com.sun.jndi.url.iiop.iiopURLContextFactory.getUsingURLIgnoreRest(iiopURLContextFactory.java:56)
         at com.sun.jndi.url.iiop.iiopURLContext.getRootURLContext(iiopURLContext.java:44)
         at com.sun.jndi.toolkit.url.GenericURLContext.lookup(GenericURLContext.java:182)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
         at com.sun.enterprise.naming.NamingManagerImpl.lookup(NamingManagerImpl.java:702)
         at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:108)
         at javax.naming.InitialContext.lookup(InitialContext.java:347)
         at de.emilberlinerstudios.va.ejb.testrh.sb.TestRemoteEjbBean.getBrickFacade(TestRemoteEjbBean.java:108)
         at de.emilberlinerstudios.va.ejb.testrh.sb.TestRemoteEjbBean.startTest(TestRemoteEjbBean.java:79)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at com.sun.enterprise.security.SecurityUtil$2.run(SecurityUtil.java:146)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sun.enterprise.security.application.EJBSecurityManager.doAsPrivileged(EJBSecurityManager.java:930)
         at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:151)
         at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:128)
         at $Proxy7.startTest(Unknown Source)
         at de.emilberlinerstudios.va.ejb.testrh.sb._TestRemoteEjb_Stub.startTest(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at com.sun.forte4j.j2ee.ejbtest.webtest.InvocableMethod$MethodIM.invoke(InvocableMethod.java:231)
         at com.sun.forte4j.j2ee.ejbtest.webtest.EjbInvoker.getInvocationResults(EjbInvoker.java:96)
         at com.sun.forte4j.j2ee.ejbtest.webtest.DispatchHelper.getForward(DispatchHelper.java:189)
         at org.apache.jsp.dispatch_jsp._jspService(dispatch_jsp.java:75)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:102)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:861)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:282)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:263)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:210)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:861)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:246)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
         at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:268)
         at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:236)
         at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
         at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:145)
         at java.security.AccessController.doPrivileged(Native Method)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:141)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
         at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:214)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:168)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:144)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:133)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:539)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
         at com.sun.enterprise.webservice.EjbWebServiceValve.invoke(EjbWebServiceValve.java:134)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
         at com.sun.enterprise.security.web.SingleSignOn.invoke(SingleSignOn.java:272)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
         at com.sun.enterprise.web.VirtualServerValve.invoke(VirtualServerValve.java:209)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:114)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:109)
         at com.sun.enterprise.web.VirtualServerMappingValve.invoke(VirtualServerMappingValve.java:166)
         at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:107)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:522)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:936)
         at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:165)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:683)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:604)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:542)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:647)
         at java.lang.Thread.run(Thread.java:534)
    Caused by: org.omg.CORBA.BAD_PARAM: vmcid: SUN minor code: 603 completed: No
         at com.sun.corba.ee.impl.logging.NamingSystemException.insBadAddress(NamingSystemException.java:148)
         at com.sun.corba.ee.impl.logging.NamingSystemException.insBadAddress(NamingSystemException.java:166)
         at com.sun.corba.ee.impl.naming.namingutil.CorbalocURL.badAddress(CorbalocURL.java:104)
         at com.sun.corba.ee.impl.naming.namingutil.CorbalocURL.handleColon(CorbalocURL.java:140)
         at com.sun.corba.ee.impl.naming.namingutil.CorbalocURL.handleIIOPColon(CorbalocURL.java:115)
         at com.sun.corba.ee.impl.naming.namingutil.CorbalocURL.<init>(CorbalocURL.java:67)
         at com.sun.corba.ee.impl.naming.namingutil.INSURLHandler.parseURL(INSURLHandler.java:41)
         at com.sun.corba.ee.impl.resolver.INSURLOperationImpl.operate(INSURLOperationImpl.java:103)
         at com.sun.corba.ee.impl.orb.ORBImpl.string_to_object(ORBImpl.java:774)
         at com.sun.jndi.cosnaming.CNCtx.setOrbAndRootContext(CNCtx.j|#]

    Problem solved:
    configuration in jndi-name was wrong:
    <jndi-name>corbaname:iiop:161.90.176.213:3700#ejb/BrickFacade</jndi-name>

  • How to get a SQL-String from a (Prepared)Statement?

    Hi,
    I have these three lines of code:
    PreparedStatement stmt = connection.prepareStatement("select * from mytable where username= ?");
    stmt.setString(1, "user");
    ResultSet rs = stmt.executeQuery();
    Now, I want to log all SQL-Statements with log4J.
    log.info(sqlstring);
    Now, I want for sqlstring something like "select * from mytable where username='user' ", i. e. the PreparedStatement-String with the parameters I set.
    Is there any possibility to get this string?
    I searched in class PreparedStatement, in class ResultSet, in class ResultSetMetaData, but without success.
    Can anybody help me?

    Use a JDBC-logging library. You can use Mimer JTrace available att http://developer.mimer.com (or http://developer.mimer.se/downloads/downloads_thank.tml?a=&id=36). It should work with any JDBC driver.
    /Fredrik

  • CallableStatement: how to get prepared call string?

    How can I get the parameter string that is set via prepareCall() from a CallableStatement?
    String call = "{call sp_irecord (?,?,?)}";
    CallableStatement cs = connection.prepareCall(call);
    //later, when 'call' is not known but cs:
    String originalCall = csc.get???();
    //how to get the call string from the callable statement?

    i don't mean the parameter names or values, i mean the string that you set with the prepareCall() method:
    String call = "{call sp_irecord (?,?,?)}";
    CallableStatement cs = connection.prepareCall(call);
    System.out.println("Call string: "+cs.getCallString());with the method getCallString() (that i invented and that i'm looking for) should return the exact string. The output of the example above should be:
    Call string: {call sp_irecord (?,?,?)}

  • Sending long XML strings from a servlet

    Hi,
    I'm trying to send a long (16K) XML string from a Java servlet to a
    MSXML2.XMLHTTP40 client. The client doesn't receive any data when the
    string is longer than about 2K .
    I am using the POST method.
    I have tried increasing the buffer size on the sending side with
    HttpServletResponse.setBufferSize() - this had no effect.
    Any ideas ?
    Thanks very much for your help,
    Rod

    Looks like the problem is on the client side (MSXML) because I can flawlessly send half-megs XML files from a Servlet to a browser or a java.net.URL

  • How can I get the XML structure from a flat structure?

    Hi all,
    in my XI SP 12 I use a JMS adapter to read information using the WebSphereMQ transport protocol.
    The structure that I receive have this format:
    <Name_A.KeyFieldValue><Name_A.fieldName_A1_Value>...<Name_A.fieldName_AN_Value>
    <NumberRecordType_B><NumberRecordType_c>
    <Name_B.KeyFieldValue><Name_B.fieldName_B1_Value>...<Name_B.fieldName_BN_Value>
    <Name_B.KeyFieldValue><Name_B.fieldName_B1_Value>...<Name_B.fieldName_BN_Value>
    <Name_C.KeyFieldValue><Name_C.fieldName_C1_Value>...<Name_C.fieldName_CN_Value>
    <Name_C.KeyFieldValue><Name_C.fieldName_C1_Value>...<Name_C.fieldName_CN_Value>
    the problem is that in this structure each line is not separated by a carriage return or a comma, I have all the information in a single line:
    <Name_A.KeyFieldValue><Name_A.fieldName_A1_Value>...<Name_A.fieldName_AN_Value><NumberRecordType_B><NumberRecordType_c><Name_B.KeyFieldValue><Name_B.fieldName_B1_Value>...<Name_B.fieldName_BN_Value>...<Name_B.KeyFieldValue><Name_B.fieldName_B1_Value>...<Name_B.fieldName_BN_Value><Name_C.KeyFieldValue><Name_C.fieldName_C1_Value>...<Name_C.fieldName_CN_Value>...<Name_C.KeyFieldValue><Name_C.fieldName_C1_Value>...<Name_C.fieldName_CN_Value>
    and the customer don't want to insert a line separator.
    Then, the question is:
    How can I get the XML structure from this structure?
    If possible, I don't want to develop new Module and add it in the JMS Module Sequence.
    PS I have already read the article "How to Use the Content Conversion Module with the XI 3 J2EE JMS Adapter.pdf" and it doesn't seem to help me.
    Best Regards,
    Paolo

    To get context parameters from your web.xml file you can simply get the ActionServlet object from an implementing action object class. In the perform (or execute) method make the following call.
    ServletContext context = getServlet().getServletContext();
    String tempContextVar =
    context.getInitParameter("<your context param >");

  • How to create an XML document from a String.

    Can anyone help,
         In the Microsoft XML Document DOM there is a load function load(string) which will create an XML document, but now we are switching to Java and I do not know how to create and XML document from a string, this string �xml document� is passed to my program from a webservice and I need to read several xml elements form it in a web server.
    This string is a well formatted XML document:
    <?xml version="1.0" encoding="UTF-8"?>
    <Countries NumberOfRecords="1" LanguageID="en-us">
         <Country>
              <CountryCode>AU</CountryCode>
              <CountryName>AUSTRALIA</CountryName>
         </Country>
    </Countries>

    Thanks PC!
    I made it work using:
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    factory.setIgnoringComments(true); // We want to ignore comments
    // Now use the factory to create a DOM parser
    DocumentBuilder parser = factory.newDocumentBuilder();
    //TransformThisStringBuffer is a string buffer wich contain the 'XML document (String)'
    InputStream in = new ByteArrayInputStream(TransformThisStringBuffer.toString().getBytes());
    // Parse the InputStream and build the document
    Document document = parser.parse(in);
    But which one is faster InputSource or InputStream, were would you put the "new InputSource(new StringReader(yourString))" in the above code?

  • How to create XML string from BPM Business Object?

    Hello,
    I have a business object in my BPM project and I need to transform it in a XML string:
    From:
    Business Object: Customer
    Properties:          Name, Age
    To:
    "<Customer><Name>Robert</Name><Age>17</Age></Customer>"
    How can I do this?
    Thanks.

    Hello,
    I have a business object in my BPM project and I need to transform it in a XML string:
    From:
    Business Object: Customer
    Properties:          Name, Age
    To:
    "<Customer><Name>Robert</Name><Age>17</Age></Customer>"
    How can I do this?
    Thanks.

  • How to get the XML Source again from the same RDF ???

    If the one new column is added in the .rdf file, then how u create your new XML source by submitting the same cp?
    When I ran the cp for 1st time, I was able to get xml source by view output, save it, make rtf and make data defn and template creation.
    But how to get the XML source If the one new column is added in the same .rdf file?
    Thanks
    Ud.

    The simple answer is: you don't.
    Not only is it simply not possible, but the entire concept of "the active browser" doesn't exist.
    You were on the right track with your code to retrieve the page directly from the server, but as you noticed that code will only work for regular http connections.
    For https and other protocols you will need to use appropriate libraries for each protocol. Something like Apache Commons can help you with that. There are networking libraries in there for a lot of commonly used protocols.

  • How to get the query values from the url in a servlet and pass them to jsp

    ok..this is the situation...
    all applications are routed through a login page...
    so if we have a url like www.abc.com/appA/login?param1=A&param2=B , the query string must be passed onto a servlet(which is invoked before the login page is displayed)..the servlet must process the query string and then should pass all those values(as hidden values) to the login jsp..then user enters username and pswd, then there should be another servlet which takes all the hidden values of jsp and also username and pswd, authenticates the user and sends the control back to that particular application along with the hidden values...
    so i need help on how to parse the query string from the original url in the servlet, pass it out to jsp, and then pass it back to the servlet and back to the original application...damnn...any help would be greatly appreciated...thanks

    ok..this is the situation...Sounds like you have a bad design on your hands.
    You're going to send passwords in a GET request as clear text? Nice security there.
    Why not start with basic security and work your way up?
    %

  • How to get all the values from the dropdown menu

    How to get all the values from the dropdown menu
    I need to be able to extract all values from the dropdown menu; I know how to get all those values as a string, but I need to be able to access each item; (the value in a dropdown menu will change dynamically)
    How do I get number of item is selection dropdown?
    How do I extract a ?name? for each value, one by one?
    How do I change a selection by referring to particular index of the item in a dropdown menu?
    Here is the Path to dropdown menu that I'm trying to access (form contains number of similar dropdowns)
    RSWApp.om.GetElementByPath "window(index=0).form(id=""aspnetForm"" | action=""advancedsearch.aspx"" | index=0).formelement[SELECT](name=""ctl00$MainContent$hardwareBrand"" | id=""ctl00_MainContent_hardwareBrand"" | index=16)", element
    Message was edited by: testtest

    The findElement method allows various attributes to be used to search. Take the following two examples for the element below:
    <Select Name=ProdType ID=testProd>
    </Select>
    I can find the element based on its name or any other attribute, I just need to specify what I am looking for. To find it by name I would do the following:
    Set x = RSWApp.om.FindElement("ProdType","SELECT","Name")
    If I want to search by id I could do the following:
    Set x = RSWApp.om.FindElement("testProd","SELECT","ID")
    Usually you will use whatever is available. Since the select element has no name or ID on the Empirix home page, I used the onChange attribute. You can use any attribute as long as you specify which one you are using (last argument in these examples)
    You can use the FindElement to grab links, text boxes, etc.
    The next example grabs from a link on a page
    Home
    Set x = RSWApp.om.FindElement("Home","A","innerText")
    I hope this helps clear it up.

Maybe you are looking for

  • I want to use Final Cut Pro with Lion?

    I have FCP 6.0.6 and Lion on MacBook Pro. Can't open FCP.

  • Drag the component from one cell to another cell within JTable

    Hi All, I have one requirement to drag the component from JList to JTable cell. I am able to do it but once if i drag the component from list to table cell, table accepting the drop after this i am unable to move the same component from one cell to a

  • HP LaserJet 1022n prints gibberish since swapping G4 computers

    When swapping my newer 733 MHz G4 for the older AGP G4 on the ethernet network at the office, I was no longer able to print more than a string of gibberish that is probably some sort of Postscript language. It begins with: %! PS-Adobe-3.0 %RBINumCopi

  • Startup problem

    Hi all. I have a problem with bootcamp on 10.7.1. Originally I had my OS X and Windows 7 running on the same HD. For some reason I have clean install OS X again. So I created a backup partition from the OS X partition to hold my important stuff tempo

  • IR: Display single row of data over multi report rows.

    In an interactive report, is it possible to display the data from one database row over two or more displayed rows on a page?