How to run JAXP in servlet using JSWDK?

Hi,
I am trying to parse xml to html using JAXP API within a servlet. But an error message showing ' java.lang.NoClassDefFoundError: javax/xml/parsers/ParserConfigurationException ' is displayed in the web brower. But when I parse the xml to html and output the html text to the standard output, the program works. So, how can I run xml parsers within JSWDK?
Thanks a lot.

Hi,
The problem is you don't have jaxp.jar in your classpath. JAXP Package is the implementation of the specification of XML processing in Java. The xml.jar contains implementation of Sun's(called Project X) XML Parser and related utilities that does not deals with JAXP Specs. The xml.jar is meant for the JSWDK to process the xml files(configuration files). I have not found any documentations for XML Utility classes in xml.jar.
The solution for your problem is; download JAXP api and get the jar files(3 jars) into the classpath. While setting classpath for the jars in JAXP check out that thing named crimson.jar appears first before any other jars in classpath, else it would throw a SecurityException.
Hope this helps.
Regards,
Rajavelu G.

Similar Messages

  • How to run jsp and servlet using JBOSS server

    Dear Friend,
    I have JBoss application server and Eclipse id
    now i want to run JSP and Servlet but i am not getting the place where to place my servlet class file to run it .
    before that i run jsp and servlet using tomcat5.0 but in that i place my servlet class in WEB-INF/classes folder and do corresponding entry in web.xml file and run it through browser.
    now i want to use JBOSS how it is possible
    PLZ Help me

    Is the servlet class defined in a package.? If servlet class package is servlets., copy the servlet to
    WEB-INF/classes/servlets directory.

  • How to run and compile servlets using tomcat4.0.3

    Hello
    I have simple servlet "HelloWorld".I have doubts in compiling and running this servlet.I'm using server Tomcat 4.0.3 as and JDK1.3.
    1)where do i need to save this servlet?
    2)how to compile this servlet by setting a classpath?
    3)how do i run this after compilation?
    4)do i need any HTML page to run on browser?.if, so how do i have a reference of servlet in HTML page?
    HERE IS THE SIMPLE SERVLET
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class HelloWorld extends HttpServlet {
    public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws IOException, ServletException
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    out.println("<html>");
    out.println("<body>");
    out.println("<head>");
    out.println("<title>Hello World!</title>");
    out.println("</head>");
    out.println("<body>");
    out.println("<h1>Hello World!</h1>");
    out.println("</body>");
    out.println("</html>");
    Thanx for help

    put your helloworld servlet inside of webapps/example/WEB-INF/classes...
    and then start your tomcat..and type
    http://localhost:8080/webapps/servlet/HelloWorld
    S

  • How to run report from form using run_object_report

    I AM USNING FORMS9I/REPORTS 9I , HOW TO RUN REPORT FROM FROM USING RUN_REPORT_OBJECT AND HOW
    TO PASS PARAMETER AS WE DID IN RUN_REPORTS PLEASE HELP ME

    here an example !
    I hope this example you can use it
    PROCEDURE pr_reporte IS
    BEGIN
    DECLARE
         repid REPORT_OBJECT;
    v_rep VARCHAR2(100);
    rep_status Varchar2(20);
    d1 DATE;
    d2 DATE;
    BEGIN
         d1 := :GLOBAL.DIA_INI;
         d2 := :GLOBAL.DIA_FIN;
         repid := find_report_object('rep_lab02');
         SET_REPORT_OBJECT_PROPERTY(repid,REPORT_OTHER,'p_fec_uno='||to_char((add_months(last_day(d1),-1) +1),'DD/MM/YYYY')||' '||
         'p_fec_dos='||to_char(d2,'DD/MM/YYYY'));
         SET_REPORT_OBJECT_PROPERTY(repid,REPORT_DESFORMAT,'pdf');
         v_rep := RUN_REPORT_OBJECT(repid);
         rep_status := report_object_status(v_rep);
         WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED') LOOP
              rep_status := report_object_status(v_rep);
         END LOOP;
         IF rep_status = 'FINISHED' then
              WEB.SHOW_DOCUMENT('/reports/rwservlet/getjobid'||substr(v_rep,instr(v_rep,'_',-1)+1)||'?'||'server=repserver','_blank');
         ELSE
              ventana('E','error reporte no encontrado','S');
         END IF;
    END;
    END;
    The 'rep_lab02' is the name of the report that you give in the node reports
    p_fec_uno and p_fec_dos they are the parameters in the report
    repserver is the name of server created with rwserver
    Greetings

  • How to compile and run a Java servlet using the BEA weblogic server

              Hi,
              Could you help me out as to how to compile a servlet using Web Logic server.I have written a Servlet program and have also set up the environment in the "c:\bea\wlserver6.0\config\examples" folder by giving the command setExamplesEnv.cmd.
              I have stored my GreetingServlet.java file in "c:\bea\wlserver6.0\samples\examples\servlets" folder.
              How do I compile my servlet now?
              Vid
              

    Hello,
    1. The .form file was used by Netbean's GUI builder to create the .java and is not needed for compilation.
    2..../src # javac -classpath "..." mytool/*.java
    I guess the package mytool was not coped with.
    Alternatively it is worth to use the ant build tool also used by Netbeans.
    Then you can make a jar from the class files, indicate in the manifest.mf file:
    1. the main class
    2. the library jars

  • How to Run a simple servlet "HelloWorld.java" in JBoss 3.0 ?

    Dear all,
    I am a beginner and I want to run a simple "HelloWorld.java" servlet .
    I need to use JBoss 3.0 .
    After I run this simple servlet, I need to use EJB-Servlet-JSP to implement MVC .
    I have the servlet code and I am able to compile it.
    But I dont know how to proceed as to where to put the class files , where do I specify an alias for my servlet and what modifications I need in Web.xml,Jboss.xml,Application.xml ?
    I do not anything about tools like Ant or Xdoclet so need to proceed without them.Please alos let me know where I can fond complete info about Ant and Xdoclet .
    Thanx in Advance,
    Sujith

    I am not sure of the JBoss package that you are using. If you are using the JBoss-Tomcat package, here's the solution. Create either a .war file or create a directory with the name <your-webapp>.war under <jboss-root>/server/default/deploy. If you are creating a war file, you have to place that war file in the same directory. JBoss-Tomcat will keep looking at this directory for new files or updates to files and deploys/re-deploys as required.
    The contents of the war file should be something like this.
    WEB-INF - directory
    WEB-INF/classes - your servlet classes
    WEB-INF.web.xml - your configuration. Here you can specify the servlet name, class and URI mapping.
    Now, you can call your servlet using the browser in this way: http://localhost:8080/<your-webapp>/servlet/<servlet-alias>. Here the <your-webapp> is the prefix of the .war file.
    Resources:
    Ant - http://jakarta.apache.org/ant/
    Xdoclet - http://xdoclet.sourceforge.net/

  • How to run a batch file using tigger....

    Hi, i am trying run a batch file using a trigger on a table.
    say i have a table XYZ(col_1 varchar2 primary key, col_2 varchar2)
    the values of col_2 keeps changing and col_1 are constant
    whenever the value of col_2 in any row changes from "on" to "off" i want to run a batch file C:\Users\ABC\Desktop\test.bat
    i did some searching but couldn't find any solution. Thanks in advance
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    sorry wrong foum to post.
    will post in the correct one
    how to run batch file using trigger?

    Hallo,
    welcome to the forum.
    This is the forum for the tool {forum:id=260}. Your question should be placed in {forum:id=75} or {forum:id=61}.
    When you post your question there please provide additional information like db version, what kind of trigger you want to use, how you want to prevent the execution when the transaction is rolled back... {message:id=9360002}
    Regards
    Marcus

  • How to Run a text files using UNIX

    Hi,
    I have 10 text files in my project my task is to load all the text files data into Relational Database so i can use sql*loader to load all the text files data into a Database.
    but the thing is another project i have 200 text files so i need to run these text files using UNIX script could anyone tell me how to load all the text files using UNIX
    Thank's
    Edited by: Lavanya on Sep 5, 2012 3:09 PM

    Lavanya,
    This question relates to shell scripting and in IMO it is not an oracle question.
    I have made some initial assumptions before my proposed solution.
    PLEASE note that this is untested, but can just guide you as a template for solving your problem.
    Assuming that you have properly set up the control file and mapped each and every table in it as per the file information which you have..
    Assuming the text file to be in the format of : ------ (as suggested by other posters earlier, this file holds instructions about the file and table mapping which shall be used by your sqlldr process.)
    tmp.txt:
    text_file_1-------------should goes to----customer_info_table
    text_file_2------------should goes to------customer_address_table
    text_file_3-----------should goes to-------customer_order_table
    while read line
    do
    SQLLDR CONTROL=`echo $line | sed 's/should goes to/ /g' | sed 's/-//g' | awk -F " " '{print $1}'`.ctl,
    LOG=`echo $line | sed 's/should goes to/ /g' | sed 's/-//g' | awk -F " " '{print $1}'`.log,
    BAD=`echo $line | sed 's/should goes to/ /g' | sed 's/-//g' | awk -F " " '{print $1}'`.bad,
    DATA=`echo $line | sed 's/should goes to/ /g' | sed 's/-//g' | awk -F " " '{print $1}'`.txt
    USERID=scott/tiger
    done <tmp.txtAll I am trying to run from the above shell script is : -- PLEASE TEST it if it matches your requirement.
    SQLLDR CONTROL=text_file_1.ctl, LOG=text_file_1.log, BAD=text_file_1.bad, DATA=text_file_1.txt USERID=scott/tiger
    SQLLDR CONTROL=text_file_2.ctl, LOG=text_file_2.log, BAD=text_file_2.bad, DATA=text_file_2.txt USERID=scott/tiger
    SQLLDR CONTROL=text_file_3.ctl, LOG=text_file_3.log, BAD=text_file_3.bad, DATA=text_file_3.txt USERID=scott/tigerRepeating my assumptions, I assume you have all those files required for SQLLDR process to run (ctl file, data file...)
    Cheers,
    Manik

  • How to run a jar file using Java application.

    Hi all,
    I know that jar file can run using the following command, using the command prompt.
    java -jar jar-fileBut I don't know how to run that command through a Java code. Hope it's clear to you.
    So can you please explain how can I do it.
    Thanks,
    itsjava

    rayon.m wrote:
    The solution given by ropp appears to have nothing to do with what you asked about.Ok sir, I got the point.
    I've try a test as follows. But it doesn't give any output. Even not an exception.
            try {
                String[] temp = new String[]{"java", " -jar", " MainApp.jar"};
                Runtime rt = Runtime.getRuntime();
                Process proc = rt.exec(temp);
                int exitVal = proc.waitFor();
                System.out.println("ExitValue: " + exitVal);
                System.out.println("Temp_Values");
            catch(InterruptedException ex) {
                System.out.println(ex.getMessage());
            catch (IOException ex) {
                System.out.println(ex.getMessage());
            }I've debug and see, but the exitValue is even not exist at run time. Can you tell me where I'm going wrong.

  • How to run java file by using another applet file  ??

    how to compile and run java file by using another applet or japplet file .

    how to understand what you are talking about.

  • How to run an iPhoto Diashow using a beamer connected with a macbookair by HDMI wire

    How I have to do to run a iphoto diashow using a mcbookair connected (monitor connection) by wire with e beamer?
    Thanks in advance

    .

  • How to Run a simple program using JMS Queue.!!

    Hi All,
    I am trying to run simple program on JMS Queue.
    Using SOA Suite 10.1.3.2
    I created a connection factory and queue using EM.
    Connection Factory => Domain : Queue JNDI Location : jms/sidConnectionFactory
    Queue Name : SidQueue JNDI Location : jms/SidQueue
    Tried running a simple java class to send the messages to queue.[Pls find the file attached].
    Getting this error
    javax.naming.NamingException: META-INF/application-client.xml not found (see J2EE spec, application-client chapter for requirements and format of the file)
    at oracle.j2ee.naming.ApplicationClientInitialContextFactory.getRequiredClasspathResource(ApplicationClientInitialContextFactory.java:239)
    at oracle.j2ee.naming.ApplicationClientInitialContextFactory.getArchive(ApplicationClientInitialContextFactory.java:161)
    at oracle.j2ee.naming.ApplicationClientInitialContextFactory.getInitialContext(ApplicationClientInitialContextFactory.java:111)
    at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
    Can some one tell me how i need to create this file and where to place this[i.e is this need to be placed in  my project or some directory structure of <SOA-HOME>
    Thx,
    Siddhardha.
    Code:
    package demo;
    import java.io.IOException;
    import java.io.PrintWriter;
    import java.util.Properties;
    import javax.jms.*;
    import javax.naming.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class JMSQueue {
        public static void main(String args[])
    QueueConnection queueConnection;
    QueueSession queueSession;
    //private MessageProducer producer;
    QueueSender queueSender;
    try {          
    String message = "Test";
    String connectionFactoryName = "jms/sidConnectionFactory";
    String destinationName = "jms/SidQueue";
    /*Do i need to use this .......
    * If so where is the error in below statements...
    * Properties env = new Properties( );
    // ... specify the JNDI properties specific to the vendor
    env.put(Context.SECURITY_PRINCIPAL, "admin");
    env.put(Context.SECURITY_CREDENTIALS, "welcome");
    env.put(Context.INITIAL_CONTEXT_FACTORY,
    "com.evermind.server.ApplicationClientInitialContextFactory");
    env.put(Context.PROVIDER_URL,
    "ormi://localhost:23791");
    Context ctx = new InitialContext();
    // Get the connection factory.
    QueueConnectionFactory cf = (QueueConnectionFactory)ctx.lookup(connectionFactoryName);
    // Get the destination.
    Queue destination = (Queue) ctx.lookup(destinationName);
    // Use the connection factory to create a connection.
    queueConnection = cf.createQueueConnection();
    // Start the connection.
    queueConnection.start();
    // Use the connection to create a session.
    queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
    // Use the session and destination to create a message producer and a message consumer.
    //producer = queueSession.createProducer(destination);
    queueSender = queueSession.createSender(destination);
    TextMessage msg = queueSession.createTextMessage(message);
    queueSender.send(msg);
    queueSession.close();
    queueConnection.close();
    catch (Exception ex) {
    ex.printStackTrace();
    * Attached following libraries to the Project
    * jms.jar
    * optic.jar
    * oc4jclient.jar
    */

    Hi,
    You need to change the INITIAL_CONTEXT_FACTORY to com.evermind.server.RMIInitialContextFactory.
    Regards,
    Sandeep

  • How to run Aplet under Servlet?

    Hi!
    I'am using servletrunner. I have servlet which is in C:JSKD2.0\examples\. Where should I put the *.class (this is aplet) and how to finish this code to run the aplet?
    out.println("<HTML>\n"+
    "<HEAD>\n"+
    " <TITLE>Testing...</TITLE>\n"+
    "</HEAD>\n"+
    "<BODY>\n"+
    "<CENTER>\n"+
    ???"<APPLET CODE = "fdraw.class" NAME = "fdraw" WIDTH = 640 HEIGHT = 480>???
    "</CENTER>\n"+
    "</BODY>\n"+
    "</HTML>");
    This doesn't work! It gives mi "...class fdraw not found..." Why? Can anyone help me?

    Try adding a codebase attribute to your applet tag specifying where that class should be found.
    BTW, you don't run an applet "under" a servlet. The servlet receives requests from (normally) HTTP clients. The applet resides on the server, but is downloaded by the browser via embedded HTML tags.
    Though they are both on the server, they are fundamentally different technologies. Your applet may communicate with your servlet via HTTP (or a custom protocol). But the applet does not "live under" the servlet or vice versa. One is client, and the other is server. Normally, HTTP ties them together.
    - Saish

  • How to run a java program using additional jar files

    Hi everyone in the forum,
    i ve created an app using the hFreeChart in eclipse, so i added them as external jar files and tested the program.
    now my problem is that the program should run using a terminal in win and i do not know how can i do to make the command line or the system to find them, i added to the path but i read somtehing about classpath, but i have no idea. if anyone can help?
    thanks in advanced

    Actually, the best way to prepare a program for regular running is to make it an executable jar file, which means adding a manifest file which contains (at least) a Main-class: and a Class-Path: line. Referenced class libraries typically sit in a lib directory next to the java file. Then you can run it using java -jar myprog.jar.
    Failing that create a batch file or link that supplied java with command line parameters including a -classpath=
    Using the class path environment results in too much contention between competing values of it.

  • How to run a batch file using DAC

    Gurus,
    Please suggest if there is a way to run .bat files using DAC ? I suppose it can be done by configuring Execution Type as External Program. Please suggest how can this be achieved.
    Thanks

    I performed the same steps given in the link and ran the ex plan, but the task shows running and never completes. In my case i have created bat file for a different purpose (not for purging cache).
    Is the path shown in Step 5 the default path or it can be any path ? Please suggest.
    Thanks

Maybe you are looking for