Converting html forms to java

having viewed an earlier post in this forum i managed to create the following code but am having a few problems.
here are the active parts of the html form on googles search, engine. i am trying to convert this into java form and have so far succeeeded in generating the code shown below, but keep getting the following error
"IOException; Server returned HTTP response code: 501 for URL: http://www.google.co.uk/search"
the form:
<form action=/search name=f>
<input type=hidden name=hl value=en>
<input maxlength=2048 size=55 name=q value="" title = "Google Search">
<input type=submit value="Google Search" name=btnG>
<input type=submit value="I'm Feeling Lucky" name=btnI>
</form>
in the following code baseURL is the domain of the server... in this case http://www.google.co.uk/, method is the method as defined in the form method attirbute, if the attribute is not there, as in this form the default method is called which is GET
            URL url;
            HttpURLConnection urlConn;
            DataOutputStream printout;
            BufferedReader input;
            if(action.startsWith("http")) {
                url = new URL(action);
            } else if(action.startsWith("/")) {
                url = new URL(baseURL+action.substring(1,action.length()));
            } else {
                url = new URL(baseURL+action);
            urlConn = (HttpURLConnection) url.openConnection();
            urlConn.setDoInput(true);
            urlConn.setDoOutput(true);
            urlConn.setUseCaches(false);
            //      set request method
            urlConn.setRequestMethod(method);
            //      set request type
            urlConn.setRequestProperty("Content-Type",
                    "application/x-www-form-urlencoded");
            //       data-value pairs are separated by &
            String content ="hl=en&q="
            // imitate someone searching for "hello" in i feel lucky
            content+="hello&btnI=I'm Feeling Lucky";
            urlConn.setRequestProperty("Content-Length", content.length() + "");
            //       Send POST output.
            printout = new DataOutputStream(urlConn.getOutputStream());
            printout.writeBytes(content);
            printout.flush();
            printout.close();
            //       Get response data.
            input = new BufferedReader(new InputStreamReader(urlConn.getInputStream()));
            String str;
            while (null != ((str = input.readLine())))
                System.out.println(str);
            input.close();
        } catch (MalformedURLException me) {
            System.err.println("MalformedURLException; " + me);
        } catch (IOException ioe) {
            System.err.println("IOException; " + ioe.getMessage());
            ioe.printStackTrace();
        }i also tried self adding in the question mark that appears after the search text bu again get the same error. any ideas what im doing wrong when connecting to the server? thanks in advance for any help

Just saw this topic on the forum,
For each web crawlers the web sites maintain a file called Robots.txt which can be assessed by : http://www.google.co.uk/robots.txt
You would see following on that file :
User-agent: *
Allow: /searchhistory/
Disallow: /search
Disallow: /groups
which means that crawlers are not allowed to scrap this site on search, due to which our code wasnt working
Thanks

