Servlet not compiling

These are my 3 files
package coreservlets.beans;
class InsuranceInfo
     private String name = "No name specified";
     private String employeeID = "No ID specified";
     private int numChildren = 0;
     private boolean isMarried = false;
     public String getName()
          return(name);
     public void setName(String name)
          this.name = name;
     public String getEmployeeID()
          return(employeeID);
     public void setEmployeeID(String employeeID)
          this.employeeID = employeeID;
     public void setNumChildren(int numChildren)
          this.numChildren = numChildren;
     public int getNumChildren()
          return(numChildren);
     public boolean isMarried()
          return(isMarried);
     public void setMarried(boolean isMarried)
          this.isMarried = isMarried;
package coreservlets.beans;
import java.util.*;
import javax.servlet.http.*;
import org.apache.commons.beanutils.*;
public class BeanUtilities
    public static void populateBean(Object formBean, HttpServletRequest request)
     populateBean(formBean, request.getParameterMap());
    public static void populateBean(Object bean, Map propertyMap)
     try
         BeanUtils.populate(bean, propertyMap);
     catch(Exception e)
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import org.apache.commons.beanutils.*;
import coreservlets.beans.*;
public class SubmitInsuranceInfo extends HttpServlet
     public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
          InsuranceInfo info = new InsuranceInfo();
          BeanUtilities.populateBean(info,request);
          response.setContentType("text/html");
          PrintWriter out = response.getWriter();
          String docType = "<!DOCTYPE HTML PUBLIC \"-//W3C HTML 4.0 " + "Transitional//EN\">\n";
          String title = "Insurance Info For " + info.getName();
          out.println(docType  + "<html>" + "<head><title>" + title + "</title></head>");
          out.println("<center><h1>" + title + "</h1><br>");
          out.println("<ul><li>Employee ID: " + info.getEmployeeID() + "<br><li>Number Of Children: " + info.getNumChildren());
          out.println("<li><br>Married: " + info.isMarried() + "</ul></center></body></html>");
}i compile the file InsuranceInfo and BeanUtilities. Both compiled.I put both the classfiles inside coreservlets/beans.
Now I tried to compile SubmitInsuranceInfo where I have import coreservlets.beans.;
linux-9jc3:~/Development/Servlets # javac SubmitInsuranceInfo.java
SubmitInsuranceInfo.java:11: cannot access InsuranceInfo
bad class file: ./InsuranceInfo.java
file does not contain class InsuranceInfo
Please remove or make sure it appears in the correct subdirectory of the classpath.
InsuranceInfo info = new InsuranceInfo();
^
1 error
I can't understand the error because I have set the classpath to .
I am compiling from a folder called Servlet
The directory structure is
Servlet
|____SubmitInsuranceInfo.java
|____coreservlet
|
|____beans
|
|____InsuranceInfo.class
|____BeanUtilities.class

Did that but still I am getting the same error
SubmitInsuranceInfo.java:11: cannot access InsuranceInfo
bad class file: ./InsuranceInfo.java
file does not contain class InsuranceInfo
Please remove or make sure it appears in the correct subdirectory of the classpath.
InsuranceInfo info = new InsuranceInfo();
^
1 error
linux-9jc3:~/Development/Servlets #
It looks like a classpath issue
I have the classpath as . and moreover I have put both the InsuranceInfo and BeanUtilities.class in coreservlets/beans/ folder. The coreservlets dir is in Servlets dir. I am compililing the SubmitInsuranceInfo.java file from the Servlets dir.

