Release 12.0.4 "ego" pages: unable to compile standard .java

Hi All,
I have downloaded all the necessary files and was able to build a local copy of particular set of pages. I even ran those pages in my local setup.
Then to understnad the flow I decompiled few controller CLASS files using JAD. Now I am unable to compile the java files (i have just added few System.out.println's) .
I get errors for the following piece of standard code:
oaapplicationmodule.invokeMethod("getTrainStationsContent", new Serializable[] {
key
, new Class[] {      
oracle/jbo/Key ---> Cause of error
I also tried rephrasing "oracle/jbo/Key" as "(Class)oracle.jbo.Key" but no luck.
The error which is displayed is
Error(732,13): field oracle not found in class oracle.apps.ego.item.eu.webui.EgoCreateItemPageLayoutCO
Error(732,20): field jbo not found in class oracle.apps.ego.item.eu.webui.EgoCreateItemPageLayoutCO
Error(732,24): field Key not found in class oracle.apps.ego.item.eu.webui.EgoCreateItemPageLayoutCO
I have checked the import section and it looks fine to me.
Please let me know if any of you have faced this issue before? Am a bit lost here.
Thanks in advance.,
Jay

I tried with almost every other decompiler available... but nothing resolves this issue. Please let me know if you have anyother alternative.
Thanks again!

Similar Messages

  • Unable to compile the java class in the SQL PLUS

    Hi Team,
    I am unable to compile the java class in the SQL PLUS in dev1 and dev2. It is giving the following error.
    But the same class get Compiled in the Toad(Tool) without any error and working fine. Could someone help me
    What to do for this for your reference ,Attaching the java class file.
    “ORA-29536: badly formed source: Encountered "<EOF>" at line 1, column 28.
    Was expecting one of:
    ----------------------Here is the Java class Code.....................
    create or replace and compile java source named "XXVM_ZipFileUtil_Ela"
    as
    import java.math.BigDecimal;
    import java.util.zip.Deflater;
    import java.util.zip.ZipEntry;
    import java.util.zip.ZipOutputStream;
    import oracle.sql.*;
    import oracle.jdbc.*;
    import java.sql.*;
    import java.io.*;
    public class XXVM_ZipFileUtil_Ela
    public static oracle.sql.BLOB getZipFile(
    oracle.sql.CHAR zipFilePathCHAR, oracle.sql.CHAR zipFileNameCHAR,
    int fileBufferSize, int zipFileBufferSize,
    boolean deleteZipFile, java.sql.Array fileNames, java.sql.Array fileContents, java.sql.Array fileContentsLength)
    throws IllegalArgumentException, FileNotFoundException, IOException, java.sql.SQLException
    String zipFilePath = (zipFilePathCHAR == null) ? null : zipFilePathCHAR.stringValue();
    String zipFileName = (zipFileNameCHAR == null) ? null : zipFileNameCHAR.stringValue();
    String zipPathAndFileName = new String(
    new String(zipFilePath == null || zipFilePath == "" ? "/tmp/" : zipFilePath) +
    new String(zipFileName == null || zipFileName == "" ? System.currentTimeMillis() + ".zip" : zipFileName));
    byte[] buffer = new byte[fileBufferSize == 0 ? 100000000 : fileBufferSize];
    try
    Connection conn = DriverManager.getConnection("jdbc:default:connection:");
    oracle.sql.CLOB[] fileContentsCLOB = (oracle.sql.CLOB[])fileContents.getArray();
    String[] fileNamesString = (String[])fileNames.getArray();
    BigDecimal[] fileContentsLengthNumber = (BigDecimal[])fileContentsLength.getArray();
    ZipOutputStream zipOut = new ZipOutputStream(new FileOutputStream(zipPathAndFileName));
    zipOut.setLevel(Deflater.DEFAULT_COMPRESSION);
    for (int i = 0; i < fileNamesString.length; i++) {
    System.out.println(i);
    zipOut.putNextEntry(new ZipEntry(fileNamesString));
    InputStream asciiStream = fileContentsCLOB[i].getAsciiStream(1L);
    int asciiReadCount = asciiStream.read(buffer,0,fileContentsLengthNumber[i].intValue());
    zipOut.write(buffer, 0, fileContentsLengthNumber[i].intValue());
    zipOut.closeEntry();
    zipOut.close();
    byte zipFileContents[] = new byte[zipFileBufferSize == 0 ? 100000000 : zipFileBufferSize];
    FileInputStream zipIn = new FileInputStream(zipPathAndFileName);
    int byteCount = zipIn.read(zipFileContents);
    zipIn.close();
    byte returnFileContents[] = new byte[byteCount];
    System.arraycopy(zipFileContents,0,returnFileContents,0,byteCount);
    String returnFileContentsString = new String(returnFileContents);
    if (deleteZipFile)
    boolean deletedFile = (new File(zipPathAndFileName)).delete();
    oracle.sql.BLOB returnFileContentsBLOB = null;
    returnFileContentsBLOB = BLOB.createTemporary(conn, true, BLOB.DURATION_SESSION);
    returnFileContentsBLOB.open(BLOB.MODE_READWRITE);
    //OutputStream tempBlobWriter = returnFileContentsBLOB.getBinaryOutputStream();
    OutputStream tempBlobWriter = returnFileContentsBLOB.setBinaryStream(1);
    tempBlobWriter.write(returnFileContents);
    tempBlobWriter.flush();
    tempBlobWriter.close();
    returnFileContentsBLOB.close();
    return returnFileContentsBLOB;
    catch (IllegalArgumentException ex) {
    ex.printStackTrace();
    throw ex;
    catch (FileNotFoundException ex) {
    ex.printStackTrace();
    throw ex;
    catch (IOException ex)
    ex.printStackTrace();
    throw ex;
    catch (java.sql.SQLException ex)
    ex.printStackTrace();
    throw ex;

    860411 wrote:
    Hi Team,
    I am unable to compile the java class in the SQL PLUS in dev1 and dev2. It is giving the following error.
    But the same class get Compiled in the Toad(Tool) without any error and working fine. Could someone help me
    What to do for this for your reference ,Attaching the java class file.
    “ORA-29536: badly formed source: Encountered "<EOF>" at line 1, column 28.
    Was expecting one of:
    I believe the error message is clear and self-explanatory.
    ----------------------Here is the Java class Code.....................
    create or replace and compile java source named "XXVM_ZipFileUtil_Ela"
    as
    import java.math.BigDecimal;
    import java.util.zip.Deflater;
    import java.util.zip.ZipEntry;
    import java.util.zip.ZipOutputStream;
    import oracle.sql.*;
    import oracle.jdbc.*;
    import java.sql.*;
    import java.io.*;
    public class XXVM_ZipFileUtil_Ela
    public static oracle.sql.BLOB getZipFile(
    oracle.sql.CHAR zipFilePathCHAR, oracle.sql.CHAR zipFileNameCHAR,
    int fileBufferSize, int zipFileBufferSize,
    boolean deleteZipFile, java.sql.Array fileNames, java.sql.Array fileContents, java.sql.Array fileContentsLength)
    throws IllegalArgumentException, FileNotFoundException, IOException, java.sql.SQLException
    String zipFilePath = (zipFilePathCHAR == null) ? null : zipFilePathCHAR.stringValue();
    String zipFileName = (zipFileNameCHAR == null) ? null : zipFileNameCHAR.stringValue();
    String zipPathAndFileName = new String(
    new String(zipFilePath == null || zipFilePath == "" ? "/tmp/" : zipFilePath) +
    new String(zipFileName == null || zipFileName == "" ? System.currentTimeMillis() + ".zip" : zipFileName));
    byte[] buffer = new byte[fileBufferSize == 0 ? 100000000 : fileBufferSize];
    try
    Connection conn = DriverManager.getConnection("jdbc:default:connection:");
    oracle.sql.CLOB[] fileContentsCLOB = (oracle.sql.CLOB[])fileContents.getArray();
    String[] fileNamesString = (String[])fileNames.getArray();
    BigDecimal[] fileContentsLengthNumber = (BigDecimal[])fileContentsLength.getArray();
    ZipOutputStream zipOut = new ZipOutputStream(new FileOutputStream(zipPathAndFileName));
    zipOut.setLevel(Deflater.DEFAULT_COMPRESSION);
    for (int i = 0; i < fileNamesString.length; i++) {
    System.out.println(i);
    zipOut.putNextEntry(new ZipEntry(fileNamesString));
    InputStream asciiStream = fileContentsCLOB[i].getAsciiStream(1L);
    int asciiReadCount = asciiStream.read(buffer,0,fileContentsLengthNumber[i].intValue());
    zipOut.write(buffer, 0, fileContentsLengthNumber[i].intValue());
    zipOut.closeEntry();
    zipOut.close();
    byte zipFileContents[] = new byte[zipFileBufferSize == 0 ? 100000000 : zipFileBufferSize];
    FileInputStream zipIn = new FileInputStream(zipPathAndFileName);
    int byteCount = zipIn.read(zipFileContents);
    zipIn.close();
    byte returnFileContents[] = new byte[byteCount];
    System.arraycopy(zipFileContents,0,returnFileContents,0,byteCount);
    String returnFileContentsString = new String(returnFileContents);
    if (deleteZipFile)
    boolean deletedFile = (new File(zipPathAndFileName)).delete();
    oracle.sql.BLOB returnFileContentsBLOB = null;
    returnFileContentsBLOB = BLOB.createTemporary(conn, true, BLOB.DURATION_SESSION);
    returnFileContentsBLOB.open(BLOB.MODE_READWRITE);
    //OutputStream tempBlobWriter = returnFileContentsBLOB.getBinaryOutputStream();
    OutputStream tempBlobWriter = returnFileContentsBLOB.setBinaryStream(1);
    tempBlobWriter.write(returnFileContents);
    tempBlobWriter.flush();
    tempBlobWriter.close();
    returnFileContentsBLOB.close();
    return returnFileContentsBLOB;
    catch (IllegalArgumentException ex) {
    ex.printStackTrace();
    throw ex;
    catch (FileNotFoundException ex) {
    ex.printStackTrace();
    throw ex;
    catch (IOException ex)
    ex.printStackTrace();
    throw ex;
    catch (java.sql.SQLException ex)
    ex.printStackTrace();
    throw ex;
    The last two lines above should be
    /Srini

  • Unable to compile the Java Files generated by JAXB

    Hi,
    I have generated the Java Files for a DTD and .xjs file using JAXB. But when i tyr to compile the .java files generated i am getting errors.
    My DTD file is addctq.dtd
    <?xml version="1.0" encoding="UTF-8"?>
    <!ELEMENT AddCtq (Ctq*)>
    <!ELEMENT Ctq (PartNumber ,PartDescription,CtqDescription,CtqType,ProductLine,Supplier,Ppctq,Ctp,Ctc,CtqCode1,CtqCode2,CtqCode3,Commodity,SubCommodity,UnitOfMeasure,Client,SamplingFrequency,Remarks,VariableData)>
    <!ELEMENT VariableData (SubGroupSize, Specification,Nominal,Usl,Ual,Lal,Lsl,Zal,RangeVal?,RangeAlarmVal?)>
    <!ELEMENT PartNumber (#PCDATA)>
    <!ATTLIST PartNumber new CDATA #REQUIRED >
    <!ELEMENT PartDescription (#PCDATA)>
    <!ELEMENT CtqDescription (#PCDATA)>
    <!ELEMENT CtqType (#PCDATA)>
    <!ELEMENT ProductLine (#PCDATA)>
    <!ELEMENT Supplier (#PCDATA)>
    <!ELEMENT Ppctq (#PCDATA)>
    <!ELEMENT Ctp (#PCDATA)>
    <!ELEMENT Ctc (#PCDATA)>
    <!ELEMENT CtqCode1 (#PCDATA)>
    <!ELEMENT CtqCode2 (#PCDATA)>
    <!ELEMENT CtqCode3 (#PCDATA)>
    <!ELEMENT Commodity (#PCDATA)>
    <!ELEMENT SubCommodity (#PCDATA)>
    <!ELEMENT UnitOfMeasure (#PCDATA)>
    <!ELEMENT Client (#PCDATA)>
    <!ELEMENT SamplingFrequency (#PCDATA)>
    <!ELEMENT Remarks (#PCDATA)>
    <!ELEMENT SubGroupSize (#PCDATA)>
    <!ELEMENT Specification (#PCDATA)>
    <!ELEMENT Nominal (#PCDATA)>
    <!ELEMENT Usl (#PCDATA)>
    <!ELEMENT Ual (#PCDATA)>
    <!ELEMENT Lal (#PCDATA)>
    <!ELEMENT Lsl (#PCDATA)>
    <!ELEMENT Zal (#PCDATA)>
    <!ELEMENT RangeVal (#PCDATA)>
    <!ELEMENT RangeAlarmVal (#PCDATA)>
    and the .xjs file i created is addctq.xjs
    <?xml version="1.0" encoding="UTF-8" ?>
    <xml-java-binding-schema version="1.0-ea">
    <options package="com.geindustrial.sqms"/>
    <element name="AddCtq" type="class" root="true">
    <content>
    <element-ref name="Ctq"/>
    </content>
    </element>
    <element name="Ctq" type="class">
    <content>
         <element-ref name="PartNumber"/>
         <element-ref name="PartDescription"/>
         <element-ref name="CtqDescription"/>
         <element-ref name="CtqType"/>
         <element-ref name="ProductLine"/>
         <element-ref name="Supplier"/>
         <element-ref name="Ppctq"/>
         <element-ref name="Ctp"/>
         <element-ref name="Ctc"/>
         <element-ref name="CtqCode1"/>
         <element-ref name="CtqCode2"/>
         <element-ref name="CtqCode3"/>
         <element-ref name="Commodity"/>
         <element-ref name="SubCommodity"/>
         <element-ref name="UnitOfMeasure"/>
         <element-ref name="Client"/>
         <element-ref name="SamplingFrequency"/>
         <element-ref name="Remarks"/>
         <element-ref name="VariableData"/>
    </content>      
    </element>
    <element name="VariableData" type="class">
    <content>
    <element-ref name="SubGroupSize"/>
    <element-ref name="Specification"/>
    <element-ref name="Nominal"/>
    <element-ref name="Usl"/>
    <element-ref name="Ual"/>
    <element-ref name="Lal"/>
    <element-ref name="Lsl"/>
    <element-ref name="Zal"/>
    </content>
    </element>
    <element name="PartNumber" type="value">
    <attribute name="new"/>
    </element>
    <element name="PartDescription" type="value">
    </element>
    <element name="CtqDescription" type="value">
    </element>
    <element name="CtqType" type="value">
    </element>
    <element name="ProductLine" type="value">
    </element>
    <element name="Supplier" type="value">
    </element>
    <element name="Ppctq" type="value">
    </element>
    <element name="Ctp" type="value">
    </element>
    <element name="Ctc" type="value">
    </element>
    <element name="CtqCode1" type="value">
    </element>
    <element name="CtqCode2" type="value">
    </element>
    <element name="CtqCode3" type="value">
    </element>
    <element name="Commodity" type="value">
    </element>
    <element name="SubCommodity" type="value">
    </element>
    <element name="UnitOfMeasure" type="value">
    </element>
    <element name="Client" type="value">
    </element>
    <element name="SamplingFrequency" type="value">
    </element>
    <element name="Remarks" type="value">
    </element>
    <element name="SubGroupSize" type="value" convert="int">
    </element>
    <element name="Specification" type="value">
    </element>
    <element name="Nominal" type="value" convert="float">
    </element>
    <element name="Usl" type="value" convert="float">
    </element>
    <element name="Ual" type="value" convert="float">
    </element>
    <element name="Lal" type="value" convert="float">
    </element>
    <element name="Lsl" type="value" convert="float">
    </element>
    <element name="Zal" type="value" convert="float">
    </element>
    <element name="RangeVal" type="value" convert="float">
    </element>
    <element name="RangeAlarmVal" type="value" convert="float">
    </element>
    </xml-java-binding-schema>
    When i ran the xjc , it generated 3 .java files
    AddCtq.java , Ctq.java and VariableData.java
    But i am unable to compile any of the above files...
    The Error i am getting is
    VariableData.java:710: Undefined variable or class name: AddCtq
    return AddCtq.newDispatcher();
    ^
    1 error
    If i try to compile AddCtq.java , the Error i am getting is
    AddCtq.java:4: Class com.geindustrial.sqms.Ctq not found in import.
    import com.geindustrial.sqms.Ctq;
    ^
    AddCtq.java:169: Class com.geindustrial.sqms.Ctq not found.
    if (!(ob instanceof Ctq)) {
    ^
    AddCtq.java:170: Class com.geindustrial.sqms.Ctq not found.
    throw new InvalidContentObjectException(ob, (Ctq.class));
    ^
    3 errors
    And when i try to compile Ctq.java , i am getting the following Error:
    Ctq.java:4: Class com.geindustrial.sqms.VariableData not found in import.
    import com.geindustrial.sqms.VariableData;
    ^
    1 error
    How to solve this problem..Pls advise...
    Thanks
    Sateesh

    I suspect you are trying to compile the files one by one. You may also be trying to compile them disregarding the package structure.
    From your post, I gather these files are in the package: com.geindustrial.sqms
    Therefore, if they are not so already, put them under a directory structure:
    com/geindustrial/sqms
    and then compile with:
    javac com/geindustrial/sqms/AddCtq.java com/geindustrial/sqms/Ctq.java com/geindustrial/sqms/VariableData.java
    (The above is all on one line.)
    HTH,
    Manuel Amago.

  • Why i am unable to compile this .java

    Hi
    I get the Error messages
    C:\kk>javac BICDownloader.java
    BICDownloader.java:61: cannot find symbol
    symbol : method openConnection()
    location: class java.lang.String
    URLConnection urlc = url.openConnection();
    ^
    BICDownloader.java:64: cannot find symbol
    symbol : class SSLTunnelSocketFactory
    location: class BICDownloader
    (new SSLTunnelSocketFactory(proxyHost,proxyPort));
    ^
    Note: BICDownloader.java uses or overrides a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    2 errors
    When trying to compile
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.FileOutputStream;
    import java.io.FileInputStream;
    import java.util.StringTokenizer;
    import java.util.Properties;
    import java.net.*;
    import java.io.*;
    import java.security.*;
    import javax.net.*;
    import javax.net.ssl.*;
    import javax.net.SocketFactory;
    import javax.net.ssl.SSLSocketFactory;
    import org.apache.commons.httpclient.DefaultHttpMethodRetryHandler;
    import org.apache.commons.httpclient.HttpClient;
    import org.apache.commons.httpclient.Header;
    import org.apache.commons.httpclient.HttpException;
    import org.apache.commons.httpclient.HttpStatus;
    import org.apache.commons.httpclient.methods.GetMethod;
    import org.apache.commons.httpclient.params.HttpMethodParams;
    import org.apache.commons.httpclient.UsernamePasswordCredentials;
    import org.apache.commons.httpclient.auth.AuthScope;
    * Created on Mar 2, 2007
    * S.W.I.F.T. s.c.r.l.
    public class BICDownloader {
    private final static String proxyHost = "isln616";
    private final static String proxyPort = "9090";
         public static void main(String[] args) throws Exception {
              int exitcode = 0;
              int statusCode;
       String url = "https://www2.swift.com/bicdownload/bicdownloader?"
                              + "action=getfile&productline=bicdir&product=bicdb&content=delta&format=txt";
    HttpClient client = new HttpClient();
             GetMethod method = new GetMethod(url);
             // Provide custom retry handler if required
             method.getParams().setParameter(HttpMethodParams.RETRY_HANDLER,
                                              new DefaultHttpMethodRetryHandler(3, false));
         System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol");
          //System.setProperty("https.proxyHost",proxyHost);
          //System.setProperty("https.proxyPort",proxyPort);
                   URLConnection urlc = url.openConnection();
          if(urlc instanceof com.sun.net.ssl.HttpsURLConnection){
                        ((com.sun.net.ssl.HttpsURLConnection)urlc).setSSLSocketFactory
                             (new SSLTunnelSocketFactory(proxyHost,proxyPort));
             try {
                  // We strongly recommend obfuscation of password  and restricted access to its storage
                  Properties prop = new Properties();
                  InputStream fis = (InputStream)new FileInputStream("c:/KK/bicdownload.prop");
                  prop.load(fis);
                  // Set Credentials
                  UsernamePasswordCredentials credentials;
                  credentials = new UsernamePasswordCredentials(prop.getProperty("username"),
                                                                  prop.getProperty("password"));
                  client.getState().setCredentials(new AuthScope("www2.swift.com", 443), credentials);
                  // Executing the method.
                  statusCode = client.executeMethod(method);
                  if (statusCode != HttpStatus.SC_OK) {
                       // Handling HTTP error 404 and 500 not covered in this example
                       // All http error cause in this example exit with status 1.
                       System.err.println("Method failed: " + method.getStatusLine()+ "\n" +
                                         method.getResponseBodyAsString());
                       System.out.println(method.getRequestCharSet() + "\n" + method.getRequestHeader("").toString());
                       exitcode = 1;
                  else {
                       //Get the file size from the response body and do something with it
                       Header[] contlen = method.getResponseHeaders("Content-Length");
                       if (contlen.length != 0) {
                            StringTokenizer stone = new StringTokenizer(contlen[0].getValue(), "=");
                            int size = new Integer(stone.nextToken()).intValue();
                            // Do something with the file size
                            System.out.println("File size is: " + size);
                       // Get the filename from the response body.
                       InputStream is = method.getResponseBodyAsStream();
                       Header[] contdisp = method.getResponseHeaders("Content-Disposition");
                       String filename = null;
                       StringTokenizer sttwo = new StringTokenizer(contdisp[0].getValue(), "=");
                       while (sttwo.hasMoreTokens()) filename = sttwo.nextToken();
                       // Hardcoded disk and directory path are indicative
                       FileOutputStream fos = new FileOutputStream("c:/kk/" + filename);
                       byte[] buffer = new byte[4096];
                       int count = is.read(buffer);
                       while (count != -1) {
                            fos.write(buffer, 0, count);
                            count = is.read(buffer);
                       fos.flush();
                       fos.close();
                       is.close();
             } catch (HttpException e) {
                  exitcode = 2;
                  System.err.println("Fatal HTTP Error: " + e.getMessage());
                  e.printStackTrace();
             } catch (IOException e) {
                  exitcode = 3;
                  System.err.println("Fatal I/O error: " + e.getMessage());
                  e.printStackTrace();
             } finally {
                  // Release the connection.
                  method.releaseConnection();
                  System.exit(exitcode);
             System.out.println("Dowload done");
    }

    Look at the Classnames it's complaining about, then look at your import list.
    That is the reason, of course.
    Edit: The second error has to do with the Classes. The first one, is as pointed out below,
    is because how you declared and defined your "url" variable, which should be URL and not String.

  • Unable to compile the java file

    Hi,
    I am following the step by step process of DOC id : 184339.1 on How to Send an Email With Attachment Via Forms 6i Using ORA_JAVA Package. I downloaded the activation framework and sendmail 1.1.3..When i am compiling the file given the DOC id namely sendmail.java, I get the following error
    Exception in thread "main" java.lang.NoclassDefFoundError: sendmail/java
    Could anyone help me out ..
    Below is the cut and paste of the code which is used to compile..
    Thanks
    Kal
    import java.util.*; import java.io.*; import javax.mail.*; import javax.mail.internet.*; import javax.activation.*; public class SendMail {       // Sender, Recipient, CCRecipient, and BccRecipient are comma-       // separated lists of addresses;       // Body can span multiple CR/LF-separated lines;       // Attachments is a ///-separated list of file names;       public static int Send(String SMTPServer,                              String Sender,                              String Recipient,                              String CcRecipient,                              String BccRecipient,                              String Subject,                              String Body,                              String ErrorMessage[], String Attachments) {           // Error status;          int ErrorStatus = 0;              // create some properties and get the default Session;             Properties props = System.getProperties();             props.put("mail.smtp.host", SMTPServer);           Session session = Session.getDefaultInstance(props, null);            try {              // create a message;              MimeMessage msg = new MimeMessage(session);               // extracts the senders and adds them to the message;              // Sender is a comma-separated list of e-mail addresses as              // per RFC822;              {                 InternetAddress[] TheAddresses = InternetAddress.parse(Sender); msg.addFrom(TheAddresses); } // extract the recipients and assign them to the message; // Recipient is a comma-separated list of e-mail addresses // as per RFC822; {                 InternetAddress[] TheAddresses = InternetAddress.parse(Recipient); msg.addRecipients(Message.RecipientType.TO, TheAddresses); } // extract the Cc-recipients and assign them to the // message; // CcRecipient is a comma-separated list of e-mail // addresses as per RFC822; if (null != CcRecipient) {                 InternetAddress[] TheAddresses = InternetAddress.parse(CcRecipient); msg.addRecipients(Message.RecipientType.CC, TheAddresses); } // extract the Bcc-recipients and assign them to the // message; // BccRecipient is a comma-separated list of e-mail // addresses as per RFC822; if (null != BccRecipient) {                 InternetAddress[] TheAddresses = InternetAddress.parse(BccRecipient); msg.addRecipients(Message.RecipientType.BCC, TheAddresses); } // subject field; msg.setSubject(Subject); // create the Multipart to be added the parts to; Multipart mp = new MimeMultipart(); // create and fill the first message part; {                 MimeBodyPart mbp = new MimeBodyPart();                 mbp.setText(Body);                  // attach the part to the multipart;                 mp.addBodyPart(mbp);              } // attach the files to the message; if (null != Attachments) {                 int StartIndex = 0, PosIndex = 0;                 while (-1 != (PosIndex = Attachments.indexOf("///",                                                        StartIndex))) {                    // create and fill other message parts;                    MimeBodyPart mbp = new MimeBodyPart();                    FileDataSource fds =                    new FileDataSource(Attachments.substring(StartIndex,                                                             PosIndex));                    mbp.setDataHandler(new DataHandler(fds));                    mbp.setFileName(fds.getName());                    mp.addBodyPart(mbp);                    PosIndex += 3;                    StartIndex = PosIndex;                 } // last, or only, attachment file; if (StartIndex < Attachments.length()) {                    MimeBodyPart mbp = new MimeBodyPart();                    FileDataSource fds =                  new FileDataSource(Attachments.substring(StartIndex));                    mbp.setDataHandler(new DataHandler(fds));                    mbp.setFileName(fds.getName());                    mp.addBodyPart(mbp);                 } } // add the Multipart to the message; msg.setContent(mp); // set the Date: header; msg.setSentDate(new Date()); // send the message; Transport.send(msg); } catch (MessagingException MsgException) {                ErrorMessage[0] = MsgException.toString(); Exception TheException = null; if ((TheException = MsgException.getNextException()) != null) ErrorMessage[0] = ErrorMessage[0] + "\n" + TheException.toString(); ErrorStatus = 1; } return ErrorStatus; } }

    Most common cause of the problem: JAVA_HOME environment variable not set, or set incorrectly.
    It should point to your java directory: ie C:\java1_4\ NOT C:\java1_4\bin
    Another possible cause is spaces in the path names where you have installed applications.
    Check out this page: http://www.coreservlets.com/Apache-Tomcat-Tutorial/ for a tutorial on installing tomcat.
    If you can't sort it out on your own, we need more info:
    Where have you installed Java?
    Where have installed Tomcat?
    What is the value of JAVA_HOME environment variable?
    Good luck,
    evnafets

  • Unable to compile my java program in TextPad or Eclipse

    Hello - Finals are next week and I have one last assignment due....and my harddrive crashed last week. I reinstalled everything and set environment variables. When I open my program in TextPad and press ctrl-1 to compile nothing happens. Nothing happens with ctrl-2 (to run) either.
    In eclipse, I open the files and try to run the java file with the main method but I get "Selection does not contain a main type" error! I don't know what to do and I am at a standstill and I failed finding helpful information on my own.
    Please help!
    import java.util.Scanner;
    import java.io.*;
    import java.util.ArrayList;
    public class BookPrinter {
         public static void main(String args)
              try
                   FileReader reader = new FileReader("input.txt");
                   Scanner in = new Scanner(reader);
                   String inputFile = "";
                   while(in.hasNext())
                        inputFile.concat(in.nextLine());
                   Book b = new Book(inputFile);
                   System.out.println("The book's size is: " + b.bookSize());
                   System.out.println("\nThe number of times \"the\" occurs in the book: " + b.count("the"));
                   System.out.println("\nThe longest word in the book: " + b.longest());
                   ArrayList<String> longList = b.allLongest();
                   System.out.println("\nThe words that are all the longest length: ");
                   while(longList.size() > 0)
                        for(String e: longList)
                             System.out.println(e);
              catch(FileNotFoundException exception)
                   System.out.println("Error processing file: " + exception);
    }

    This:
    public static void main(String args)is wrong.
    You want this:
    public static void main(String[] args)Understand the difference?

  • Unable to compile "SerialDemo.java", many "cannot find symbols" errors

    I have all the correct files in their respective directory.
    comm.jar in jre\lib\bin,
    javax.comm.properties in jre\lib
    win32com.dll in jre\bin
    I extracted all the whole of SerialDemo into one folder and started compiling from there. But it doesn't work. I keep getting many "cannot find symbol" errors. They are usually referred to by:
    SerialParameters
    SerialConnection
    AlertDialog
    SerialConnectionException
    SerialDemo.java is not edited and was compiled directly. All of my files are in one folder (AlertDialog.java compiles fine and is in the same folder, etc)
    I was wondering what might be the cause of it. I'm currently using a Windows XP Service Pack 2, IBM P3 Laptop. I was reading "http://forum.java.sun.com/thread.jspa?threadID=674514&messageID=3941560"
    And I found out it works fine on Win2k OS. Why is this so? I'm getting the exact same error as he stated on his last post and I tried looking for a solution and decided to turn to you guys. I'd really appreciate some help, if any. Thanks in advance.

    I followed the PlatformSpecific. I realised that I
    added one for JRE when it wasn't required. The
    problem was solved.
    Thank you so much, the both of you. My stupid mistake
    caused quite a bit of havoc. I apologise.No need to apologise; The confusing part is that when you download
    a jre, that's just what your get: a jre, but when you download the jdk
    you not just get the jdk and the jre but you get a second jre with them,
    stored under the jdk directory.
    To the programmer that second jre is useless, it is used internally by
    the jdk tools.
    kind regards,
    Jos

  • Unable to compile servlet files in javac

    i am unable to compile servlet *.java files in javac.as far as i can see my path is correct.
    Kindly provide a solution as soon as possible.
    My jdk1.3 is in my c drive and my tomcat in my d drive.
    if you are able to compile kindly let me know your path.
    it says symbol not resolved.i think that it is unable to import from javax

    Assuming that your jdk is in c drive as c:\jdk1.3 set the path and the classpath like as shown below. Remember that you have to set the classpath for the classes in the javax.servlet and javax.servlet.http packages. I know how to do it for JavaWebServer. JavaWebServer has a jar called servlet.jar that contains all these classes. What you need to do is to put this jar file in your classpath. There will be a similar jar file for Tomcat server also. You need to refer the Tomcat server documentation for that.
    The path and the classpath have to be set like this...
    d:\>path=%path%;.;c:\jdk1.3\bin;
    d:\>set classpath=%classpath%;.;c:\jdk1.3\lib;c:\JavaWebServer2.0\lib\servlet.jar;
    assuming tht JWS is installed in c:\JavaWebServer2.0
    Also note that there should be no spaces in between while setting the classpath. In your case you have to change the last part of the classpath to customize your requirement.
    Hope that will help.
    Regards
    Jaydeep

  • Unable to compile servlets

    I am unable to compile a java servlet program.
    the message thrown ou by the compiler is
    "Class java.servlet not found in import"

    You need to find where the servlet.jar file is on your system. For example i'm running tomcat on a linux machine, this is what i type to compile servlets.
    javac -classpath /var/tomcat4/common/lib/servlet.jar yourFile.java

  • Appserver unable to Compile JSP pages

    Hello
    I have deployed a webapplication on SunONE application server installed on a SunOS 5.8 box. When I try to access any page , I keep getiing errors indicating that the page could not be compiled. An attempt to compile the page seperately using the javac installed with the App server however succeeds.
    The errors I get are as shown. The same webapp runs fine when installed on SunONE application server installed on Windows 2000 machine. Any help would be greatly appreciated
    org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
    An error occurred at line: 175 in the jsp file: /filesfolders/process_parameters.jsp
    Generated servlet error:
    /actu01/appserver7/appserv/instances/server1/generated/jsp/j2ee-modules/ap/_jasper/_filesfolders/_index_jsp.java:1962: Variable jbs may not have been initialized.
    bFilter = jbs.isDocChanFiltersEnabled();
    ^
    An error occurred between lines: 175 and 176 in the jsp file: /filesfolders/process_parameters.jsp
    Generated servlet error:
    /actu01/appserver7/appserv/instances/server1/generated/jsp/j2ee-modules/ap/_jasper/_filesfolders/_index_jsp.java:1970: Variable bFolders may not have been initialized.
    boolean bEmptyRS = !(bFolders || bExecutables || bDocuments);
    Thanks
    -Aniruddha

    I am having a similar problem on Windows 2000. Servlets run but jsp's all hit this error. Here is a copy of the log:
    [15/May/2003:07:40:16] INFO ( 1924): CORE1116: Sun ONE Application Server 7.0^M
    [15/May/2003:07:40:20] INFO ( 1924): CORE5076: Using [Java HotSpot(TM) Server VM
    , Version 1.4.1_01] from [Sun Microsystems Inc.]^M
    [15/May/2003:07:40:35] INFO ( 1924): JMS5023: JMS service successfully started.
    Instance Name = domain1_server1, Home = [C:\tools\as7se\imq\bin].^M
    [15/May/2003:07:40:40] INFO ( 1924): JTS5014: Recoverable JTS instance, serverId
    = [100]^M
    [15/May/2003:07:40:41] INFO ( 1924): RAR5060: Install JDBC Datasources ...^M
    [15/May/2003:07:40:41] INFO ( 1924): RAR5059: Binding [JDBC DataSource Name: jdb
    c/jdbc-simple, Pool Name: PointBasePool]^M
    [15/May/2003:07:40:42] INFO ( 1924): JMS5015: Install JMS resources ...^M
    [15/May/2003:07:40:44] INFO ( 1924): WEB0100: Loading web module [webapps-simple
    ] in virtual server [server1] at [webapps-simple]^M
    [15/May/2003:07:40:48] INFO ( 1924): HTTP3072: HTTP listener http-listener-1 [ht
    tp://LINDENBERGR-LT01:80] ready to accept requests^M
    [15/May/2003:07:40:48] INFO ( 1924): CORE3274: successful server startup^M
    [15/May/2003:07:40:48] INFO ( 1924): CORE5053: Application onReady complete.^M
    [15/May/2003:07:42:53] WARNING ( 1924): CORE3283: stderr: java.lang.ClassFormatE
    rror: sun/tools/java/Parser (Illegal constant pool index)^M
    [15/May/2003:07:42:53] SEVERE ( 1924): StandardWrapperValve[jsp]: Servlet.servic
    e() for servlet jsp threw exception^M
    at com.iplanet.ias.web.jsp.JspServlet.serviceJspFile(JspServlet.java:322
    )^M
    at com.iplanet.ias.web.jsp.JspServlet.service(JspServlet.java:287)^M
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)^M
    at org.apache.catalina.core.StandardWrapperValve.invokeServletService(St
    andardWrapperValve.java:720)^M
    at org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrap
    perValve.java:118)^M
    at org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperVa
    lve.java:278)^M
    at java.security.AccessController.doPrivileged(Native Method)^M
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
    alve.java:274)^M
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
    a:505)^M
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
    alve.java:212)^M
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
    a:505)^M
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
    ava:203)^M
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
    a:505)^M
    at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProce
    ssor.java:157)^M
    at com.iplanet.ias.web.WebContainer.service(WebContainer.java:598)^M
    ^M
    [15/May/2003:07:42:53] WARNING ( 1924): CORE3283: stderr: at java.lang.Cla
    ssLoader.defineClass0(Native Method)^M
    [15/May/2003:07:42:53] WARNING ( 1924): CORE3283: stderr: at java.lang.Cla
    ssLoader.defineClass(ClassLoader.java:502)^M
    [15/May/2003:07:42:53] WARNING ( 1924): CORE3283: stderr: at java.security
    .SecureClassLoader.defineClass(SecureClassLoader.java:123)^M
    [15/May/2003:07:42:53] WARNING ( 1924): CORE3283: stderr: at java.net.URLC
    lassLoader.defineClass(URLClassLoader.java:250)^M
    [15/May/2003:07:42:53] WARNING ( 1924): CORE3283: stderr: at java.net.URLC
    lassLoader.access$100(URLClassLoader.java:54)^M
    [15/May/2003:07:42:53] WARNING ( 1924): CORE3283: stderr: at java.net.URLC
    lassLoader$1.run(URLClassLoader.java:193)^M
    [15/May/2003:07:42:53] WARNING ( 1924): CORE3283: stderr: at java.security
    .AccessController.doPrivileged(Native Method)^M
    [15/May/2003:07:42:53] WARNING ( 1924): CORE3283: stderr: at java.net.URLC
    lassLoader.findClass(URLClassLoader.java:186)^M
    [15/May/2003:07:42:53] WARNING ( 1924): CORE3283: stderr: at java.lang.Cla
    ssLoader.loadClass(ClassLoader.java:299)^M
    [15/May/2003:07:42:53] WARNING ( 1924): CORE3283: stderr: at sun.misc.Laun
    cher$AppClassLoader.loadClass(Launcher.java:265)^M
    [15/May/2003:07:42:53] WARNING ( 1924): CORE3283: stderr: at java.lang.Cla
    ssLoader.loadClass(ClassLoader.java:255)^M
    [15/May/2003:07:42:53] WARNING ( 1924): CORE3283: stderr: at java.lang.Cla
    ssLoader.loadClassInternal(ClassLoader.java:315)^M
    [15/May/2003:07:42:53] WARNING ( 1924): CORE3283: stderr: at java.lang.Cla
    ssLoader.defineClass0(Native Method)^M
    [15/May/2003:07:42:53] WARNING ( 1924): CORE3283: stderr: at java.lang.Cla
    ssLoader.defineClass(ClassLoader.java:502)^M
    [15/May/2003:07:42:53] WARNING ( 1924): CORE3283: stderr: at java.security
    .SecureClassLoader.defineClass(SecureClassLoader.java:123)^M
    [15/May/2003:07:42:53] WARNING ( 1924): CORE3283: stderr: at java.net.URLC
    lassLoader.defineClass(URLClassLoader.java:250)^M
    [15/May/2003:07:42:53] WARNING ( 1924): CORE3283: stderr: at java.net.URLC
    lassLoader.access$100(URLClassLoader.java:54)^M
    [15/May/2003:07:42:53] WARNING ( 1924): CORE3283: stderr: at java.net.URLC
    lassLoader$1.run(URLClassLoader.java:193)^M
    [15/May/2003:07:42:53] WARNING ( 1924): CORE3283: stderr: at java.security
    .AccessController.doPrivileged(Native Method)^M
    [15/May/2003:07:42:53] WARNING ( 1924): CORE3283: stderr: at java.net.URLC
    lassLoader.findClass(URLClassLoader.java:186)^M
    [15/May/2003:07:42:53] WARNING ( 1924): CORE3283: stderr: at java.lang.Cla
    ssLoader.loadClass(ClassLoader.java:299)^M
    @[15/May/2003:07:42:53] WARNING ( 1924): CORE3283: stderr: at sun.misc.Laun
    cher$AppClassLoader.loadClass(Launcher.java:265)^M
    [15/May/2003:07:42:53] WARNING ( 1924): CORE3283: stderr: at java.lang.Cla
    ssLoader.loadClass(ClassLoader.java:255)^M
    [15/May/2003:07:42:53] WARNING ( 1924): CORE3283: stderr: at java.lang.Cla
    ssLoader.loadClassInternal(ClassLoader.java:315)^M
    [15/May/2003:07:42:53] WARNING ( 1924): CORE3283: stderr: at sun.tools.jav
    ac.BatchEnvironment.parseFile(BatchEnvironment.java:453)^M
    [15/May/2003:07:42:53] WARNING ( 1924): CORE3283: stderr: at sun.tools.jav
    ac.Main.compile(Main.java:486)^M
    [15/May/2003:07:42:53] WARNING ( 1924): CORE3283: stderr: at org.apache.ja
    sper.compiler.SunJavaCompiler$JavacTask.run(SunJavaCompiler.java:240)^M
    Thanks,
    Bob

  • Unable to compile JSF page

    Hi All,
    I am new to Jdeveloper . I am creating a JSF application in jdeveloper10.1.3.when i place a <F:loadBundle > tag and other components in jspx. i am getting the following compile time error.
    Error: Unable to convert constant to type javax.el.ValueExpression for attribute "basename" of tag "loadBundle".
    Error: Unable to convert constant to type javax.el.ValueExpression for attribute "basename" of tag "loadBundle".
    Error: Attribute: showPopupOnDisconnect is not a valid attribute name
    Error: Unable to convert constant to type javax.el.ValueExpression for attribute "itemLabel" of tag "selectItem".
    Error: Unable to convert constant to type javax.el.ValueExpression for attribute "itemValue" of tag "selectItem".
    Error: Unable to convert constant to type javax.el.ValueExpression for attribute "value" of tag "selectItems".
    Error: Unable to convert constant to type javax.el.ValueExpression for attribute "value" of tag "param".
    Error: Unable to convert constant to type javax.el.ValueExpression for attribute "value" of tag "param".
    Error: Unable to convert constant to type javax.el.ValueExpression for attribute "value" of tag "param".
    Please any one help me to solve these issue.
    Thanks in advance,
    Vijay
    Edited by: user10619370 on Jul 29, 2009 7:52 AM

    Can you post the code of your page, this is an standard JSF tag and you should not have problems on using it
    I found this guide on how to use it on standar jsf applications
    http://www.laliluna.de/javaserver-faces-message-resource-bundle-tutorial.html
    -Juan Camilo

  • Error:Unable to compile class for JSP

    Hi all,
    I am new at jsp,just started to learn a week ago :) Anyway I'm having troubles with using a compiled java class in jsp code.I use tomcat 4.1.31 and java 1.4.2.I have compiled the following programm and put the class into tomcats' webapps\ch06\WEB-INF\classes directory
    public class ch06_01
    public ch06_01()
    public String msg()
    return "Hello from JSP!";
    Then I have the following jsp file in the webapps\ch06 dir as well:
    <%@ page import="ch06_01" %>
    <HTML>
    <HEAD>
    <TITLE>Using a JavaBean</TITLE>
    </HEAD>
    <BODY>
    <H1>Using a JavaBean</H1>
    <% ch06_01 messager = new ch06_01(); %>
    The message is: <%= messager.msg() %>
    </BODY>
    </HTML>
    But when I try to ran the jsp page following error occures:
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: -1 in the jsp file: null
    Generated servlet error:
    [javac] Compiling 1 source file
    C:\jakarta-tomcat-4.1.31\work\Standalone\localhost\ch06\ch06_02_jsp.java:7: '.' expected
    import ch06_01;
    ^
    1 error
    Can anybody help me,please!I appreciate your help a lot!
    Thank you verry much!
    Best regards Daisy

    Its not a Tomcat issue per se, but a change in the J2SE.
    Its been the case since the release of Java 1.4, when they disabled access to the "default" package. Quite a few of the books written before Java1.4 was released are still around, and there are endless examples around the net that no longer work as a result of this change.

  • Unable to compile class for JSP

    Please can anyone help me to solve this.
    Actually,this is the condition.
    In my db,there is a table called UserPassword, which has 4
    fields(empNo,UserName,password,level). Now I want to do these things:
    When the user submits the data to create a new account via HTML form, it submits the data to the file called CreateAcc.jsp. In this file it perform some logic,here are they.
    1)To check the empNo,if it is already exist in the DB,
         if empNo =exist then display error.(record already exist)
         if empNo =notexist then do task 2).
    2)check the UserName,if it is already exist in the db,
         if UserName=exist then display error.(because it's a primary key)
         if UserName=notexist then do task 3).
    3)Create a new user account and save it to the db.
    To do these tasks,I never create a new objects for the tasks 1) and 2).
    only for task 3)create an object.
    Is it the right way?
    Here is the file CreateAcc.jsp
    <%@ page language="java" %>
    <%@ page import="core.UserAccManager" %>
    <%@ page import="data.UserPassword" %>
    <jsp:useBean id="UserAccManager" class="core.UserAccManager" scope="session"/>
    <jsp:setProperty name="UserAccManager" property="*"/>
    <jsp:useBean id="UserPassword" class="data.UserPassword" scope="session"/>
    <jsp:setProperty name="UserPassword" property="*"/>
    <%
    String nextPage ="MainForm.jsp";
    if(UserPassword.verifyEmpno()){
         if(UserPassword.verifyUsername()){
              if(UserPassword.createAcc()) nextPage ="MsgAcc.jsp";
          }else{
               nextPage="UserNameExist.jsp";
          else{
              nextPage="UserAccError.jsp";
    %>
    <jsp:forward page="<%=nextPage%>"/>The directory structure:
    UserPassword.java- F:/Project/core/data/UserPassword.java
    UserAccManager.java - F:/Project/core/UserAccManager.java
    Now both are compiling.I put the class files into the TOMCAT,as follows.
    UserAccManager.class - webapps/mySystemName/WEB-INF/classes/core/
    UserPassword.class - webapps/mySystemName/WEB-INF/classes/core/data/
    Here is the full code of the file UserAccManager.java.
    package core;               //Is this right?
    import data.UserPassword;     //Is this right?
    import java.io.*;
    import java.sql.*;
    import java.util.*;
    import javax.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public final class UserAccManager{
       private static final String DRIVER = "com.mysql.jdbc.Driver";
       private static final String URL = "jdbc:mysql://localhost:3306/superfine";
       private static Connection connection;
       private static PreparedStatement pstmt1;
       private static PreparedStatement pstmt2;     
       private static PreparedStatement pstmt3;     
       private UserAccManager(){
       // Initializes the connection and statements
       public static void initConnection() {
          if (connection == null) {
             try {
                String sql;
                // Open the database
                Class.forName(DRIVER).newInstance();
                connection = DriverManager.getConnection(URL);
                // Prepare the statements
               sql = "SELECT * FROM UserPassword where empNo= ?";
               pstmt1 = connection.prepareStatement(sql);
                sql = "SELECT UserName FROM UserPassword where UserName= ?";
                pstmt2 = connection.prepareStatement(sql);
             sql ="INSERT INTO UserPassword VALUES(?,?,?,?)";
             pstmt3 = connection.prepareStatement(sql);
             catch (Exception ex) {
                System.err.println(ex.getMessage());
       // Closes the connection and statements
       // Method to be called by main class when finished with DB
       public  void closeConnection() {
          //same as previous
       public static boolean verifyEmpno(int empno) {
          boolean emp_no_select_ok = false;
          int emp = -1;
          initConnection();
         try {
          pstmt1.setInt(1, empno);
             ResultSet rs1 = pstmt1.executeQuery();
         while(rs1.next()){
              emp=rs1.getInt("empNo");
         if(emp>0)
              emp_no_select_ok = false;
         } else{
              emp_no_select_ok = true;     
            rs1.close();
         pstmt1.close();     
          catch (Exception ex) {
             System.err.println(ex.getMessage());
          return emp_no_select_ok;
       public static boolean verifyUsername(String username) {
          boolean user_name_select_ok = false;
          String user = "xxxx";
          initConnection();
          try {
          pstmt2.setString(1, username);
             ResultSet rs2 = pstmt2.executeQuery();
            while(rs2.next()){
              user=rs2.getString("UserName");
               if(!user.equals("xxxx"))
              user_name_select_ok = false;
            } else{
              user_name_select_ok = true;     
           rs2.close();
          catch (Exception ex) {
             System.err.println(ex.getMessage());
          return user_name_select_ok;
         public static boolean createAcc(int empno, String username, String password, int
    level){
              boolean create_acc_ok = false;
              initConnection();
              try{
                      //create a new object,from the UserPassword table.
                   UserPassword useraccount = new UserPassword();
                   useraccount.setEmpno(empno);
                   useraccount.setUsername(username);
                   useraccount.setPassword(password);
                   useraccount.setLevel(level);
                   //assign value for ???
                   pstmt3.setInt(1, useraccount.getEmpno());
                   pstmt3.setString(2, useraccount.getUsername());
                   pstmt3.setString(3, useraccount.getPassword());
                   pstmt3.setInt(4, useraccount.getLevel());          
                   if(pstmt3.executeUpdate()==1) create_acc_ok=true;
                   pstmt3.close();
                           //con.close();
                catch(SQLException e2){
                           System.err.println(e2.getMessage());
              return create_acc_ok;
    }here is the bean (part of it)
    package data;               //is it right?
    import java.io.*;
    import java.sql.*;
    import java.util.*;
    import javax.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class UserPassword
         private int empno;
         private String username;
         private String password;
         private int level;
         // Constructor
         public UserPassword()
              this.empno = empno;
              this.username = username;
              this.password = password;
              this.level = level;
         // setters and getters are here.
    //     public boolean verifyEmpno() {
    //               return UserAccManager.verifyEmpno(empno);
    //       public boolean verifyUsername(String username) {
    //            return UserAccManager.verifyUsername(username);
         // These 2 methods not compile with or without para's.So I leave that job for the      
         //controll class UserAccManager.java.
    Now my problem is this: When I submit data, there is an error;org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: -1 in the jsp file: null
    Generated servlet error:
    [javac] Compiling 1 source file
    C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:8:
    cannot access core.data.UserPassword
    bad class file: C:\Program Files\Apache Group\Tomcat
    4.1\webapps\HRM\WEB-INF\classes\core\data\UserPassword.class
    class file contains wrong class: data.UserPassword
    Please remove or make sure it appears in the correct subdirectory of the classpath.
    import core.data.UserPassword;
    ^
    1 error
    Are there any mistakes? If so tell me where is it and how to change them.Please help.

    I try it that way, but it don't compile.
    Error:core\data\UserPassword.java:package javax.servlet does not exist
    import javax.servlet.*;
    core\data\UserPassword.java:package javax.servlet.http does not exist
    import javax.servlet.http.*;
    So,I comment them only in the UserPassword.java file,and compile it again.
    Then it compile well.I goto the directory to get the .class files.
    But there is only UserPassword.class inside the data folder. There is not
    UserAccManager.class in the core folder.
    Then I try this way,I put my 2 java files in to a new folder,
    F:\SystemName\com
    When I try it that way, but it don't compile.
    javac -classpath . -d . com\*.javaError:com\UserPassword.java:package javax.servlet does not exist
    import javax.servlet.*;
    com\UserPassword.java:package javax.servlet.http does not exist
    import javax.servlet.http.*;
    So,I comment them only in the UserPassword.java file,and compile it again.
    Now both are compiling well.There was 2 class files.
    I put them in to the WEB-INF/classes/com directory.
    Start the server.But it gave errors:
    C:\Program Files\Apache Group\Tomcat
    4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:68: cannot resolve symbol
    symbol  : variable empno
    location: class org.apache.jsp.CreateAcc_jsp
    if(UserPassword.verifyEmpno(empno)){
                                ^
    C:\Program Files\Apache Group\Tomcat
    4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:69: cannot resolve symbol
    symbol  : variable username
    location: class org.apache.jsp.CreateAcc_jsp
         if(UserAccManager.verifyUsername(username)){
                                             ^
    C:\Program Files\Apache Group\Tomcat
    4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:69: non-static method
    verifyUsername(java.lang.String) cannot be referenced from a static context
         if(UserAccManager.verifyUsername(username)){
                             ^
    C:\Program Files\Apache Group\Tomcat
    4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:70: cannot resolve symbol
    symbol  : variable empno
    location: class org.apache.jsp.CreateAcc_jsp
              if(UserAccManager.createAcc(empno, username,password,level)) nextPage
    ="MsgAcc.jsp";
                                                ^
    C:\Program Files\Apache Group\Tomcat
    4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:70: cannot resolve symbol
    symbol  : variable username
    location: class org.apache.jsp.CreateAcc_jsp
              if(UserAccManager.createAcc(empno, username,password,level)) nextPage
    ="MsgAcc.jsp";
                                                       ^
    C:\Program Files\Apache Group\Tomcat
    4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:70: cannot resolve symbol
    symbol  : variable password
    location: class org.apache.jsp.CreateAcc_jsp
              if(UserAccManager.createAcc(empno, username,password,level)) nextPage
    ="MsgAcc.jsp";
                                                                ^
    C:\Program Files\Apache Group\Tomcat
    4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:70: cannot resolve symbol
    symbol  : variable level
    location: class org.apache.jsp.CreateAcc_jsp
              if(UserAccManager.createAcc(empno, username,password,level)) nextPage
    ="MsgAcc.jsp";
                                                                         ^
    C:\Program Files\Apache Group\Tomcat
    4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:70: non-static method
    createAcc(int,java.lang.String,java.lang.String,int) cannot be referenced from a static
    context
              if(UserAccManager.createAcc(empno, username,password,level)) nextPage
    ="MsgAcc.jsp";
                                     ^
    8 errorsTo solve the problem non-static method,I goto the UserAccManager.java file and do these
    things.
    package com;
    import java.io.*;
    import java.sql.*;
    import java.util.*;
    import javax.sql.*;
    //import javax.servlet.*;               //otherwise it tells an error.(package           
                                  //javax.servlet does not exist)
    //import javax.servlet.http.*;
    public  class UserAccManager {
       private static final String DRIVER = "com.mysql.jdbc.Driver";
       private static final String URL = "jdbc:mysql://localhost:3306/superfine";
       private static Connection connection;
       private static PreparedStatement pstmt1;
        private static PreparedStatement pstmt2;
          private static PreparedStatement pstmt3;
       private UserAccManager() {
       // Initializes the connection and statements
       private static void initConnection() {
             //same
       // Closes the connection and statements
       // Method to be called by main class when finished with DB
       public static void closeConnection() {
         //same
       public static boolean verifyEmpno(int empno) {
          // same.
       public static boolean verifyUsername(String username) {
         //same.
         public static boolean createAcc(int empno, String username, String password, int      
    level){
              //same
    package com;
    import java.io.*;
    import java.sql.*;
    import java.util.*;
    import javax.sql.*;
    //import javax.servlet.*;
    //import javax.servlet.http.*;
    public class UserPassword {
         // same
    Again compile those files and put .class filses into the WEB-INF/classes/com directory.
    When i submits the data via the form it generates an error:
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 9 in the jsp file: /CreateAcc.jsp
    Generated servlet error:
        [javac] Compiling 1 source file
    C:\Program Files\Apache Group\Tomcat
    4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:68: cannot resolve symbol
    symbol  : variable empno
    location: class org.apache.jsp.CreateAcc_jsp
    if(UserAccManager.verifyEmpno(empno)){
                                  ^
    An error occurred at line: 9 in the jsp file: /CreateAcc.jsp
    Generated servlet error:
    C:\Program Files\Apache Group\Tomcat
    4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:69: cannot resolve symbol
    symbol  : variable username
    location: class org.apache.jsp.CreateAcc_jsp
         if(UserAccManager.verifyUsername(username)){
                                             ^
    An error occurred at line: 9 in the jsp file: /CreateAcc.jsp
    Generated servlet error:
    C:\Program Files\Apache Group\Tomcat
    4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:70: cannot resolve symbol
    symbol  : variable empno
    location: class org.apache.jsp.CreateAcc_jsp
              if(UserAccManager.createAcc(empno, username,password,level)) nextPage
    ="MsgAcc.jsp";
                                                ^
    An error occurred at line: 9 in the jsp file: /CreateAcc.jsp
    Generated servlet error:
    C:\Program Files\Apache Group\Tomcat
    4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:70: cannot resolve symbol
    symbol  : variable username
    location: class org.apache.jsp.CreateAcc_jsp
              if(UserAccManager.createAcc(empno, username,password,level)) nextPage
    ="MsgAcc.jsp";
                                                       ^
    An error occurred at line: 9 in the jsp file: /CreateAcc.jsp
    Generated servlet error:
    C:\Program Files\Apache Group\Tomcat
    4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:70: cannot resolve symbol
    symbol  : variable password
    location: class org.apache.jsp.CreateAcc_jsp
              if(UserAccManager.createAcc(empno, username,password,level)) nextPage
    ="MsgAcc.jsp";
                                                                ^
    An error occurred at line: 9 in the jsp file: /CreateAcc.jsp
    Generated servlet error:
    C:\Program Files\Apache Group\Tomcat
    4.1\work\Standalone\localhost\HRM\CreateAcc_jsp.java:70: cannot resolve symbol
    symbol  : variable level
    location: class org.apache.jsp.CreateAcc_jsp
              if(UserAccManager.createAcc(empno, username,password,level)) nextPage
    ="MsgAcc.jsp";
                                                                         ^
    6 errorshere is the CreateAcc.jsp file
    <%@ page language="java" %>
    <%@ page import="com.UserAccManager" %>
    <%@ page import="com.UserPassword" %>
    <jsp:useBean id="userPassword" class="com.UserPassword" scope="request"/>
    <jsp:setProperty name="userPassword" property="*" />
    <%
    String nextPage ="MainForm.jsp";
    if(UserAccManager.verifyEmpno(empno)){
         if(UserAccManager.verifyUsername(username)){
              if(UserAccManager.createAcc(empno, username,password,level)) nextPage
    ="MsgAcc.jsp";
          }else{
               nextPage="UserNameExist.jsp";
          else{
              nextPage="UserAccError.jsp";
    %>
    <jsp:forward page="<%=nextPage%>"/>Please, anyone know how to send these parameters to the java file.
    Thanks.

  • ER unable to compile using javac with java 1.3.1 library (JDEV 10.1.3.0.4)

    Hi !
    When I try to compile in JDev with javac and the java 1.3.1 library, I get the following error :
    Error: javac: invalid flag: -source
    The command line generated by JDev looks like :
    C:\jdk1.3.1_03\bin\javac.exe -J-mx512m -verbose -deprecation -source 1.3 -target 1.3 -encoding Cp1252 -g -classpath [...] -sourcepath [...] -d [...] @C:\DOCUME~1\user\LOCALS~1\Temp\javac54193.tmp
    It seems that -source and -target flags do not exist in this version of javac.
    But it does not seem possible to remove these flags generated by JDev, so I'm unable to compile with javac 1.3.1 and JDev.
    So i'm looking for :
    - A workaround to prevent JDev from adding the -source and -target flags.
    - A future release of JDev where you could disable these flags, or, much better, where JDev automatically disables these flags when it detects a 1.3.1 library (there may be other incompatible flags I did not mention).
    Thank you for your answers :)

    Hi,
    when you open the project properties and choose the compiler option to tht the compiler to "javac" and then the "source" and "target" to 1.3, wouldn't this compile it for Java 3? I don't think that it is necesary to use JDK 1.3 for compiling the sources
    Cross-Compilation Options
    By default, classes are compiled against the bootstrap and extension classes of the platform that javac shipped with. But javac also supports cross-compiling, where classes are compiled against a bootstrap and extension classes of a different Java platform implementation. It is important to use -bootclasspath and -extdirs when cross-compiling; see Cross-Compilation Example below.
    -target version
    Generate class files that will work on VMs with the specified version. The default is to generate class files to be compatible with the 1.2 VM in the Java 2 SDK. The versions supported by javac in the Java 2 SDK are:
    1.1
    Ensure that generated class files will be compatible with 1.1 and VMs in the Java 2 SDK.
    1.2
    Generate class files that will run on VMs in the Java 2 SDK, v 1.2 and later, but will not run on 1.1 VMs. This is the default.
    1.3
    Generate class files that will run on VMs in the Java 2 SDK, v 1.3 and later, but will not run on 1.1 or 1.2 VMs.
    1.4
    Generate class files that are compatible only with 1.4 VMs.
    http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javac.html
    Frank

  • Unable to compile class for JSP. apache-tomcat-6. What could be wrong?

    Hello, I am new to JSP and I am trying a very basic jsp and class file on Windows XP. I get the Unable to compile class for JSP.
    Steps that I have done:
    javac ch06_01.java , placed the ch06_01.class under
    C:\Apps\apache-tomcat-6.0.16\webapps\ch06\WEB-INF\classes
    Then grabbed the ch06_02.jsp and placed it under
    C:\Apps\apache-tomcat-6.0.16\webapps\ch06\
    When I run it (by placing this into Explorer or Firefox URL
    http://localhost:8080/ch06/ch06_02.jsp) I get the error further
    below. Things I have done and made sure they are in place are:
    set up JAVA_HOME to C:\Apps\jdk1.6.0_06
    Using CATALINA_BASE: C:\Apps\apache-tomcat-6.0.16
    Using CATALINA_HOME: C:\Apps\apache-tomcat-6.0.16
    Using CATALINA_TMPDIR: C:\Apps\apache-tomcat-6.0.16\temp
    Using JRE_HOME: C:\Apps\jre1.6.0_06
    I did a google on the error and I found people saying to place the
    tools.jar from the jsk into the lib directory under CATALINA_HOME. But
    the examples still don't work. What step could I be missing? Your help is greatly
    appreciated.
    This is the simple jsp file:
    <%@ page import="ch06_01" %>
    <HTML>
    <HEAD>
    <TITLE>Using a JavaBean</TITLE>
    </HEAD>
    <BODY>
    <H1>Using a JavaBean</H1>
    <% ch06_01 messager = new ch06_01(); %>
    The message is: <%= messager.msg() %>
    </BODY>
    </HTML>
    this is the simple ch6_01 java file:
    public class ch06_01
    public ch06_01()
    public String msg()
    return "Hello from JSP!";
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented
    it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: Unable to compile class for JSP:
    An error occurred at line: 6 in the generated java file
    The import ch06_01 cannot be resolved
    An error occurred at line: 9 in the jsp file: /ch06_02.jsp
    ch06_01 cannot be resolved to a type
    6: <BODY>
    7: <H1>Using a JavaBean</H1>
    8:
    9: <% ch06_01 messager = new ch06_01(); %>
    10:
    11: The message is: <%= messager.msg() %>
    12:
    An error occurred at line: 9 in the jsp file: /ch06_02.jsp
    ch06_01 cannot be resolved to a type
    6: <BODY>
    7: <H1>Using a JavaBean</H1>
    8:
    9: <% ch06_01 messager = new ch06_01(); %>
    10:
    11: The message is: <%= messager.msg() %>
    12:
    Stacktrace:
    org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
    org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
    org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:423)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:316)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:294)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:281)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    Edited by: indikon1 on Jun 12, 2008 1:18 PM
    I just updated the directories of the variables to reflect the current status of my system.

    What is wrong is that you are using an "old" jsp tutorial :-)
    Since Java 1.4, JSPs have been unable to access classes in the "default" package.
    What you need to do:
    Put the java class ch06_01 in a package.
    Steps to do this
    - Edit ch06_01 and add the following to the very top of the file (without the quotes): "package mypackage;"
    - create a folder "mypackage"
    - move ch06_01.java into that folder
    - compile that class (now in the mypackage package)
    - place ch06_01.class under C:\Apps\apache-tomcat-6.0.16\webapps\ch06\WEB-INF\classes\mypackage
    In your jsp:
    <%@ page import="mypackage.ch06_01" %>
    I would suggest using a more up-to-date tutorial that uses JSTL.
    Take a look at this [Apache Tomcat tutorial|http://www.coreservlets.com/Apache-Tomcat-Tutorial/index.html]

Maybe you are looking for

  • Print via bluetooth direct to printer

    I have the 8330 BB Curve (my 3rd blackberry) and I am trying to print directly from my bb to a printer via Bluetooth. Now I was in a store and made it work with a multifunction HP printer. I then took home a Canon IP100 portable and got a bluetooth a

  • Changing to a new Mac... how do I move my Logic prefs over to the new Mac?

    Hi Guys, I'm selling my Mac to upgrade to a newer one. I'll be re-installing Logic on the new device. However, after all the time I've spent configuring Logic on the current computer, I don't want to lose my prefs! How do I save and transfer my prefe

  • Trnsport request not updated

    dear all I have copied remote clint copy  profile  sap_ucus production to development server .if i am crate any role i have succesfully tranported but when i finencial custamizing  etc production server shows import successfuly ,but cuatimizing not u

  • Paper profile setting issues

    I'm pretty sure this has been discussed before, but my searches aren't yielding results..  I usually make my custom paper profiles on a PC, but need to do some on a Mac (OS 10.6). I can make the custom profiles with either an i1 Profiler or a Colormu

  • Why is it my iMac is running, but I can't see anything, or wake it up?

    When I leave my imac (desk top) or even if Im sitting at it, it just goes black, like it shut down, but you can still hear it running.  I cant wake it by the keyboard, or mouse, I have to hold the power button, for a good bit, and it eventually shuts