Similar Messages

  • Converting oracle forms into java forms

    Hi all,,
    would help me plz on how to convert oracle forms into java using any tool;
    Is Jheadstart is the tool,, im having jeveloper version 10.1.2.1.0

    There are at least two companies that are marketing Forms to Java conversion tools. I'm sure that a good Google search will locate them, and they are frequent exhibitors at Oracle-oriented conferences like Collaborate and ODTUG Kaleidoscope. But there are problems associated with doing this. I urge anyone who is considering such a project to read this article by Grant Ronald: http://www.oracle.com/technology/products/forms/pdf/10gR2/formsmigration.pdf
    You should carefully ask yourself and your clients and management, "Why do you want to do this?", "What benefits are you trying to realize?", "Does this make sense, and are there other options that we should be exploring?"
    For instance, many people are trying to protect themselves because "Forms is going away". Oracle has stated again and again that Forms is NOT going away. In fact the recent Fusion Middleware 11g release included a new version of Forms with some significant enhancements. You may do very well just by upgrading to the latest version of Forms.
    If you do decide that it still makes sense to convert, I suggest that rather that converting, you may want to redevelop from scratch. Keep the database if it is well designed - a well designed, stable database will outlast any front end that you may use against it. Then take full advantage of the capabilities of your new toolset, and leave behind the limitations and inapplicable methodologies of your old one. Oh, by the way, don't use JDeveloper 10.1.2. Use 11g if you can, or 10.1.3.5 if you must.

  • Convert Oracle Forms into Java (swing & JSP's)

    Dear All,
    We are currently in the process of evaluating our upgrade of system, which is using forms 4.5. One of the options we are considering at this stage is converting all forms into Java program. I am currently doing some pilot work on this project. I am using FormsWizard, a product of InformatikAtelier Gmbh, along with Forms 6i and Jdeveloper 9i. Has any one done this before in this group? Your assistance is much appreciated.
    Regards
    Michael Sesuraj.
    Oracle 8i Certified Database Administrator
    Sun Certified Java 2 Programmer

    Grant, Thanks for that mail. It was very useful article. The article has lots of brilliant points consider. I may have to discuss with our System Architect. With my experience in both forms and Java, it is hard to justify the business benefit out of this conversion. We are a strong Oracle house and have no intention of moving towards J2EE at this stage.. Thanks once again.
    Michael Sesuraj
    Oracle 8i Certified Database Administrator
    Sun Certified Java 2 Programmer

  • Http-adapter: Convert html-post to JAVA-post?

    Hello everybody,
    unfortunately I am not a java programmer. But I am testing the http adapter.
    Is it possible to convert the following html-post into JAVA code?
    <html><head>
    <body>
    <form action="http://myserver" method="post">
    <p>Interface Namespace<br>
    <input name="namespace" value="http://mum.mappings" size="40"></p>
    <p>(Sender-) Service:<br>
    <input name="service" value="MUMHTTP" size="40"></p>
    <p>Interface Name:<br>
    <input name="interface" value="MI_Merge_1" size="40"></p>
    <p>Text:<br>
    <textarea name="Text" rows="5" cols="50"></textarea></p>
    <p><input type="submit" value="Send"></p>
    </form>
    </form>
    </body>
    </head>
    </html>
    For me it is important to send the values of the <input> values.
    How has the code look like?
    Many regards, mario

    Hi Mario,
    I Have once used this code snippet to send a payload to XI engine. Please change the parameters like XI server URL,
    Namespace,senderservice etc..
    Please let me know if you need any further help.
    Regards,
    Ananth
    public static void main(String[] args) throws Exception {
         try {
              URL sapURL = null;
              String urlString = "http://"+serverHost+":"+serverPort+"/sap/xi/adapter_plain?namespace="+senderNamespace+"&interface="
    +senderInterface+"&service="+senderservice+"&party=&agency=&scheme=&QOS="+QOS+"&sap-user="+sapUser+"&sap-password="+
    sapPWD+"&sap-client="+client+"&sap-language=E";
              sapURL= new URL(urlString);
              HttpURLConnection xi = (HttpURLConnection)sapURL.openConnection();
              xi.setRequestMethod("POST");
              xi.setRequestProperty("Content-Type","text/xml");
              xi.setDoOutput(true);
              generateXML(xi.getOutputStream());
              System.out.println(urlString);
              System.out.println("Resp Msg:"+xi.getResponseMessage()+" -- Resp Msg:"+xi.getResponseCode());
              xi= null;
         } catch (Exception e) {
                   e.printStackTrace();
    public static void generateXML(OutputStream out){
         try {
              PrintWriter prt = new PrintWriter(out,false);
              //Create XML tags
              prt.println("<?xml version= "1.0"?>");
              prt.print("<"+resp_MsgType+" xmlns:ns=""+resp_NameSpace+"">");
              prt.print("<"+xml_tag1+">");
              prt.print(xml_tagValue1);
              prt.print("</"+xml_tag1+">");
              prt.print("<"+xml_tag2+">");
              prt.print(xml_tagValue2);
              prt.print("</"+xml_tag2+">");
              prt.print("</"+resp_MsgType+">");
              prt.flush();
              prt.close();
              out.close();
              prt=null;
              out=null;
              }catch(Exception e){
                   e.printStackTrace();

  • Convert html-post to JAVA-post?

    Hello everybody,
    unfortunately I am not a java programmer.
    Is it possible to convert the following html-post into JAVA code?
    <html><head>
    <body>
      <form action="http://myserver" method="post">
        <p>Interface Namespace<br>
        <input name="namespace" value="http://mum.mappings" size="40"></p>
        <p>(Sender-) Service:<br>
        <input name="service" value="MUMHTTP" size="40"></p>
        <p>Interface Name:<br>
        <input name="interface" value="MI_Merge_1" size="40"></p>
        <p>Text:<br>
        <textarea name="Text" rows="5" cols="50"></textarea></p>
        <p><input type="submit" value="Send"></p>
      </form>
    </form>
    </body>
    </head>
    </html>
    For me it is important to send the values of the <input> values.
    How has the code look like?
    Many regards, mario

    mario,
    this is possible if you use something like HttpClient
    check
    http://jakarta.apache.org/commons/httpclient/
    for more details.
    here are few examples of using httpclient for posting data
    http://jakarta.apache.org/commons/httpclient/methods/post.html
    Rgds,
    Amol

  • How to submit a html form using java

    hi friends,
    i have a html form with some input fields, when ever a user submit the form the user information is stored in the database. is it possible to pass the user information in the url(url rewriting) and submit it by a java program so that the data will be stored in the database, as like as, user submit it manually.
    for eg:
    /*sample.html*/
    <form action="store.jsp" method="post">
    User Data:<input type="text" name="userdata">
    <input type="submit">
    </form>
    in my java is it possible to store the record as below:
    URL url=new URL("http://localhost:7001/webapp/store.jsp?userdata=AutomaticDatasave");
    URLConnection con=url.openConnection();
    int i=0;
    while((i=con.getInputStream().read())!=-1)
    System.out.print(i);/*it has to print the data that store.jsp is returned like information stored or error storing data(what ever)*/
    }Edited by: rajaram on Oct 27, 2007 1:01 AM

    hi Drclap,
    Thanks for your reply, which is helpful to me....
    tried what you said, what i did is modified the code like below
    con.setDoOutput(true);
    BufferedWriter br=new BufferedWriter(new InputStreamWriter(con.getOutputStream()));
    String str="userdata=AutomateDataSave\n";
    br.write(str,0,str.length());
    br.flush()But
    Iam Getting Internal Server Error
    Exception in thread "main" java.io.IOException: Server returned HTTP response code: 500 for URL
    Edited by: rajaram on Oct 27, 2007 1:24 AM

  • Is it possible to mimic a submission of html form in Java Swing

    Helppp!!!!
    I want to create a swing applet (The plugins are installed) that would submit to a servlet. The servlet is having a doPost method. Now How do I form fields (that is textfield, hidden field) in a swing environment.
    The same attempt if made in a normal HTML document, I get the results.
    But how to do it swing environment.
    I have seen classes called FormView, HTMLDocument etc in javax.swing.text.html package. The documentation also says that a input type=button will be intrepreted as JButton. There is also a method called as "submitData()" in the FormView class.
    But how actually do you use it.
    Or is there any other way.
    Can anyone help me out please?
    Thank you
    MrWrongBoy

    You could simply let the JTextPane load up an HTML page with a form for you which in turn you can fill out and submit to your servlet. And here is my working sample:
    public class HTMLFormJApplet extends javax.swing.JApplet {
        public void init() {
            initComponents();
            htmlPane.setEditable(false);
            String page_name = getParameter("page_name");
            try
                htmlPane.setPage(new java.net.URL(getDocumentBase(),page_name).toExternalForm());
            catch(Exception e)
                e.printStackTrace();
        private void initComponents() {
            jScrollPane1 = new javax.swing.JScrollPane();
            htmlPane = new javax.swing.JTextPane();
            jScrollPane1.setViewportView(htmlPane);
            getContentPane().add(jScrollPane1, java.awt.BorderLayout.CENTER);
        private javax.swing.JScrollPane jScrollPane1;
        private javax.swing.JTextPane htmlPane;
    --------------- HTMLFormJApplet.html -------------------
    <applet codebase="." code="HTMLFormJApplet.class" width="350" height="350">
    <param name="page_name" value="testform.html">
    </applet>
    --------------- testform.html --------------------------
    <form method="POST" action="myservlet">
    <font color="green">First Name:</font><input type="TEXT" value="firstname" value="wally"><br>
    <input type="SUBMIT" value="Submit">
    </form>

  • Converting HTML Forms to PDF - Field Names

    When I use Adobe 8 to convert and HTML form to PDF all the field names in the resulting PDF have the crazy long names that are jumble of letters and numbers. So I always have to go back through and manually rename every field because I'm using another program to autopopulate the fields with data. Is there any way to get Acrobat to automatically name the fields in the PDF the same as they are named in the form either using the "name" or "id" properties of the HTML fields? I don't understand why this isn't the default behaviour to begin with.

    The reason this is done is due to a fundamental difference between HTML forms and Acrobat forms. In HTML forms, fields with the same name do not necessarily share the same value, whereas in Acrobat forms they do.
    In the conversion process, Acrobat gives each field a unique name, but also sets a field's mapping name to the name the field had in the original HTML form. This is so that if the PDF form is used to submit as "HTML", then the original field names will be used and any server process that is capable of dealing with the HTML form is capable of dealing with the resulting PDF form. So be aware that if you want to use your modified form to submit to a web server using the "HTML" format, the new field names that you set will not be used. What will be used are the hidden mapping names.
    Unfortunately, I don't think there's anything you can do about any of this to make it work like you want.
    George

  • HTML form and java

    Hi,
    I have been pulling my hair out for the past week on this with no suces EVEN after forum searching, googling ..........
    Here is the problem:
    I have an HTML form of the following type and need to pass in a Javascript variable to the servlet called on hitting the submit button.
    <script>document.write('<form name="Test" method="get" onSubmit="return chkfields(this)" action="/servlet/NewServlet?ABC='+unescape(params["ABC"])+'">')</script>For debugging purposes, I have a document.write statement and I see it on the page right above that line and it does display it on the field. However this thing does not pass the varible to the servlet. I even tried replacing the unescape(params["ABC"]) with just the variable name used in the form as ABC and that did nto work either. Please suggest any other suggestions.

    test.html:
    <!DOCTYPE HTML PUBLIC "-//w3c//dtd html 4.0 transitional//en">
    <html>
    <head>
    <script language="JavaScript">
    function setHidden() {
      document.testForm.testInput.value = "test";
      return true;
    </script>
    </head>
    <body>
    <form method="post" name="testForm" action="test2.jsp" onSubmit="return setHidden()">
    <INPUT TYPE="hidden" NAME="testInput">
    <INPUT TYPE="submit" VALUE="submit">
    </form>
    </body>
    </html>test2.jsp:
    <html>
    </head>
    <body>
    <%
    out.println(request.getParameter("testInput"));
    %>
    </body>
    </html>

  • Converting HTML form to Flash for Paypal!

    Hello! Im currently in the process of converting my HTML website to Flash. On my website, i am using Paypal buttons (add to cart) so now i need to convert my 3 buttons/form to Flash. Here is my website: http://www.tubesjujubes.com/En/buyonline.html
    I found this tutorial to help me: http://www.actionscript.org/resource...ash/Page1.html
    but something is still wrong! Everytime i click on the button, it brings me to the log in page of Paypal instead of 'your cart' page. See HTML site for what i mean.
    Ive only tried the tutorial on one button so far since i wanted it to work before i applied it to the others. This is the HTML code on my website for my first button:
    <form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
    <input type="hidden" name="cmd" value="_s-xclick" />
    <input type="hidden" name="hosted_button_id" value="1699962" />
    <input type="hidden" name="on0" value="Choose your membership" />Choose your membership:
    <select name="os0">
    <option value="1 kid + 1 parent">1 kid + 1 parent $99.00
    </option><option value="2 kids + 2 parents">2 kids + 2 parents $178.00
    </option></select>
    <br /><br />
    <input type="hidden" name="currency_code" value="CAD" />
    <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_cart_LG.gif" border="0" name="submit" alt="" />
    <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1" />
    </form>
    Now this is how i created my form/button in flash:
    Every component and input box are on the same layer.
    The actions are on a separate action layer.
    I create a ComboBox for my choices with an instance name of 'os0'. I imported the button img, converted it to a button and called it 'submit'. For the action of the button, i used: on (release) {
    getURL ("https://www.paypal.com/cgi-bin/webscr", "POST");
    Then i created 4 hidden input box, that i placed outside of the scene. I gave them a var title, using the 'name' from the HTML code and then added the values for each input box on the action layer like this:
    cmd = "_s-xclick";
    hosted_button_id = "1700073";
    on0 = "Choose your membership";
    currency_code = "CAD";
    And its still wont work! And i have no clue what im doing wrong! PLEASE HELP!

    I was able to figure out how to get my btn to redirect to my shopping cart. Basically, you just need to make sure everything is on the btn action layer. At first i have my hidden values on a action layer in the main page and the getURL my btn layer. Now my btn layer looks like this:
    on (release) {
    // Hidden Input fields for Form
    cmd = "_s-xclick";
    hosted_button_id = "1699962";
    on0 = "Choose your membership";
    currency_code = "CAD";
    getURL ("https://www.paypal.com/cgi-bin/webscr", target="paypal", "POST");
    Now my problem is that the values of my combo box arent read and i have no idea how to code it. Can anyone help me with this? Should i code it in actionscript or can i just do it in property inspector box? I know what the problem is but i dont know how to fix it! My button is missing some coding since its not picking up the values of the combo box.
    Anything could help! Thanks!

  • Render html form & send forms's input values as params via HTTP POST

    Hello,
    I'm using appache commons http client to send HTTP post queries to a given url and receive HTTP response then process it.
    one of the requirements of my Application is the following: one of these HTTP Post requests is supposed to return an HTML form with different html types (text filed, text area etc..) that i will need to display in my swing application. one important requirement is that i can't know in advance what the html form field types will be.. it depends on a given parameters that my application send as part of HTTP Post method (using apache http client).
    I Longly searched for a simple solution to this problem . There are many solutions but each one has it's limitations :
    1-i can render the html form inside a JEditorPane .but how can I collect the user entered data inside JEditorPane ? i'm not sure this swing component offers the capability to detect its html contents and more it will be difficult to know what are the values entered by user inside html form rendered by JEditorPane.
    2-are there any Java Embedded browsers that offer some API to enable me detect the html form fields ,capture the data entered by user inside the html form ?
    3-the solution i currently opted for is : parse html & convert html form to swing dialog. currently this solution i use works well but the cost of implementing it is high : it involves difficult parsing logic. this makes me worried .I'm not sure if i'm now using the right & easiest solution.
    I need some advice on What is the simplest and clean solution to render a html form & yet be able to collect user entered inputs & send the user input values as params via java HTTP POST request ?

    dragzul wrote:
    In my opinion, your actual solution is what you need to do. You're trying to "merge" two different kinds of view. Actually, the "easiest" way may be: if you have your data to display, you decide to show it on html or swing.Yes i believe that my current solution may be the unique one for my special requirements. when doing research about this problem i found a multitude of java libraries to convert xml to swing (ex: www.swixml.org) .However i was surprised there are no java libraries to convert HTML forms to swing dialogs -as far as i know-. this is a bit strange. The Limitation is that the developers of the server API are not Java guys and are reluctant to use an xml format that i can easily convert to swing . probably they have their own reasons as they might be using the HTML Response for some other server side work. So I was obliged to deal with an HTML stream that i need to display in my client application and process its data. in my opinion the only way to do this is by developing a HTML form to swing converter package. that's what i did now. i was only worried if i'm complicating things and if there are some easier solutions to this issue.
    thanks

  • How to convert an HTML form to PDF

    Is there any way to convert HTML page (with text boxes,radio/submit buttons) into a PDF file so form can be entered in a PDF format??

    DanCrintea wrote:
    HTML to PDF with Java, using OpenOffice.org - example here: [http://www.dancrintea.ro/html-to-pdf/|http://www.dancrintea.ro/html-to-pdf/]
    You can use OpenOffice.org, running as a server and command it remotely for document convertion.
    Besides HTML to PDF, there are also possible other convertions:
    doc --> pdf, html, txt, rtf
    xls --> pdf, html, csv
    ppt --> pdf, swf
    Code example:
    import officetools.OfficeFile; // this is my tools package
    FileInputStream fis = new FileInputStream(new File("c:/test.html"));
    FileOutputStream fos = new FileOutputStream(new File("c:/test.pdf"));
    // suppose OpenOffice.org runs on localhost, port 8100
    OfficeFile f = new OfficeFile(fis,"localhost","8100", true);
    f.convert(fos,"pdf");
    -----------------------------------------------------------------------------------------------------------------------------------------You really think this is a good way to market your crappy product?

  • Can  Java be used to save content of HTML form to a file?

    We have an application that saves a pdf file to a location on our webserver. The file displays on the users machine in a browser window. I have created a link in the links bar of the browser window which launches a simple HTML page. This page allows the user to enter a number of fields and click 'SAVE'. This is where I am having the problem. I need the save button to firstly create a csv file on the webserver containing the details input by the user. I then need the pdf file saved to the web server with a new name and in the same location as the csv file. is there anyway to achieve this using Java or can anyone please point me in the right direction?
    Thanks

    <<Click on the SAVE button in an HTML <form> and the browser will perform an HTTP POST of the data to a URL. Make that URL point to a Java servlet and it can take that form data
    <<and write it to the webserver file system in any format you wish, including csv and pdf.
    agree with duffy. You can also use JSP and call a class method to handle whatever data you specify.
    orozcom

  • Convert XML payload to HTML form data in Receiver HTTP Adapter

    Hi,
    I want to make a HTTP request ( Receiver HTTP Adapter ) to a servlet where I need to send the payload in HTML form format ( name=value ). As per the help document:
    A typical HTML form comprises named fields. When transferring a completed form to the server or a CGI program, the data must be transferred in such a way that the CGI script can recognize the fields that make up the form, and which data was entered in which field.
    The plain HTTP adapter constructs this format using a prolog and an epilog
    Has anyone done this before? I looked through all help documents and forums but in vain. I can resort to Java Mapping to do this but I do not want to re-invent the wheel if I can do it easily using HTTP Adapter Configuration. Please help.

    The parameters available in HTTP adapter for message header are:
    HeaderFieldFive     http://sap.com/xi/XI/System/HTTP
    HeaderFieldFour     http://sap.com/xi/XI/System/HTTP
    HeaderFieldOne     http://sap.com/xi/XI/System/HTTP
    HeaderFieldSix     http://sap.com/xi/XI/System/HTTP
    HeaderFieldThree     http://sap.com/xi/XI/System/HTTP
    HeaderFieldTwo     http://sap.com/xi/XI/System/HTTP
    HTTPDest     http://sap.com/xi/XI/System/HTTP
    TargetURL     http://sap.com/xi/XI/System/HTTP
    URLParamFive     http://sap.com/xi/XI/System/HTTP
    URLParamFour     http://sap.com/xi/XI/System/HTTP
    URLParamOne     http://sap.com/xi/XI/System/HTTP
    URLParamSix     http://sap.com/xi/XI/System/HTTP
    URLParamThree     http://sap.com/xi/XI/System/HTTP
    URLParamTwo     http://sap.com/xi/XI/System/HTTP

  • Problem with converting html to pdf using LiveCycle ES Java API

    I am using this code to convert html to pdf.
    * 1. adobe-generatepdf-client.jar
    * 2. adobe-livecycle-client.jar
    * 3. adobe-usermanager-client.jar
    * 4. adobe-utilities.jar
    * 5. wlclient.jar
    import java.io.File;
    import java.util.Properties;
    import com.adobe.idp.Document;
    import com.adobe.idp.dsc.clientsdk.ServiceClientFactory;
    import com.adobe.idp.dsc.clientsdk.ServiceClientFactoryProperties;
    import com.adobe.livecycle.generatepdf.client.GeneratePdfServiceClient;
    import com.adobe.livecycle.generatepdf.client.HtmlToPdfResult;
    public class ConvertHTML {
       public static void main(String[] args)
            try{
            //Set connection properties required to invoke LiveCycle ES                             
            Properties connectionProps = new Properties();
            connectionProps.setProperty(ServiceClientFactoryProperties.DSC_DEFAULT_EJB_ENDPOINT, "t3://localhost:7001");
            connectionProps.setProperty(ServiceClientFactoryProperties.DSC_TRANSPORT_PROTOCOL,Service ClientFactoryProperties.DSC_EJB_PROTOCOL);       
            connectionProps.setProperty(ServiceClientFactoryProperties.DSC_SERVER_TYPE, "WebLogic");
            connectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_USERNAME, "administrator");
            connectionProps.setProperty(ServiceClientFactoryProperties.DSC_CREDENTIAL_PASSWORD, "password");
            //Create a ServiceClientFactory instance
            ServiceClientFactory factory = ServiceClientFactory.createInstance(connectionProps);
              //Create a GeneratePdfServiceClient object
            GeneratePdfServiceClient pdfGenClient = new GeneratePdfServiceClient(factory);
           //Get an HTML document to convert to a PDF document a
            String inputFileName = "http://www.adobe.com";
            //String inputFileName = "C:\\Documents and Settings\\venkat\\Desktop\\Adobe.htm";
            String securitySettings = "No Security";
            String fileTypeSettings = "Standard";
    System.out.println("one");
            //Convert HTML content to a PDF document
            HtmlToPdfResult result = pdfGenClient.htmlToPDF2(inputFileName, fileTypeSettings, securitySettings, null, null);
    System.out.println("two");         
            //Get the newly created document
            Document createdDocument = result.getCreatedDocument();
            //Save the PDF document as a PDF file
            createdDocument.copyToFile(new File("C:\\test.pdf"));
        catch (Exception e) {
            System.out.println("Error OCCURRED: " + e.getMessage());
            e.printStackTrace();
    I can able to compile this class but while running i am getting error like below.
    Error OCCURRED: Internal error.
    ALC-DSC-000-000: com.adobe.idp.dsc.DSCRuntimeException: Internal error.
            at com.adobe.idp.dsc.provider.impl.ejb.EjbMessageDispatcher.doSend(EjbMessageDispatcher.java
    :160)
            at com.adobe.idp.dsc.provider.impl.base.AbstractMessageDispatcher.send(AbstractMessageDispat
    cher.java:57)
            at com.adobe.idp.dsc.clientsdk.ServiceClient.invoke(ServiceClient.java:208)
            at com.adobe.livecycle.generatepdf.client.GeneratePdfServiceClient.htmlToPDF2(GeneratePdfSer
    viceClient.java:666)
            at ConvertHTML.main(ConvertHTML.java:84)
    Caused by: java.rmi.RemoteException: Remote EJBObject lookup failed for 'ejb/Invocation'; nested exc
    eption is:
            org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 203  completed: No
            at com.adobe.idp.dsc.provider.impl.ejb.EjbMessageDispatcher.initialise(EjbMessageDispatcher.
    java:101)
            at com.adobe.idp.dsc.provider.impl.ejb.EjbMessageDispatcher.doSend(EjbMessageDispatcher.java
    :130)
            ... 4 more
    Caused by: org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code: 203  completed: No
            at com.sun.corba.se.impl.logging.ORBUtilSystemException.writeErrorSend(Unknown Source)
            at com.sun.corba.se.impl.logging.ORBUtilSystemException.writeErrorSend(Unknown Source)
            at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.writeLock(Unknown Source)
            at com.sun.corba.se.impl.encoding.BufferManagerWriteStream.sendFragment(Unknown Source)
            at com.sun.corba.se.impl.encoding.BufferManagerWriteStream.sendMessage(Unknown Source)
            at com.sun.corba.se.impl.encoding.CDROutputObject.finishSendingMessage(Unknown Source)
            at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.finishSendingRequest(Unknown Sour
    ce)
            at com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.marshalingComplete1(Unkno
    wn Source)
            at com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.marshalingComplete(Unknow
    n Source)
            at com.sun.corba.se.impl.protocol.CorbaClientDelegateImpl.invoke(Unknown Source)
            at com.sun.corba.se.impl.protocol.CorbaClientDelegateImpl.is_a(Unknown Source)
            at org.omg.CORBA.portable.ObjectImpl._is_a(Unknown Source)
            at weblogic.corba.j2ee.naming.Utils.narrowContext(Utils.java:126)
            at weblogic.corba.j2ee.naming.InitialContextFactoryImpl.getInitialContext(InitialContextFact
    oryImpl.java:94)
            at weblogic.corba.j2ee.naming.InitialContextFactoryImpl.getInitialContext(InitialContextFact
    oryImpl.java:31)
            at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:41)
            at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
            at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
            at javax.naming.InitialContext.init(Unknown Source)
            at javax.naming.InitialContext.<init>(Unknown Source)
            at com.adobe.idp.dsc.provider.impl.ejb.EjbMessageDispatcher.initJndiContext(EjbMessageDispat
    cher.java:213)
            at com.adobe.idp.dsc.provider.impl.ejb.EjbMessageDispatcher.getJndiContext(EjbMessageDispatc
    her.java:226)
            at com.adobe.idp.dsc.provider.impl.ejb.EjbMessageDispatcher.initialise(EjbMessageDispatcher.
    java:87)
            ... 5 more
    can u plz give me some way to do the convertion.

    Yes Sir.....Thanks for ur suggestion.....
    But i didn't find exact solution..well..yes i found some but not exactly there were not in the way i required...I jus need to convert HTML to PDF using iText API for java.....I already used some classes in that like HTMLParser.....etc..
    So Any thing else...Any one...Sure can help me in this................

Maybe you are looking for

  • Videos not playing continuous in playlist, like when songs r played, help?

    Hi, i keep experiencing an annoying problem of my videos in music video playlist not playing continuous. by that i mean they play one by one going back to playlist menu when each vid is finished so i have to manually forward to the next one. This Mus

  • Where's the OS X 10.8.3 Combo Update installer?

    Hi, I know the OS X 10.8.3 update is now released to the general public. However, I am having trouble finding the OS X 10.8.3 Combo update at the Apple Support Downloads page. Is the Combo installer available? or should I wait until later tonight to

  • CS3 Extended RAW file plug-in

    I use CS3 Extended on a Windows 7 computer. I have a Nikon D610 camera producing NEF RAW files. I have downloaded and installed the Adobe RAW plug-in and also the DNG file converter. Photoshop will still not recognise either the NEF files or the DNG

  • Macbook Pro Bluetooth Recognition Problem On Wake

    I have a new Macbook Pro (about 2 weeks old). At home I use an Apple Bluetooth wireless keyboard and a Logitech Bluetooth mouse (both of which are >directly< next to the computer). Every day I take my MBP to work with me where I do not have exteral k

  • Nib file not found

    Hello, I'm trying to unbury an old code from 2006 and make it run on a Mac OS X 10.8 using Xcode 4. This code was originally created on Mac OS X 10.4 using Xcode 2.x. In a Mac OSX 10.4 virtual machine, I managed to make the program work. Let's come b