Similar Messages

  • SOLARIS -- servlets not compiling

    am getting the error package javax.servlet doesn't exist...
    i have tried the following
    1)unpacked the jar file and put .java file in he very directory -No Use
    2)pointed the class path variable to common/lib/servlet.jar - No Use
    3)used the javac -classpath option -- No Use
    Tell me where it could have gone wrong

    2)pointed the class path variable to
    common/lib/servlet.jar - No UseYou are on the right path with setting the classpath I believe. I use solaris for Java frequently and that plan works well. Perhaps try setting the JAR filename using its absolute path (not a relative one from the java directory).
    e.g.
    setenv classpath /usr/apache.org/tomcat_4.0.4/common/lib/servlet.jar

  • Applet Servlet communication compiles but does not communicate

    Hi,
    I have a applet which has a button named A. By clicking the button, the applet passes the letter A to the servlet. The servlet in turn accesses an Oracle database and retrieves the name corresponding to letter A from a table (name is Andy in the present case). The servlet interacts with the databse via a simple stored procedure and uses its output parameter to display the name Andy back in the applet.
    Both the applet and servlet codes have compiled fine(servlet code compiled with -classpath option to servlet jar using a TOMCAT). However, on clicking button A in the applet, I do not get the name Andy.
    Any help/suggestion in resolution of this is highly appreciated. Thanks in advance.
    HTML CODE:
    <html>
    <center>
    <applet code = "NameApplet.class" width = "600" height = "400">
    </applet>
    </center>
    </html>
    STORED PROCEDURE CODE:
    procedure get_letter_description(
    ac_letter IN CHAR,
    as_letter_description OUT VARCHAR2) IS
    BEGIN
    SELECT letter_description INTO as_letter_description FROM letter WHERE letter =
    ac_letter;
    EXCEPTION
    WHEN no_data_found THEN as_letter_description := 'No description available';
    END get_letter_description;
    APPLET CODE:
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    import java.util.*;
    import java.io.*;
    import java.net.*;
    public class NameApplet extends Applet implements ActionListener
    private TextField text;
    private Button button1;
    private String webServerStr = null;
    private String hostName = "localhost";
         private int port = 8080;
    private String servletPath = "/examples/servlet/NameServlet?letter=";
    private String letter;
    public void init()
         button1 = new Button("A");
    button1.addActionListener(this);
    add(button1);
              text = new TextField(20);
         add(text);
    // get the host name and port of the applet's web server
              URL hostURL = getCodeBase();
         hostName = hostURL.getHost();
    port = hostURL.getPort();
              webServerStr = "http://" + hostName + ":" + port + servletPath;
    public void actionPerformed(ActionEvent e)
         if (e.getSource() == button1)
         letter = "" + 'A';
    private String getName(String letter){
    String name = "" ;
    try {
              URL u = new URL(webServerStr + letter);
              Object content = u.getContent();
    name = content.toString();
         } catch (Exception e) {
         System.err.println("Error in getting name");
    return name;
    SERVLET CODE:
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    import java.sql.*;
    import java.util.Properties;
    public class NameAppletServlet extends HttpServlet {
    private static Connection conn = null;
    private static final char DEFAULT_CHAR = 'A';
    private static final char MIN_CHAR = 'A';
    private static final char MAX_CHAR = 'G';
    private static final String PROCEDURE_CALL
    = "{call get_letter_description(?, ?)}";
    protected void doGet( HttpServletRequest request,
    HttpServletResponse response )
    throws ServletException, IOException
    handleHttpRequest(request, response);
    protected void doPost( HttpServletRequest request,
    HttpServletResponse response )
    throws ServletException, IOException
    handleHttpRequest(request, response);
    protected void handleHttpRequest( HttpServletRequest request,
    HttpServletResponse response )
    throws ServletException, IOException
    String phrase = null;
    char letter = getLetter(request, DEFAULT_CHAR);
    if (letter >= MIN_CHAR && letter <= MAX_CHAR) {
    try {
    name = getName(conn, letter);
    } catch (SQLException se) {
    String msg = "Unable to retrieve name from database.";
    name = msg;
    } else {
    String msg = "Invalid letter '" + letter + "' requested.";
    //throw new ServletException(msg);
    phrase = msg;
    response.setContentType("text/plain");
    PrintWriter out = response.getWriter();
    out.println(name);
    private String getName(Connection conn, char letter)
    throws SQLException
    CallableStatement cstmt = conn.prepareCall(PROCEDURE_CALL);
    cstmt.setString(1, String.valueOf(letter));
    cstmt.registerOutParameter(2, Types.VARCHAR);
    cstmt.execute();
    String name = cstmt.getString(2);
    cstmt.close();
    return name;
    private char getLetter(HttpServletRequest request, char defaultLetter) {
    char letter = defaultLetter;
    String letterString = request.getParameter("letter");
    if (letterString!=null) {
    letter = letterString.charAt(0);
    return letter;
    public void init(ServletConfig conf) throws ServletException {
    super.init(conf);
    String dbPropertyFile = getInitParameter("db.property.file");
    try {
    Class.forName("oracle.jdbc.driver.OracleDriver");
    conn = DriverManager.getConnection(
    "jdbc:oracle:thin:myserver:1521:CDD",
    "scott",
    "tiger");
    } catch (IOException ioe) {
    throw new ServletException(
    "Unable to init ReinforcementServlet: " + ioe.toString());
    } catch (ClassNotFoundException cnfe) {
    throw new ServletException(
    "Unable to init ReinforcementServlet. Could not find driver: "
    + cnfe.toString());
    } catch (SQLException se) {
    throw new ServletException(
    "Unable to init ReinforcementServlet. Error establishing"
    + " database connection: " + se.toString());
    }

    Hi,
    I am not able to understand by which method you are doing Applet-Servlet commuincation.
    If you want to use Object Serialization method, plz.get the details from following URL.
    http://www.j-nine.com/pubs/applet2servlet/
    Ajay

  • Plz help why its not compiling ,

    hello all i am trying to make the tutorial http://developers.sun.com/mobility/midp/articles/tutorial2/
    i have made all the steps once i try to compile it it shows the folowing error:
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: Wrapper cannot find servlet class HitServlet or a class it depends on
         at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:836)
         at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:613)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:164)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
    etc.....
    i believe the error has something to do with my classpath thats why its not compiling the HitServlet.java
    if anybody can show me plz how to make this following step :
    Compiling the Servlet
    Compiling servlet code is pretty much the same as for other Java development, except for an important twist. Because the servlet API is not a core part of the Java SE platform, you'll need to add it to your CLASSPATH before you can compile servlets.
    The servlet API is contained in common/lib/servlet.jar under the Tomcat root directory. Simply add this file to your CLASSPATH and you will be able to compile HitServlet.java using javac. You can edit the CLASSPATH in the system properties or do it on the command line, as this Windows example demonstrates:
    C:\>set CLASSPATH=\jakarta-tomcat-4.1.31\common\lib\servlet.jar
    C:\>javac HitServlet.java
    i have installed the tomcat and its working fine but i dont understand how to set the classpath , i tried to make it in control panel / system / envirement and put the classpath but its still doesnt work
    please help on what i should make in my classpath and how to set it to work if not please notify me where am i making mistake thank you
    appreciate a lot help

    hello all i am trying to make the tutorial http://developers.sun.com/mobility/midp/articles/tutorial2/
    i have made all the steps once i try to compile it it shows the folowing error:
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: Wrapper cannot find servlet class HitServlet or a class it depends on
         at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:836)
         at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:613)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:164)
         at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:596)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:433)
    etc.....
    i believe the error has something to do with my classpath thats why its not compiling the HitServlet.java
    if anybody can show me plz how to make this following step :
    Compiling the Servlet
    Compiling servlet code is pretty much the same as for other Java development, except for an important twist. Because the servlet API is not a core part of the Java SE platform, you'll need to add it to your CLASSPATH before you can compile servlets.
    The servlet API is contained in common/lib/servlet.jar under the Tomcat root directory. Simply add this file to your CLASSPATH and you will be able to compile HitServlet.java using javac. You can edit the CLASSPATH in the system properties or do it on the command line, as this Windows example demonstrates:
    C:\>set CLASSPATH=\jakarta-tomcat-4.1.31\common\lib\servlet.jar
    C:\>javac HitServlet.java
    i have installed the tomcat and its working fine but i dont understand how to set the classpath , i tried to make it in control panel / system / envirement and put the classpath but its still doesnt work
    please help on what i should make in my classpath and how to set it to work if not please notify me where am i making mistake thank you
    appreciate a lot help

  • Simple Java class using SQLJ not compiling.

    Hello all, I have a simple Java class that is using SQLJ. It will not compile though. I am not sure what I should set for classpath. Any ideas? This is what I have so far.
    set PATH=C:\jdk1.2.2\bin;c:\oracle\ora81\jdbc\bin;
    set CLASSPATH="C:\oracle\ora81\jdbc\lib\classes12.zip;C:\oracle\ora81\sqlj\lib\runtime12.zip;C:\oracle\ora81\sqlj\lib\translator.zip;C:\jdk1.2.2\lib\*.*"
    then
    javac SQLJTester.java
    Here is my .java file ---
    import java.io.*;
    import java.sql.*;
    import sqlj.runtime.*;
    import sqlj.runtime.ref.*;
    public class SQLJTester {
    public static void update() throws Exception {
    java.sql.Timestamp timeNow;
    #sql {
    BEGIN
    :timeNow := sysdate;
    END
    public static void main (String[] args) {
    try {
    SQLJTester.update();
    System.out.println ("Updated successfully");
    catch (Exception e) {
    System.out.println ("Caught an exception.");
    Thanks ahead for your time,
    Justin

    When sqlj files are compiled and translted to java file with them the file with extension .ser is also generated. browsers do not recognise this .ser files they only understand .class files which the download using <codebase> instead of class path. so thats why you r not able to use sqlj in servlet. try to customize the profile. Now can some one inform how to use sqlj from eclipse. does it support?. i need to downoad sqlj.exe for that. if anyone has idea from where i can download sqlj.exe pls inform me at [email protected]

  • Included JSPs not compiling

    I have some JSP code which does not compile in JDeveloper but works fine when deployed in a web server (Websphere).
    There is a page called main.jsp with code like:
    Map clientDataList = (Map) request.getAttribute("clientDataList");
    <%@ include file="standard1Page.jsp" %>
    clientDataList is set in a servlet which forwards to main.jsp. On standard1Page.jsp I want to access the clientDataList object:
    <%= clientDataList.get("sitealignment") %>
    But standard1Page.jsp does not compile in JDeveloper because clientDataList is not defined on that page:
    Error(2,75): variable clientDataList not found in class _standard1Page
    Is this a fundamental problem with JDeveloper not following through the "includes" when doing the project compile, or is there something I can set to make this stuff compile. If not I'm going to have to edit my JSPs in a text editor so I can compile my project.
    Francis

    I have some JSP code which does not compile in JDeveloper but works fine when deployed in a web server (Websphere).
    There is a page called main.jsp with code like:
    Map clientDataList = (Map) request.getAttribute("clientDataList");
    <%@ include file="standard1Page.jsp" %>
    clientDataList is set in a servlet which forwards to main.jsp. On standard1Page.jsp I want to access the clientDataList object:
    <%= clientDataList.get("sitealignment") %>
    But standard1Page.jsp does not compile in JDeveloper because clientDataList is not defined on that page:
    Error(2,75): variable clientDataList not found in class _standard1Page
    Is this a fundamental problem with JDeveloper not following through the "includes" when doing the project compile, or is there something I can set to make this stuff compile. If not I'm going to have to edit my JSPs in a text editor so I can compile my project.
    Francis The problem is that "standard1page.jsp" is not a JSP page, it is just a text fragment to be included in a real JSP page. As it's just a fragment, it won't compile correctly as a JSP page. If you add it to your project as ".jsp", JDeveloper tries to compile it.
    A common convention for JSP included fragments is to name them with a".jspf" suffix, so it's relatively clear what they are, and to make the IDE not compile them as JSP pages.

  • Some jsps will not compile FC5+Tomcat

    Hello,
    I cannot compile SOME jsp pages for some reason.
    I have something like this:
    http://www.mydomain.net:8080/WEB/index.jsp - this comiles
    http://www.mydomain.net:8080/WEB/BLAH/BLAH/index.jsp - will not compile where BLAH is a bunch of different folders.
    I have it all working on Win XP. Now I am trying to make it work on FC5.
    I took the page that can compile and moved it to BLAH/BLAH folder and it does not compile now!
    OS: Fedora Core 5 (if it matters)
    What is going on? Any ideas?
    Thanks.

    sure, here it is
    Thanks for help.
    org.apache.jasper.JasperException: Unable to compile class for JSP
         org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:97)
         org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:342)
         org.apache.jasper.compiler.AntCompiler.generateClass(AntCompiler.java:248)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:296)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    Compile failed; see the compiler error output for details.
         org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:944)
         org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:764)
         org.apache.jasper.compiler.AntCompiler.generateClass(AntCompiler.java:216)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:296)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

  • Package javax.servlet not found error

    package javax.servlet not found error. how it can be solved.
    plz help this is my first servlet program.
    vipin

    You need a jar file that has in it the javax.servlet.* classes
    It should be distributed with your servlet/jsp server.
    It can normally be found in a /lib directory under the installation.
    Some examples:
    Tomcat4: install_dir\common\lib\servlet.jar
    Tomcat5: install_dir\common\lib\servlet-api.jar; install_dir\common\lib\jsp-api.jar
    J2sdkee: install_dir/lib/j2ee.jar
    You need to include this jar file in your classpath when you compile any servlet.

  • Error while transforming XSLT,"Could not compile stylesheet"

    Hi,
    During transformation of my XSLT I needs to fetch data from method named *"myMethod(String str)"*, which is in *"mypackage.test.MyClass"* class. MyClass is in{color:#000000} XXX.jar. {color}
    This XXX.jar is not in context of my web application.*
    Following is part of XSLT which I am using.
    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:aaa="mypackage.test.MyClass">
    <xsl:template match="/responseData">
    <xsl:for-each select="response">
    <XMLResponse>
    <xsl:for-each select="status">
    <xsl:variable name="Vvar_ResResponseType" select="."/>
    <xsl:attribute name="ResResponseType">
    <xsl:value-of select="aaa:myMethod($Vvar_ResResponseType)"/>
    </xsl:attribute>
    </xsl:for-each>
    </XMLResponse>
    </xsl:for-each>
    </xsl:template>
    </xsl:stylesheet>So I tried to use reflection API to load XXX.jar file at runtime.
    But while transforming Transformer does not find "myMethod(String str)" and gives error like "Could not compile stylesheet"
    Following is full exception stacktrace
    ERROR:  'The first argument to the non-static Java function 'myMethod' is not a valid object reference.'
    FATAL ERROR:  'Could not compile stylesheet'
    javax.xml.transform.TransformerConfigurationException: Could not compile stylesheet
    at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:829)
    at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:623)
    at com.actl.dxchange.utilities.Transformation.transform(Transformation.java:83)
    at com.actl.dxchange.base.BaseConnector.transform(BaseConnector.java:330)
    at com.actl.dxchange.connectors.KuoniConnector.doRequestProcess(KuoniConnector.java:388)
    at com.actl.dxchange.connectors.KuoniConnector.hotelAvail(KuoniConnector.java:241)
    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:585)
    ...........Please suggest is there any other way, so that Transformer can find required bean class from XXX.jar duruing transformation process.
    Thanks & Regards,
    Rohit Lad
    Edited by: Rohit_Lad on Jan 29, 2009 7:38 PM
    Edited by: Rohit_Lad on Jan 30, 2009 9:57 AM
    Edited by: Rohit_Lad on Jan 30, 2009 10:02 AM

    Got the solution from forum named
    "Reflections & Reference Objects"
    Following is link for whom encountered this issue.
    http://forums.sun.com/thread.jspa?threadID=5362426
    Edited by: Rohit_Lad on Jan 30, 2009 2:35 PM

  • XSLT Exception: FATAL ERROR:  'Could not compile stylesheet'

    Hi....
    Am getting Folowing Exception while parsing the XSL file. Am using java 1.4 and MSXML4.2 SP2 parser andSDK.
    but when I installed SQLServer2005, with that MSXML 6.0 Parser is Installed.
    It is working fine before instalation of SQLServer2005.
    java.lang.NullPointerException
         at com.sun.org.apache.xalan.internal.xsltc.compiler.FunctionCall.translate(FunctionCall.java:826)
         at com.sun.org.apache.xalan.internal.xsltc.compiler.ValueOf.translate(ValueOf.java:114)
         at com.sun.org.apache.xalan.internal.xsltc.compiler.SyntaxTreeNode.translateContents(SyntaxTreeNode.java:490)
         at com.sun.org.apache.xalan.internal.xsltc.compiler.XslAttribute.translate(XslAttribute.java:252)
    Compiler warnings:
    file:///F:/Data/JRun4/servers/ABC/MainXSL.xsl: line 155: Attribute 'LenderBranchIdentifier' outside of element.
    file:///F:/Data/JRun4/servers/ABC/MainXSL.xsl: line 156: Attribute 'LenderRegistrationIdentifier' outside of element.
    ERROR: 'null'
    FATAL ERROR: 'Could not compile stylesheet'
    javax.xml.transform.TransformerConfigurationException: Could not compile stylesheet
         at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:753)
         at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:548)
         at com.ls.lsglobal.common.CLOUTSQLXML.TransXml2Xml(CLOUTSQLXML.java:274)
    And My XSL is
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="2.5" xmlns:lsjava1="com.ls.lsglobal.common" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="lsjava1" >
         <xsl:output method="xml" indent="yes" encoding="utf-8" doctype-system="MyRequest.1.3.DTD"/>
         <xsl:template match="/" >
              <REQUEST_GROUP>
                                       <TRANSMITTAL_DATA>
                                            <xsl:if test="AppraisedVal!=''">
                                                 <xsl:attribute name="AppraisedValueAmount"><xsl:value-of select="AppraisedVal"/></xsl:attribute>
                                            </xsl:if>
                                            <xsl:if test="StatedVal!=''">
                                                 <xsl:attribute name="EstimatedValueAmount"><xsl:value-of select="StatedVal"/></xsl:attribute>
                                            </xsl:if>
                                            <xsl:for-each select="ROOT/AppMain/MyLoop/Liab">
                                                 <xsl:if test=" normalize-space(LiabTypCd) = 'SMG' and (normalize-space(PresFutTypCd) = 'BOTH' or normalize-space(PresFutTypCd) = 'PRES') and PresLienPos='1' and normalize-space(RefCd) != 'LOAN'">
                                                      <xsl:attribute name="CurrentFirstMortgageHolderType"><xsl:value-of select="LiabId"/></xsl:attribute>
                                                 </xsl:if>
                                            </xsl:for-each>
                                            <xsl:attribute name="LenderBranchIdentifier">0001</xsl:attribute>
                                            <xsl:attribute name="LenderRegistrationIdentifier"><xsl:value-of select="ROOT/AppMain/MyNum"/></xsl:attribute>
                                       </TRANSMITTAL_DATA>
              </REQUEST_GROUP>
         </xsl:template>
    </xsl:stylesheet>
    And My Java Code is
    public String TransXml2Xml(String xmlInFile, String xslFile, String xmlOutFile) throws Exception
              try
                   DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                   factory.setIgnoringElementContentWhitespace(true);
                   Document document;
                   File stylesheet = new File(xslFile);
                   File dataInfile = new File(xmlInFile);
                   DocumentBuilder builder = factory.newDocumentBuilder();
                   document = builder.parse(dataInfile);
                   System.err.println("-->AVC:::xslFile="+xslFile+" xmlInFile="+xmlInFile+" xmlOutFile="+xmlOutFile);
                   StreamSource stylesource = new StreamSource(stylesheet);
                   TransformerFactory t=TransformerFactory.newInstance();
                   Transformer transformer = t.newTransformer(stylesource);
                   DOMSource source = new DOMSource(document);
                   javax.xml.transform.stream.StreamResult result = new javax.xml.transform.stream.StreamResult(new File(xmlOutFile));
                   transformer.setOutputProperty(javax.xml.transform.OutputKeys.INDENT , "yes");
                   transformer.setOutputProperty(javax.xml.transform.OutputKeys.ENCODING, "UTF-8");
                   transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
                   if(strCLUTDTD_PATH.equals(""))
                        java.util.Properties props = new java.util.Properties();
                        java.io.FileInputStream fis = new java.io.FileInputStream("DataFileBasePath.properties");
                        props.load(fis);
                        fis.close();
                        strCLUTDTD_PATH = checkNull(props.get("CLUTREQDTD_PATH"));
                   transformer.setOutputProperty(javax.xml.transform.OutputKeys.DOCTYPE_SYSTEM , strCLUTDTD_PATH);
                   transformer.transform(source, result);
              catch(Exception e)
                   e.printStackTrace();
                   throw e;
              return "";
    can any one know what solution for this problem. It is very help full for me.

    So look at your code and find out what you are passing to the TransformerFactory. Then find out why it's null. Don't just sit there and say "Duh", it's your code.
    And remember that nobody but you can see it yet. If you like you could post it here and then others could see it and comment on it.

  • NewTransformer - Could not compile stylesheet exception

    Using the following code:
    Transformer transformer = factory.newTransformer( new StreamSource(xsltFile) );
    If I fill the xsltFile string variable with "contents.xslt" it goes through fine.
    But, if I put the following into the xsltFile variable, it throws the following exception:
    "C:\\test\\src\\xslt\\contents.xslt"
    Failed to transform file C:\DB Documenter\output\xml\main.xml due to: javax.xml.transform.TransformerConfigurationException: Could not compile stylesheet
    I am formatting the the source and result strings in the actual transform the same way, and they work fine pointing to a c:\ directory. Any reason this blows up on the newTransformer call?
    Here is the whole code:
    public void performTransform(String xsltFile, String xmlFile, String htmlFile) {       
    try {           
    TransformerFactory factory = TransformerFactory.newInstance();
    /* xsltFile = "contents.xslt"; */
    xsltFile = "C:\\DB Documenter\\src\\xslt\\contents.xslt";
    Transformer transformer = factory.newTransformer( new StreamSource(xsltFile) );
    StreamSource xmlSource = new StreamSource(xmlFile);
    StreamResult htmlResult = new StreamResult(htmlFile);
    transformer.transform(xmlSource, htmlResult);
    } catch (Exception e) {
    JOptionPane.showMessageDialog(null, "Failed to transform file " + xmlFile + " due to: " + e);
    }

    StreamSource/Results are simple POJOs: the interpretation of the the system ID you construct them from is left to the interpretation of the object that will use them. This is why the behavior is not consistent.
    For this reason, I never use StreamSource/Result(String) constructors but prefer either the constructor that takes a File or a Reader.

  • TransformerConfigurationException...Could not compile stylesheet

    So far my XSLT stylesheet was executed in operations mapping without problems.
    However I had to make some changes (e.g. adding some additional xsl:choose elements) and now I get the following compilation error:
    TransformerConfigurationException occured when loading XSLT xxxxxxx; details: Could not compile stylesheet
    I develop and change the XSLT externally using XML Spy and there I could run a test transformation without problems or errors.
    Only after reimporting as IA archive and selecting the new version in operations mapping I get the error.
    How is this possible? How can I debug to find the root cause for the error?
    Edited by: Florian Guppenberger on Nov 13, 2009 6:05 PM

    Hello,
    what I have done is to add an additional <xsl:choose> to an already existing <xsl:choose> in the <xsl:otherwise> branch at several locations. Example below.
    I hope that there was not typo somwhere else, however what is very strange is that XML Spy says that the XSLT is well-formed and a test transformation executes successfully too.
    For that XSLT it is not such a big problem, because I can roll-back to the previous version but I am really concerned if you build a big XSLT from scratch in XML Spy an after import in PI you get a compilation error. So it would be really good to find a root cause for this.
    <xsl:choose>
    <xsl:when test="RET_DATE">
      <xsl:attribute name="nullFlavor"><xsl:value-of select="RET_DATE"/></xsl:attribute>
    </xsl:when>
    <xsl:otherwise>
        <xsl:choose>
            <xsl:when test="RET_DATE_VALUE='00000000'">
                 <xsl:attribute name="nullFlavor"><xsl:text>NA</xsl:text></xsl:attribute>
            </xsl:when>
            <xsl:otherwise>
                 <xsl:attribute name="value"><xsl:value-of select="RET_DATE_VALUE"/></xsl:attribute>
            </xsl:otherwise>
          </xsl:choose>  
    </xsl:otherwise>
    </xsl:choose>
    Edited by: Florian Guppenberger on Nov 16, 2009 11:05 AM
    Edited by: Florian Guppenberger on Nov 16, 2009 11:06 AM

  • Package body greater than 2160 bytes does not compile in Object Browser

    Hi there,
    I initially created a package in Apex 2.1.0.0.39 using the Object Browser and it compiled OK. The message in the box above the source code says "PL/SQL code successfully compiled (17:51:08)". I then added more code and eventually when I clicked the "Compile" button" the message to say successfull compilation or any error message was not displayed. The box above the source code remains blank. After much trial and error I found that by adding just one more letter to the end of a comment that it would not compile, but by removing the letter then it would compile most of the time. I downloaded the package and found that the size of the download .PLB file was 2160 bytes. Editing the PLB file using a text editor to increase the size and executing it in SQL*PLUS does work.
    Is this a fundamental limit on the size of packages that can be compiled using the Object Browser, or is there an Apex configuration parameter that can be modified to allow larger packages? If this is a limit then why isn't an informational message displayed? Or is this in fact an installation issue or an issues with Apex Object Browser?
    Further information:
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    PL/SQL Release 10.2.0.1.0 - Production
    CORE 10.2.0.1.0 Production
    TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    I installed this version back at the beginning of the year for training purposes and have not made any conifiguration changes that I am aware of, or installed any further upgrades/software since.
    All help gratefully received by this "definitely a nubie".
    Regards.
    John.

    John,
    If you are using, as you said, Application Express version 2.1.0.0.39, be aware that this is a very old (and not a supported) version. If you have trouble with the latest version (currently 3.2), feel free to report them here.
    Scott

  • Problem with shuffle() code, will not compile

    Hi,
    Below is some code designed to shuffle a set of integers in the file editET.txt. Basically:
    5
    2
    4 say:
    just shuffle these randomly around, however, the code will not compile, any advice or solutions would be great
    import java.io.*;
    import java.util.*;
    public class Shuffle3 {
    public static void main (String [] args) {
    if (args.length<2){
    System.out.println("Usage: java Shuffle3 <input file> <output file>");
    System.exit(-1);
    ShuffleStringList sl = new ShuffleStringList(args[0]);
    sl.shuffle();
    sl.save(args[1]);
    class ShuffleStringList extends StringList {
    public ShuffleStringList(String "editET.txt") {
         super(fileName);
    public void shuffle() {
    Collections.shuffle(this);
    public void save (String "Shuffledok"){
         PrintWriter out = null;
         try {
         out = new PrintWriter(new FileOutputStream("Shuffledok"), true);
    for (int i=0; i < size(); i++){
              out.println((String)get(i));
    catch(IOException e) {
    e.printStackTrace();
    finally {
         if(out !=null) {out.close();}
    class StringList extends ArrayList{
    public StringList(){
         super();
    public StringList(String "editET.txt") {
         this();
    String line = null;
    BufferedReader in = null;
         try {
         in = new BufferedReader(new FileReader("editET.txt"));
         while((line = in.readLine()) !=null) {
              add(line);
    catch(IOException e){
         e.printStackTrace();
    public void save (String "Shuffledok") {
    FileWriter out = null;
    try {
         out = new FileWriter("Shuffledok");
         for(int i =0; i < size(); i++){
         out.write((String)get(i));
    catch(IOException e){
         e.printStackTrace();
    finally {
         try{out.close();} catch (IOException e) {e.printStackTrace();}
    public void shuffle() {
    Collections.shuffle(this);

    import java.io.*;
    import java.util.*;
    public class Shuffle3 {
    public static void main (String [] args) {
    ShuffleStringList sl = new ShuffleStringList("editET.txt");
    sl.shuffle();
    sl.save("Shuffledok");
    class ShuffleStringList extends StringList {
    public ShuffleStringList(String fileName) {
    super(fileName);
    public void shuffle() {
    Collections.shuffle(this);
    public void save (String target){
    PrintWriter out = null;
    try {
    out = new PrintWriter(new FileOutputStream(target), true);
    for (int i=0; i < size(); i++){
    out.println((String)get(i));
    catch(IOException e) {
    e.printStackTrace();
    finally {
    if(out !=null) {out.close();}
    class StringList extends ArrayList{
    public StringList(){
    super();
    public StringList(String fileName) {
    this();
    String line = null;
    BufferedReader in = null;
    try {
    in = new BufferedReader(new FileReader(fileName));
    while((line = in.readLine()) !=null) {
    add(line);
    catch(IOException e){
    e.printStackTrace();
    public void save (String target) {
    FileWriter out = null;
    try {
    out = new FileWriter(target);
    for(int i =0; i < size(); i++){
    out.write((String)get(i));
    catch(IOException e){
    e.printStackTrace();
    finally {
    try{out.close();} catch (IOException e) {e.printStackTrace();}
    public void shuffle() {
    Collections.shuffle(this);
    }

  • PL/SQL spatial query will not compile.

    I have a PL/SQL spatial query that will not compile, but the equivalent SQLPlus query works fine. I.e. (convert decimal degrees to degrees,minutes,seconds)
    Any thoughts much appreciated....
    THIS WORKS in SQLPlus
    select
    decode(rownum,1,decode(sign(b.column_value),-1,'W','E'),2,decode(sign(b.column_v
    alue),-1,'S','N'))&#0124; &#0124;
    to_char(abs(trunc(b.column_value,0)),'999')
    &#0124; &#0124;to_char(abs(trunc((b.column_value - trunc(b.column_value,0)) * 60,0)),'99')
    &#0124; &#0124;to_char(abs(
    (((b.column_value - trunc(b.column_value,0)) * 60) - trunc((b.column_value - tru
    nc(b.column_value,0)) * 60,0)) * 60
    ),'99.99')
    from route_location a, table(a.line.sdo_ordinates) b
    where a.route_adms_id = 13820370
    and record_seq_num = 26
    and rownum < 3
    BUT THIS DOES NOT
    ADMS>create or replace procedure PKG_route_loc_latlong_ins
    2 (iADMS_ID in INTEGER, iRSN in INTEGER,
    3 vcLAT out VARCHAR2, vcLONG out VARCHAR2) as
    4 cursor c1 is
    5 select decode(rownum,1,decode(sign(b.column_value),-1,'W','E'),
    6 2,decode(sign(b.column_value),-1,'S','N'))
    7 &#0124; &#0124;to_char(abs(trunc(b.column_value,0)),'999')
    8 &#0124; &#0124;to_char(abs(trunc((b.column_value - trunc(b.column_value,0)) * 60,0)),
    '99')
    9 &#0124; &#0124;to_char(abs(
    10 (((b.column_value - trunc(b.column_value,0)) * 60) -
    11 trunc((b.column_value - trunc(b.column_value,0)) * 60,0)) * 60
    12 ),'99.99')
    13 from route_location a, table(a.line.sdo_ordinates) b
    14 where a.route_adms_id = iADMS_ID
    15 and a.record_seq_num = iRSN
    16 and rownum < 3;
    17 BEGIN
    18 open c1;
    19 fetch c1 into vcLONG;
    20 fetch c1 into vcLAT;
    21
    22 EXCEPTION
    23 when others then
    24 vcLAT := 'ERROR';
    25 RAISE_APPLICATION_ERROR(-20002,
    26 'XXXXXXXXXXXXXX ');
    27
    28 END pkg_route_loc_latlong_ins;
    29 /
    Warning: Procedure created with compilation errors.
    ADMS>
    ADMS>show errors
    Errors for PROCEDURE PKG_ROUTE_LOC_LATLONG_INS:
    LINE/COL ERROR
    5/5 PL/SQL: SQL Statement ignored
    5/12 PLS-00320: the declaration of the type of this expression is
    incomplete or malformed
    5/12 PLS-00320: the declaration of the type of this expression is
    incomplete or malformed
    13/34 PLS-00201: identifier 'A.LINE' must be declared
    19/5 PL/SQL: SQL Statement ignored
    20/5 PL/SQL: SQL Statement ignored
    null

    try a
    FOR UPDATE OF ID NOWAIT;where ID is the name of a column in the table.

Maybe you are looking for

  • Itunes wont open on Vista   "windows error"

    I have tried to open itunes for the past week or two and i get a type of error.... iTunes has stopped working Windows is checking for a solution to the problem.... *after a minute it changes to* A problem caused the program to stop working corectly.

  • Custom Transaction using RSDMD to go to MD Screen Directly

    Hi, I have created a custom transaction for Master Data Maint. which uses RSDMD and the InfoObject name. By using this custom transaction I can reach to the screen to filter the records. Here I click on execute (F8) to reach the actual data. I used S

  • Installation error: Adobe Color JA Extra Settings CS4

    I have a multiuser Mac CS4 Design Studio (college department).  All but one computer is installing fine.  This is a PowerMac G5 with 10.5.8.  Clean as a whistle, nothing funny installed, no other problems. The installer fails when installing Illustra

  • Getting started with trial version of Adobe XI

    I downloaded the trial version of Adobe XI.  Once installed I attempted to convert a PDF document into a Word document by clicking on the "tools" as instructed in the tutorial.  I then chose convert to "Microsoft Work" and clicked on "convert".  A bo

  • How can I put everything back in my iPhone to the new iTunes?

    My computer was broken down and I bought a new one. I download an new iTunes, of course nothing inside! I just want to know how can I put back all my things in iPhone to the new iTunes! That's means I have all the things( songs, apps...etc ) in my iP