[BM Import] TOOL Compile error in CodeBlock

Hi,
One of the users tries to import XXXBM.pex in a workspace where there is
AppModel, Forte Express 3.0.G.2 and XXXBMServices.pex
While importing, it's got the following error:
Erros in Codeblock:
726 An object constructor for the class AppModel.abConnection contains
an unnamed clause.
All the clauses in an object constructor must be of the form
'name = expression'
It occurs 4 times
'Code Block in import file will not be run because of errors
I don't know what codeblock is, nor what a clause is.
Any suggestion ?
Thanks,
j-paul gabrielli
Sema DTS

class FileStream extends AdjMatrix {
     double answer;
     String line;
     AdjMatrix theMatrix;
     int total;
     public FileStream(String fileName) {
          Since you don't specify which constructor of AdjMatrix to use in the contruction of FileStream the compiler is trying to use the default constructor of AdjMatrix BUT you don't have one!
Possible solutions -
1) Define a default constructor in AdjMatrix.
2) Use the public AdjMatrix(int num_vertices) constructor by using
     public FileStream(String fileName) {
             super(10); // or what ever size you think is appropriate3) Change AdjMatrix to use so as to use dynamic arrays (ArrayList?) instead of having a fixed dimension.
4) MakeFile stream a factory that does not extend AdjMatrix but has a method that returns an AdjMatrix based on a filename argument.
e.g.
class  FileStreamFactory
     public AdjMatrix createFromFile(String filename)
             // Parse the file to get the size
            AdjMatrix theMatrix = new AdMatrix(the size you parsed);
            // Fill in anything else you need to
            return  theMatrix ;
}You would use this by creating a factory and then using it to create your AdjMatrix.
It should be obvious that I prefer approach 4.
Have fun!

Similar Messages

  • Import and compiling error.....

    3 errors occur when I try to compile a a particular file-
    1 ) Cannot find <package> to import. How to correct that?
    2) Error saying - "public class <xyz> must be defined in a file called <xyz.java> Although the method is defined in the file, I still get the error.
    3) Error - <filename>:154: Class com.sun.net.ssl.internal.ssl.Provider not found
    Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider ());
    Please help.

    for 2
    When calling javac xyz.java xyz.java must contain a class xyz
    xyz is casesesitive even if your os's filesystem is not.

  • Xilinx tools compile error when translating

    Hello guys!
    I have a trouble with compiling a code from article DSA Module Synchronization Reference Design for Multiple cRIO Chassis. The target system is cRIO 9024 with 9118 chassis, 9225 and 9227 AI modules in slot 2,3 and 9401 DIO module in slot 4. The compilation preparation works well, configuration too. When it comes to translating process, xilinx sends an error. I have attached xilinx log with error codes.
    If  you have any idea, I'd be glad to hear it.
    Attachments:
    XilinxLog.zip ‏101 KB

    Hi,
    This is quite a log file that you have attached. Let's take a step back first, to try to eliminate some possible sources of the issue. Please provide information on your development system. (e.g. LabVIEW version, FPGA version, NI RIO version, version of Xilinx Tools) Also, are you able to successfully compile and run a blank VI and / or other LabVIEW FPGA example code on the 9024 / 9118? Finally, I see that you attached the error log, but what particular error message or code do you receive during the translating process?
    Regards,
    Kareem W.
    National Instruments
    Web Product Manager

  • Compile Error for Import com.sun.javadoc.*;

    I need to write some simple doclets and found some beginner code on the Sun website. The first line of the sample app is:
    import com.sun.javadoc.*;However, I get a compile error:
    C:\JavaDoc\Doclet\ListClass.java:1: package com.sun.javadoc does not exist
    import com.sun.javadoc.*;I found the com.sun.javadoc package in the tools.jar file in the lib directory of my sdk. So I added the following to my classpath:
    C:\j2sdk1.4.2_08\lib;Then I recompiled but received the same error. What have I done wrong? I'm on Windows XP.
    TIA.

    > C:\j2sdk1.4.2_08\lib;
    C:\j2sdk1.4.2_08\lib\tools.jar;

  • How to suppress compiler errors without excluding database objects from the "Schema Compare" tool (using VS2013/SSDT)

    Hi,
    In short: How to suppress compiler errors without excluding the object from the "Schema Compare" tool ??
    A bit longer:
    We have a SQL Server 2008 project in Visual Studio 2013 running SQL Server Data Tool.
    An old database, with a lot of history in, has been imported into SSDT and there are many syntax errors preventing the project from compiling/running. An typical error is: "SQL70001: This statement is not recognized in this context".
    Running the "faulty" scripts on the server, executes just fine. I understand that there are syntax errors and they should be rewritten, but it's not gonna happen just like that - it is a slow process over a long period of time.
    I know it is possible to change Build Action to None, but that also exclude the object from appearing in the Schema Compare function/window.
    So - how to ignore some compiler errors and still having the objects to appear when doing "Schema Compare" ??
    Thank you in advance.

    Hi Steven,
    Thanks for your comments.
    Well, it sure does help in the future, but right now i would prefer the other way - to suppress some errors and still allow the scripts to build.
    The thing is that if we "rewrite" the objects into create scripts, then we have a huge test job ahead of us + the database environments (PROD vs DEV and UAT) does not share the same AD or DB users and therefore grants is lost if dropping/creating
    objects, right!
    If you drop a object before creating it, the drop will also drop the roles and grants and since they don't share user table, the create will not be able to add the permissions again. There might be a solution to that, but it is going to be very complicated
    for some newbies like us. We need something we can trust.
    BR
    Peter

  • Compilation Error for import classes not found in generated Proxy Class

    Hi,
    We are generating java classes for the COM dll using JCOM com2java compiler.
    We are getting a compilation error for import class not found when compiling the
    generated Proxy java source code. It can't find the com.bea.jcom.Dispatch class that
    the generated Proxy java source code extends. It also can't find com.bea.jcom.Variant
    or com.bea.jcom.Param. These are interfaces or data types or classes used by COM
    library.
    I added weblogic.jar to my class path and the only Dispatch class i found inside
    the weblogic.jar is com.linar.jintegra.Dispatch;
    We have com objects for which we want to develop an EJB client to interface with
    the COM object using JCOM with Native Mode disabled.
    Any help on the compilation error..I tried changing the extends for Dispatch to com.linar.jintegra.Dispatch
    but the other errors are still there.
    To begin with, I think the generated code should not refer to any of the COM data
    types.
    Any help please.
    Thank you in advance,
    Regards,
    Rahul Srivastava
    [email protected]

    Hi,
    I resolved the other errors by changing all references from com.bea.jcom.Variant
    etc to com.linar.jintegra.class name..all were present under the com.linar.jintegra
    package.
    Thank you all anyways,
    Regards,
    rahul
    "Rahul Srivastava" <[email protected]> wrote:
    >
    Hi,
    We are generating java classes for the COM dll using JCOM com2java compiler.
    We are getting a compilation error for import class not found when compiling
    the
    generated Proxy java source code. It can't find the com.bea.jcom.Dispatch
    class that
    the generated Proxy java source code extends. It also can't find com.bea.jcom.Variant
    or com.bea.jcom.Param. These are interfaces or data types or classes used
    by COM
    library.
    I added weblogic.jar to my class path and the only Dispatch class i found
    inside
    the weblogic.jar is com.linar.jintegra.Dispatch;
    We have com objects for which we want to develop an EJB client to interface
    with
    the COM object using JCOM with Native Mode disabled.
    Any help on the compilation error..I tried changing the extends for Dispatch
    to com.linar.jintegra.Dispatch
    but the other errors are still there.
    To begin with, I think the generated code should not refer to any of the
    COM data
    types.
    Any help please.
    Thank you in advance,
    Regards,
    Rahul Srivastava
    [email protected]

  • Problem When Import Java Class -compilation error

    Hi all
    I made a java class that has methods to return Screen width and Height .
    package tarek;
    import java.awt.Dimension;
    import java.awt.Toolkit;
    public class Screen
    Dimension dim ;
    public Screen()
    dim = Toolkit.getDefaultToolkit().getScreenSize();
    public double getWidth()
    double w = dim.getWidth();
    return w;
    public double getHeight()
    double h=dim.getHeight();
    return h;
    I made the jar file " screen.jar" and make it ready to use in form builder
    I opened form builder and make import java class (From program>import java class>choose the class anc click import)
    The class now imported successfully and the PL/SQL package body is:
    PACKAGE Screen /* tarek.Screen */ IS
    -- DO NOT EDIT THIS FILE - it is machine generated!
    -- Constructor for signature ()V
    FUNCTION new RETURN ORA_JAVA.JOBJECT;
    -- Method: getHeight ()D
    FUNCTION getHeight(
    obj ORA_JAVA.JOBJECT) RETURN NUMBER;
    -- Method: getWidth ()D
    FUNCTION getWidth(
    obj ORA_JAVA.JOBJECT) RETURN NUMBER;
    END;
    Now I made a button on the form and i WRITE THIS CODE TO INVOKE THE CLASS on when_button_pressed
    DECLARE
         vScreen_Class ORA_JAVA.JOBJECT;     
    BEGIN
         vScreen_Class := SCREEN.NEW;
    END;
    My problem is I have compilation error
    error 306 AT LINE 5 , COLUMN 25
    wrong number or types of argument in call to "NEW"
    I do not know what is the reason of this compilation error?
    Is it because the method in java return "double datatype" while in oracle return "number datatype"
    Please help
    Edited by: [email protected] on Dec 28, 2009 10:24 AM

    Sarah, I ca not move my thread to JDeveloper because it is not java issue. The problem is with my PL/SQL code and the way I make Import Java class to forms Builder. The Java code is OK.
    Andreas Thank you so much for replying. In fact I made a full compile "Ctrl+Alt+K". but still error
    The following is the package Body
    PACKAGE BODY Screen IS
    -- DO NOT EDIT THIS FILE - it is machine generated!
    args JNI.ARGLIST;
    -- Constructor for signature ()V
    FUNCTION new RETURN ORA_JAVA.JOBJECT IS
    BEGIN
    args := NULL;
    RETURN (JNI.NEW_OBJECT('tarek/Screen', '()V', args));
    END;
    -- Method: getHeight ()D
    FUNCTION getHeight(
    obj ORA_JAVA.JOBJECT) RETURN NUMBER IS
    BEGIN
    args := NULL;
    RETURN JNI.CALL_DOUBLE_METHOD(FALSE, obj, 'tarek/Screen', 'getHeight', '()D', args);
    END;
    -- Method: getWidth ()D
    FUNCTION getWidth(
    obj ORA_JAVA.JOBJECT) RETURN NUMBER IS
    BEGIN
    args := NULL;
    RETURN JNI.CALL_DOUBLE_METHOD(FALSE, obj, 'tarek/Screen', 'getWidth', '()D', args);
    END;
    BEGIN
    NULL;
    END;
    ---------------------------------------------------------------------------------

  • Compile errors importing Map$Entry

    Hi,
    I trying to compile code written by my client which uses the following syntax
    import java.util.Map$Entry.
    This throws a compilation error :
    cant resolve symbol class Map$Entry
    package : java.util
    The same compile at the client side works. Am i missing some configuration. Also why is the path defined as Map$Entry instead of Map.Entry.
    any help would be greatly appreciated
    thanks and regrads
    Kumar Vellal

    What you're client is trying to do is import a nested class. To do this you use the syntax:
    import A.Enclosing.Nested;Now you can refer to the nested class without refering to the enclosing class (i.e Nested n = new Nested();)
    However - Some compilers don't like this, and I don't like it. You shouldn't import nested classes directly like this.

  • Flash CC on W7 . By importing fl.controls like 'import fl.controls.Button';  I get compilation error 1172. Solution?

    Flash CC on W7 . By importing fl.controls like 'import fl.controls.Button';  I get compilation error 1172. Solution?

    Can you show the relevant code and the complete error message?  Before running go into your Flash Publish Settings and choose the option to Permit Debugging - it can help by adding information to the error message.

  • What does compiler error " import test; `.`expected" mean ?

    Hi,
    I have a compiler error for following lines. There is a file called Const.java and this file is located on the same directory with the file I intend to compile. However, it seems compiler looks for an import package...
    What does "import test;" command mean ? What is missing in following source code ?
    c:\test> javac -classpath ./ -d ./ *.java one/*.java
    Error :
    test2.java:1: '.' expected
    import test;
    ^
    Source :
    (c:\test\test.java)
    class test
         public static void main(String[] args)
              System.out.println("Hello World!");
    (c:\test\one\test2.java)
    package one;
    import test;
    class test2
         public static void main(String[] args)
              System.out.println("Hello World!");

    Source :
    (c:\test\test.java)
    class test
         public static void main(String[] args)
              System.out.println("Hello World!");
    Since you have no package statement in here, then it is said to reside in the default package. This means, (I believe) that you will not need to use an import statement to use this class. However, if I am wrong, which you can find out in testing, another solution would be to include all you classes in the same package, in this class have both source files start with the line :
    package one;Hope this helped.
    Ed

  • Adding import fl.video causes a compiler error

    So I added this to my action script:
    import fl.video;
    And got these compile errors:
    1172: Definition fl:video could not be found.
    1172: Definition fl:video could not be found.
    Checked my version, and I DO have CS3 Professional.
    I'm assuming I'm missing something really easy. Help?
    Thanks,
    Scott Osborn

    myIP,
    Tried that, and no go.
    Went to Edit->Preferences...->ActionScript
    Clicked the "ActionScript 3.0 Settings..." button.
    Looked in that path, and it wasn't there. Did a search on my
    Flash CS3 folder and found what looked to be the video playback
    code in:
    ...\Component Source\ActionScript 3.0\FLVPlayback
    Added that to path to the "ActionScript 3.0 Settings".
    Tried it, and I'm in.
    I THINK this is the solution, but will have to wait until
    I've tested all the functionality.....
    Thanks man,
    Scott

  • Compilation Error: "class or interface expected" for simple EAR???

    Dear all,
    I have access to the customers NW CE 7.1 SP07 and of course I am using the corresponding NWDS 7.1 SP07 that comes with this CE installation. I am trying to study JEE 5 @ SAP and I have created a very simple Application (from the Book http://www.sap-press.de/katalog/buecher/titel/gp/titelID-1480).
    In NWDS I have created the following 4 projects:
    1. Dictionary Project
    Describes 2 Tables (TMP_EMPLOYEES and TMP_ID_GEN)
    2. EJB 5 Project
    Contains a stateless EJB + local business interface + Entity class.
    The EJB accesses the entity class, which is mapped to a simple table (TMP_EMPLOYEES).
    3. Dynamic Web Project
    Contains actually only one JSP (index.jsp) which allows to the local business interface for creating a new Entity.
    4. Enterprise Application Project (EAR)
    Creates a package from 2. and 3.
    I have successfully deployed both the Dictionary Project and the EAR (all to the same server).
    But If I call the corresponding URL via web browser I get the following error:
    500   Internal Server Error
    "Error in compiling [/EmployeeWeb/index.jsp] in application [sap.com/EmployeeEar]."
    Details: "The WebApplicationException log ID is [005056841108002A00000070000007AC0139C8D8862D3EED]."
    In the "Log Viewer" of the "SAP NetWeaver Administrator" (via browser...) I have found the following:
    Message: Processing HTTP request to servlet [jsp] finished with error.
    The error is: com.sap.engine.services.servlets_jsp.server.jsp.exceptions.CompilingException: Error in executing the compilation process: [ Compilation Failed! Exit Code=1
    Command line executed: D:\usr\sap\CED\J00\exe\sapjvm_5\bin\\javac -source 1.5 -target 1.5 -encoding UTF-8 -d "D:\usr\sap\CED\J00\j2ee\cluster\apps\sap.com\EmployeeEar\servlet_jsp\EmployeeWeb\work" -sourcepath "D:\usr\sap\CED\J00\j2ee\cluster\apps\sap.com\EmployeeEar\servlet_jsp\EmployeeWeb\work\;" -classpath ".;D:\usr\sap\CED\J00\exe\jstartup.jar;D:\usr\sap\CED\J00\exe\sapjvm_5\lib\jvmx.jar;D:\usr\sap\CED\J00\exe\jre\lib\iqlib.jar;D:\usr\sap\CED\J00\exe\sapjvm_5\lib\tools.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\boot\sap.com~tc~bl~jkernel_boot~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\boot\jaas.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\system\sap.com~tc~bl~bytecode~library.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\boot\memoryanalyzer.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\system\jperflib.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\system\jta.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\system\sap.com~tc~bl~bytecode~library.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\system\sap.com~tc~bl~cache_api~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\system\sap.com~tc~bl~frame~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\system\sap.com~tc~bl~gui~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\system\sap.com~tc~bl~iqlib~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\system\sap.com~tc~bl~jdsr~jdsr.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\system\sap.com~tc~bl~jkernel_cache~frame.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\system\sap.com~tc~bl~jkernel_classload~frame.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\system\sap.com~tc~bl~jkernel_cluster~frame.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\system\sap.com~tc~bl~jkernel_configuration~frame.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\system\sap.com~tc~bl~jkernel_database~frame.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\system\sap.com~tc~bl~jkernel_licensing~frame.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\system\sap.com~tc~bl~jkernel_locking~frame.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\system\sap.com~tc~bl~jkernel_log~api.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\system\sap.com~tc~bl~jkernel_pool~frame.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\system\sap.com~tc~bl~jkernel_service~frame.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\system\sap.com~tc~bl~jkernel_thread~frame.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\system\sap.com~tc~bl~jkernel_util~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\system\sap.com~tc~bl~opensqlkernel~implOpenSQLFrame.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\system\sap.com~tc~exception~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\system\sap.com~tc~je~sessionmgmt~api_assembly.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\system\sap.com~tc~logging~java~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\system\sap.com~tc~logging~java~implPerf.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\system\vmc_storage_provider.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\services\timeout\sap.com~tc~je~timeout~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\servlet\servlet.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\interfaces\cross_api\sap.com~tc~je~cross_api~API.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\core_lib\sap.com~tc~antlr~runtime.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\core_lib\sap.com~tc~bl~config~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\core_lib\sap.com~tc~bl~cpt~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\core_lib\sap.com~tc~bl~jarm~jarm.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\core_lib\sap.com~tc~bl~opensqlkernel~implOpenSQL.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\core_lib\sap.com~tc~bl~opensqlkernel~implOpenSQLPort.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\core_lib\sap.com~tc~dd~db~dictionarydatabase~implDictionaryDatabase.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\core_lib\sap.com~tc~je~bootstrap_core_lib~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\core_lib\sap.com~tc~sec~secstorefs~java~core.jar;D:\usr\sap\CED\J00\exe\mssjdbc\sqljdbc.jar;D:\usr\sap\CED\SYS\global\security\lib\engine\iaik_jce.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\interfaces\log\sap.com~tc~je~log_api~API.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\mail-activation-iaik\mail.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\mail-activation-iaik\sap.com~tc~je~javamail_lib~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\mail-activation-iaik\activation.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\mail-activation-iaik\iaik_jsse.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\mail-activation-iaik\iaik_smime.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\mail-activation-iaik\iaik_ssl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\mail-activation-iaik\w3c_http.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\com.sap.security.api.sda\sap.com~tc~sec~ume~api~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\com.sap.security.api.sda\sap.com~tc~sec~ume~perm~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\interfaces\security_api\sap.com~tc~je~security_api~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\interfaces\shell\sap.com~tc~je~shell_api~API.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\services\cross\sap.com~tc~je~cross~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\interfaces\visual_administration\sap.com~tc~bl~visual_administration~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\services\shell\sap.com~tc~je~shell~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\services\p4\sap.com~tc~je~p4~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\sapxmltoolkit\sap.com~tc~sapxmltoolkit~sapxmltoolkit.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\jts\jts.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\tc~jmx\sap.com~tc~bl~pj_jmx~Impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\tc~je~mmodel~lib\sap.com~tc~je~mmodel~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\interfaces\appcontext_api\sap.com~tc~je~appcontext_api~API.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\services\naming\sap.com~tc~je~naming~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\j2eeca\connector.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\idl\idl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\interfaces\resourceset_api\sap.com~tc~bl~resourceset~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\interfaces\resourcecontext_api\sap.com~tc~bl~resourcecontext~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\tc~bl~txmanager~plb\sap.com~tc~bl~txmanagerimpl~plb~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\interfaces\transactionext_api\sap.com~tc~bl~transactionext~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\services\ts\sap.com~tc~je~ts~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\interfaces\csiv2_api\sap.com~tc~bl~csiv2~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\services\iiop\sap.com~tc~je~iiop~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\services\file\sap.com~tc~je~file~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\com.sap.tc.Logging\sap.com~tc~logging~standard~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\tc~je~bcanalysis\sap.com~tc~je~bcanalysis~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\tc~bl~reference_graph\lib\tc~bl~reference_graph_api.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\interfaces\container_api\sap.com~tc~je~container_api~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\interfaces\webservices\sap.com~tc~je~webservices_api~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\com.sap.util.monitor.jarm\sap.com~tc~bl~jarmsat~jarmsat.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\tc~i18n~verify~intf\sap.com~tc~i18n~verify~intf~jar~IMPL.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\tc~i18n~cp\sap.com~tc~i18n~cp~jar~IMPL.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\tc~i18n~decfloat\sap.com~tc~i18n~decfloat~jar~IMPL.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\tc~com.sap.conn.jco\sap.com~tc~bl~jco_sapj2ee~runtime.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\com.sap.mw.jco\sap.com~tc~bl~jrfc~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\interfaces\keystore_api\sap.com~tc~je~keystore_api~API.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\interfaces\tc~sec~certrevoc~interface\sap.com~tc~sec~certrevoc~interface~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\security.class\sap.com~tc~sec~https~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\security.class\sap.com~tc~sec~compat~core.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\security.class\sap.com~tc~sec~ssf~core.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\security.class\sap.com~tc~sec~jaas~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\security.class\sap.com~tc~sec~saml~toolkit~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\security.class\sap.com~tc~sec~csi~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\security.class\sap.com~tc~sec~util0~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\security.class\sap.com~tc~sec~userstore~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\security.class\sap.com~tc~sec~xmlbind~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\security.class\sap.com~tc~sec~destinations~lib~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\com.sap.guid\sap.com~tc~bl~guidgenerator~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\stax_api\jsr173_1.0_api.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\stax_api\sjsxp.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\jaxb20\jaxb-api.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\jaxb20\jaxb-xjc.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\jaxb20\jaxb-impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\saaj13\saaj-api.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\saaj13\saaj-impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\jaxws_api\jaxws-api.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\jws_api\jsr181-api.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\javax~annotation~api\annotation-api-1.0.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\compilation_lib\sap.com~tc~bl~compilation~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\tc~bl~base_webservices_lib\sap.com~tc~bl~base_webservices_lib.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\tc~bl~base_webservices_lib\jaxm-api.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\tc~bl~base_webservices_lib\jaxrpc-api.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\tc~bl~base_webservices_lib\jaxr-api.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\tc~bl~base_webservices_lib\jaxws-rt.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\tc~bl~base_webservices_lib\jaxws-tools.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\tc~je~j2eedescriptors~lib\sap.com~tc~je~j2eedescriptors~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\tc~je~ejb~metadata~model\lib\sap.com~tc~bl~ejb~metadata~model.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\javax~persistence~api\persistence-api-1.0.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\interfaces\ejbormapping_api\sap.com~tc~je~ejbormapping_api~API.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\tc~je~orpersistence~metadata~model\sap.com~tc~bl~orpersistence~metadata~model.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\tc~je~jlinee~lib\sap.com~tc~jtools~util.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\tc~je~jlinee~lib\sap.com~tc~jtools~jlin~core.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\tc~je~jlinee~lib\sap.com~tc~jtools~jlinee~lib.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\tc~je~jlinee~lib\sap.com~tc~jtools~jlinee~ear.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\tc~je~jlinee~lib\sap.com~tc~jtools~jlinee~connector.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\tc~je~jlinee~lib\sap.com~tc~jtools~jlinee~web.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\tc~je~jlinee~lib\sap.com~tc~jtools~jlinee~ejb.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\tc~je~jlinee~lib\sap.com~tc~jtools~jlinee~appclient.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\tc~je~jlinee~lib\sap.com~tc~jtools~jlinee~orpersistence.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\services\deploy\sap.com~tc~je~deploy~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\services\jmx_notification\sap.com~tc~je~jmx_notification~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\services\runtimeinfo\sap.com~tc~je~runtimeinfo~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\services\jmx\sap.com~tc~je~jmx~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\services\jmx\sap.com~tc~je~jmx~impl~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\services\http\sap.com~tc~je~httpserver~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\tc~je~exprlang~plb\jee5_el.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\ec~java~jstl\jstl-1_2.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\tc~je~injection~lib\lib\private\tc~je~injection.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\ec~java~jsf\lib\ec~java~jsf_api.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\ec~java~jsf\lib\ec~java~jsf~tld.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\ec~java~jsf\lib\private\com-sun-commons-beanutils.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\ec~java~jsf\lib\private\com-sun-commons-collections.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\ec~java~jsf\lib\private\com-sun-commons-digester.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\ec~java~jsf\lib\private\com-sun-commons-logging-api.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\ec~java~jsf\lib\private\ec~java~jsf_core.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\tc~je~jacc~plb\jacc-1_1-fr-class.zip;D:\usr\sap\CED\J00\j2ee\cluster\bin\services\classpath_resolver\sap.com~tc~je~classpath_resolver~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\com.sap.ip.basecomps\sap.com~tc~bl~basecomps~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\sdo\lib\sap.com~sdo.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\sdo\lib\sap.com~sdo~api.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\sdo\lib\sap.com~sdo~api~extension.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\ejb_api\ejb-3_0-api.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\webservices_lib\sap.com~tc~je~webservices_lib~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\tc~i18n~saptimezone\sap.com~tc~i18n~saptimezone~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\tc~i18n~cpbase\sap.com~tc~i18n~cpbase~jar~IMPL.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\com.sap.security.core.sda\sap.com~tc~sec~ume~core~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\com.sap.security.core.sda\sap.com~tc~sec~ume~tpd~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\jms\jms.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\jms\jmsclient.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\interfaces\com.sap~tc~je~jmsapi\sap.com~tc~je~jmsapi~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\services\userstore\sap.com~tc~je~userstore~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\tc~SL~utility\sap.com~tc~bl~sl~utility~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\com.sap.exception\sap.com~tc~exception~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\tc~bl~jarsap~sda\sap.com~tc~bl~jarsap~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\interfaces\tc~bl~deploy_api\sap.com~tc~bl~deploy~api.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\tc.httpclient\sap.com~tc~clients~http~all.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\interfaces\tc~sec~destinations~interface\sap.com~tc~sec~destinations~interface_api~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\interfaces\endpoint_api\sap.com~tc~bl~endpoint~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\services\connector\sap.com~tc~je~connector~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\antlr\sap.com~tc~antlr~runtime.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\services\dbpool\sap.com~tc~je~dbpool~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\services\tc~sec~destinations~provider\sap.com~tc~sec~destinations~provider~java~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\services\com.sap.security.core.ume.service\sap.com~tc~sec~ume~service~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\sap.com~tc~je~constants~lib\lib\tc~je~constants.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\services\schemaprocessor~srv\sap.com~tc~je~schemaprocessor.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\interfaces\tc~je~webcontainer~api\sap.com~tc~je~webcontainer~webcontainer_api_impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\services\servlet_jsp\sap.com~tc~je~webcontainer~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\objectProfiler\sap.com~tc~bl~objectProfiler~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\services\tc~je~cachemgmt~srv\sap.com~tc~je~cachemgmt~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\services\locking\sap.com~tc~je~locking~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\services\configuration\sap.com~tc~je~configuration~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\services\basicadmin\sap.com~tc~je~basicadmin~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\services\basicadmin\jstartupapi.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\services\basicadmin\jstartupimpl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\services\adminadapter\sap.com~tc~je~adminadapter~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\services\security\sap.com~tc~je~security~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\services\applocking\sap.com~tc~je~applocking~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\ejb20\ejb20.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\ejbqlparser\sap.com~tc~bl~ejbqlparser~lib.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\ejbqlparser\sap.com~tc~bl~ejbqlparser_3_0~lib.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\sqlmapper\sap.com~tc~bl~ejbsqlmapper~implCommonSQLMapper.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\sqlmapper\sap.com~tc~bl~ejbsqlmapper~implSQLMapperAPI.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\interfaces\ejbmonitor_api\sap.com~tc~bl~ejbmonitor~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\services\ejb\sap.com~tc~je~ejb~impl.jar;D:\usr\sap\CED\J00\j2ee\cluster\bin\ext\orpersistence_client_lib\lib\orpersistence_client_lib_api.jar;D:\usr\sap\CED\J00\j2ee\cluster\apps\sap.com\EmployeeEar\orpersistence\jars\EmployeeEjb.jar;D:\usr\sap\CED\J00\j2ee\cluster\apps\sap.com\EmployeeEar\EJBContainer\applicationjars\EmployeeEjb.jar;D:\usr\sap\CED\J00\j2ee\cluster\apps\sap.com\EmployeeEar\servlet_jsp\EmployeeWeb\work;;" -nowarn -g ["D:\usr\sap\CED\J00\j2ee\cluster\apps\sap.com\EmployeeEar\servlet_jsp\EmployeeWeb\work\JEE_jsp_index_8832250_1231538390011_1231538444324.java"]
    Error stream contains:"D:\usr\sap\CED\J00\j2ee\cluster\apps\sap.com\EmployeeEar\servlet_jsp\EmployeeWeb\work\JEE_jsp_index_8832250_1231538390011_1231538444324.java:16: 'class' or 'interface' expected
    import javax.servlet.*;
    ^
    D:\usr\sap\CED\J00\j2ee\cluster\apps\sap.com\EmployeeEar\servlet_jsp\EmployeeWeb\work\JEE_jsp_index_8832250_1231538390011_1231538444324.java:17: 'class' or 'interface' expected
    import javax.servlet.http.*;
    ^
    D:\usr\sap\CED\J00\j2ee\cluster\apps\sap.com\EmployeeEar\servlet_jsp\EmployeeWeb\work\JEE_jsp_index_8832250_1231538390011_1231538444324.java:18: 'class' or 'interface' expected
    import javax.servlet.jsp.*;
    ^
    3 errors
    "].005056841108002A00000070000007AC0139C8D8862D3EED Date: 2009-01-09 Time: 23:00:45:042 Category: /System/Server/WebRequests Location: com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl Application: sap.com/EmployeeEar Thread: HTTP Worker [4] Data Source: j2ee\cluster\server0\log\system\server_00.log Correlator ID: 88322500000038637 Argument Objects: Arguments: DSR Component: n.a. DSR Transaction: 10c493a0de9311dd9631005056841108 DSR User: Message Code: Session: 979 Transaction: User: Guest Host: IMGNWCED System: CED Instance: J00 Node: server0
    As you can see there is some compilation error, it says 3 times "'class' or 'interface' expected". If i remove all the relevant EJB java code from my index.jsp everything works fine. So I guess there must be some problem with finding the resources. Unfortunately this "logging" is not helpful at all (thank you SAP!). In NWDS everything is fine no problems at all!!!
    Who can help me here with this?
    Thanks in Advance

    I have found the issue.
    in the index.jsp I have the following lines:
    <!-- Import Statements -->
    <%@ page import="javax.naming.InitialContext" %>
    <%@ page import="com.sap.demo.session.EmployeeServicesLocal;" %>
    Now check the end of the second import ==> ;
    Removing the semicolon solves the issue. But the SAP error message is still not very helpful to me.

  • Compile error - cannot resolve symbol

    Hello,
    I am trying this code although I get compile errors as stated.
    import java.util.Scanner;
    * Write a program that reads 10 numbers from the keyboard into
    * an array and then prints the list of numbers
    * Modify the above program so that it prints the numbers in reverse order
    class Keyboard
      public static void main (String[] argStrings)
         System.out.println("Enter 10 numbers please");
         Scanner scan = new Scanner(System.in);
         int[] newArray = new int[10];
         for(int i = 0; i < 10; i++)
              newArray[i] = scan.nextInt();
         System.out.println();
         for(int i = 9; i > 0; i--)
              System.out.print(newArray);
    System.out.println();
    I have googled for solutions but have had no luck or could not understand.
    Please could someone explain what is going on.
    Cheers

    E:\Documents and Settings\John\Desktop\Computing\Programming\Weeks\Week11\Keyboard.java:1: cannot resolve symbol
    symbol : class Scanner
    location: package util
    import java.util.Scanner;
    ^
    E:\Documents and Settings\John\Desktop\Computing\Programming\Weeks\Week11\Keyboard.java:15: cannot resolve symbol
    symbol : class Scanner
    location: class Keyboard
         Scanner scan = new Scanner(System.in);
    ^
    E:\Documents and Settings\John\Desktop\Computing\Programming\Weeks\Week11\Keyboard.java:15: cannot resolve symbol
    symbol : class Scanner
    location: class Keyboard
         Scanner scan = new Scanner(System.in);
    ^
    3 errors
    Tool completed with exit code 1
    cheers

  • Need help determining compiling error

    Good morning,
    I need help finding the cause of a compiling error I receive. I have reviewed my code numerous times without any luck. I hope you guys might see something I am not! The entire file exceeds the limit I can post, so I am attaching it in 2 posts. Sorry for the inconvenience. The error and my code are posted below. Thank you for your help!
    C:\StockTrackerDB.java:382: cannot find symbol
    symbol : method add(java.lang.Boolean)
    location: class java.util.ArrayList<java.lang.String>
                   aList.add(new Boolean(rs.getBoolean("admin")));
    ^
    1 error
    Tool completed with exit code 1
    import java.io.*;
    import java.sql.*;
    import java.util.*;
    public class StockTrackerDB
         private Connection con = null;
         //Constructor; makes database connection
         public StockTrackerDB() throws ClassNotFoundException,SQLException
              if(con == null)
                   String url = "jdbc:odbc:StockTracker";
                   try
                        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   catch(ClassNotFoundException ex)
                        throw new ClassNotFoundException(ex.getMessage() +
                                    "\nCannot locate sun.jdbc.odbc.JdbcOdbcDriver");
                   try
                        con = DriverManager.getConnection(url);
                   catch(SQLException ex)
                        throw new SQLException(ex.getMessage()+
                                    "\nCannot open database connection for "+url);
         // Close makes database connection; null reference to connection
         public void close() throws SQLException,IOException,ClassNotFoundException
              con.close();
              con = null;
         // Method to serialize object to byte array
         private byte[] serializeObj(Object obj) throws IOException
              ByteArrayOutputStream baOStream = new ByteArrayOutputStream();
              ObjectOutputStream objOStream = new ObjectOutputStream(baOStream);
              objOStream.writeObject(obj); // object must be Serializable
              objOStream.flush();
              objOStream.close();
              return baOStream.toByteArray(); // returns stream as byte array
         // Method to deserialize bytes from a byte array into an object
         private Object deserializeObj(byte[] buf) throws IOException, ClassNotFoundException
              Object obj = null;
              if(buf != null)
                   ObjectInputStream objIStream = new ObjectInputStream(new ByteArrayInputStream(buf));
                   obj = objIStream.readObject(); //IOException, ClassNotFoundException
              return obj;
         // Methods for adding a record to a table
         // add to the Stocks Table
         public void addStock(String stockSymbol, String stockDesc) throws SQLException, IOException, ClassNotFoundException
              Statement stmt = con.createStatement();
              stmt.executeUpdate("INSERT INTO Stocks VALUES ('"
                                    +stockSymbol+"'"
                                    +",'"+stockDesc+"')");
              stmt.close();
         // add to the Users table
         public boolean addUser(User user) throws SQLException,IOException,ClassNotFoundException
              boolean result = false;
              String dbUserID;
              String dbLastName;
              String dbFirstName;
              Password dbPswd;
              boolean isAdmin;
              dbUserID = user.getUserID();
              if(getUser(dbUserID) == null)
                   dbLastName = user.getLastName();
                   dbFirstName = user.getFirstName();
                   Password pswd = user.getPassword();
                   isAdmin = user.isAdmin();
                   PreparedStatement pStmt = con.prepareStatement("INSERT INTO Users VALUES (?,?,?,?,?)");
                   pStmt.setString(1, dbUserID);
                   pStmt.setString(2, dbLastName);
                   pStmt.setString(3, dbFirstName);
                   pStmt.setBytes(4, serializeObj(pswd));
                   pStmt.setBoolean(5, isAdmin);
                   pStmt.executeUpdate();
                   pStmt.close();
                   result = true;
              else
                   throw new IOException("User exists - cannot add.");
              return result;
         // add to the UserStocks table
         public void addUserStocks(String userID, String stockSymbol)
                        throws SQLException,IOException,ClassNotFoundException
              Statement stmt = con.createStatement();
              stmt.executeUpdate("INSERT INTO UserStocks VALUES ('"
                                    +userID+"'"
                                    +",'"+stockSymbol+"')");
              stmt.close();
         // Methods for updating a record in a table
         // updating the Users table
         public boolean updUser(User user) throws SQLException, IOException, ClassNotFoundException
              boolean result = false;
              String dbUserID;
              String dbLastName;
              String dbFirstName;
              Password dbPswd;
              boolean isAdmin;
              dbUserID = user.getUserID();
              if(getUser(dbUserID) != null)
                   dbLastName = user.getLastName();
                   dbFirstName = user.getFirstName();
                   Password pswd = user.getPassword();
                   isAdmin = user.isAdmin();
                   PreparedStatement pStmt = con.prepareStatement("UPDATE Users SET lastName = ?," + " firstName = ?, pswd = ?, admin = ? WHERE userID = ?");
                   pStmt.setString(1, dbLastName);
                   pStmt.setString(2, dbFirstName);
                   pStmt.setBytes(3, serializeObj(pswd));
                   pStmt.setBoolean(4, isAdmin);
                   pStmt.setString(5, dbUserID);
                   pStmt.executeUpdate();
                   pStmt.close();
                   result = true;
              else
                   throw new IOException("User does not exist - cannot update.");
              return result;
         }

         // Methods for deleting a record from a table
         // delete a record from the Stocks table
         private void delStock(String stockSymbol) throws SQLException,IOException,ClassNotFoundException
              Statement stmt = con.createStatement();
              stmt.executeUpdate("DELETE FROM Stocks WHERE "
                                    +"symbol = '"+stockSymbol+"'");
              stmt.close();
         // delete a record from the Users table
         public void delUser(User user) throws SQLException,IOException,ClassNotFoundException
              String dbUserID;
              String stockSymbol;
              Statement stmt = con.createStatement();
              try
                   con.setAutoCommit(false);
                   dbUserID = user.getUserID();
                   if(getUser(dbUserID) != null) // verify user exists in database
                        ResultSet rs1 = stmt.executeQuery("SELECT userID, symbol "
                                              +"FROM UserStocks WHERE userID = '"+dbUserID+"'");
                        while(rs1.next())
                             try
                                  stockSymbol = rs1.getString("symbol");
                                  delUserStocks(dbUserID, stockSymbol);
                             catch(SQLException ex)
                                  throw new SQLException("Deletion of user stock holding failed: " +ex.getMessage());
                        } // end of loop thru UserStocks
                        try
                        {  // holdings deleted, now delete user
                             stmt.executeUpdate("DELETE FROM Users WHERE "
                                              +"userID = '"+dbUserID+"'");
                        catch(SQLException ex)
                             throw new SQLException("User deletion failed: "+ex.getMessage());
                   else
                        throw new IOException("User not found in database - cannot delete.");
                   try
                        con.commit();
                   catch(SQLException ex)
                        throw new SQLException("Transaction commit failed: "+ex.getMessage());
              catch (SQLException ex)
                   try
                        con.rollback();
                   catch (SQLException sqx)
                        throw new SQLException("Transaction failed then rollback failed: " +sqx.getMessage());
                   // Transaction failed, was rolled back
                   throw new SQLException("Transaction failed; was rolled back: " +ex.getMessage());
              stmt.close();
         // delete a record from the UserStocks table
         public void delUserStocks(String userID, String stockSymbol) throws SQLException,IOException,ClassNotFoundException
              Statement stmt = con.createStatement();
              ResultSet rs;
              stmt.executeUpdate("DELETE FROM UserStocks WHERE "
                                    +"userID = '"+userID+"'"
                                    +"AND symbol = '"+stockSymbol+"'");
              rs = stmt.executeQuery("SELECT symbol FROM UserStocks "
                                         +"WHERE symbol = '"+stockSymbol+"'");
              if(!rs.next()) // no users have this stock
                   delStock(stockSymbol);
              stmt.close();
         // Methods for listing record data from a table
         // Ordered by:
         //          methods that obtain individual field(s),
         //          methods that obtain a complete record, and
         //          methods that obtain multiple records
         // Methods to access one or more individual fields
         // get a stock description from the Stocks table
         public String getStockDesc(String stockSymbol) throws SQLException, IOException, ClassNotFoundException
              Statement stmt = con.createStatement();
              String stockDesc = null;
              ResultSet rs = stmt.executeQuery("SELECT symbol, name FROM Stocks "
                                                      +"WHERE symbol = '"+stockSymbol+"'");
              if(rs.next())
                   stockDesc = rs.getString("name");
              rs.close();
              stmt.close();
              return stockDesc;
         // Methods to access a complete record
         // get User data from the Users table
         public User getUser(String userID) throws SQLException,IOException,ClassNotFoundException
              Statement stmt = con.createStatement();
              String dbUserID;
              String dbLastName;
              String dbFirstName;
              Password dbPswd;
              boolean isAdmin;
              byte[] buf = null;
              User user = null;
              ResultSet rs = stmt.executeQuery("SELECT * FROM Users WHERE userID = '" +userID+"'");
              if(rs.next())
                   dbUserID = rs.getString("userID");
                   dbLastName = rs.getString("lastName");
                   dbFirstName = rs.getString("firstName");
                   // Do NOT use with JDK 1.2.2 using JDBC-ODBC bridge as
                   // SQL NULL data value is not handled correctly.
                   buf = rs.getBytes("pswd");
                   dbPswd=(Password)deserializeObj(buf);
                   isAdmin = rs.getBoolean("admin");
                   user = new User(dbUserID,dbFirstName,dbLastName,dbPswd,isAdmin);
              rs.close();
              stmt.close();
              return user; // User object created for userID
         // Methods to access a list of records
         // get a list of selected fields for all records from the Users Table
         public ArrayList listUsers() throws SQLException,IOException,ClassNotFoundException
              ArrayList<String> aList = new ArrayList<String>();
              Statement stmt = con.createStatement();
              ResultSet rs = stmt.executeQuery("SELECT userID, firstName, lastName, admin "
                                                 +"FROM Users ORDER BY userID");
              while(rs.next())
                   aList.add(rs.getString("userID"));
                   aList.add(rs.getString("firstName"));
                   aList.add(rs.getString("lastName"));
                   aList.add(new Boolean(rs.getBoolean("admin")));
              rs.close();
              stmt.close();
              return aList;
         // get all fields in all records for a given user from the UserStocks table
         public ArrayList listUserStocks(String userID) throws SQLException, IOException, ClassNotFoundException
              ArrayList<String> aList = new ArrayList<String>();
              Statement stmt = con.createStatement();
              ResultSet rs = stmt.executeQuery("SELECT * FROM UserStocks "
                                                      +"WHERE userID = '"+userID+"' ORDER BY symbol");
              while(rs.next())
                   aList.add(rs.getString("symbol"));
              rs.close();
              stmt.close();
              return aList;
    }

  • Compilation error while calling static method from another class

    Hi,
    I am new to Java Programming. I have written two class files Dummy1 and Dummy2.java in the same package Test.
    In Dummy1.java I have declared a static final variable and a static method as you can see it below.
    package Test;
    import java.io.*;
    public class Dummy1
    public static final int var1= 10;
    public static int varDisp(int var2)
    return(var1+var2);
    This is program is compiling fine.
    I have called the static method varDisp from the class Dummy2 and it is as follows
    package Test;
    import java.io.*;
    public class Dummy2
    public int var3=15;
    public int test=0;
    test+=Dummy1.varDisp(var3);
    and when i compile Dummy2.java, there is a compilation error <identifier > expected.
    Please help me in this program.

    public class Dummy2
    public int var3=15;
    public int test=0;
    test+=Dummy1.varDisp(var3);
    }test+=Dummy1.varDisplay(var3);
    must be in a method, it cannot just be out somewhere in the class!

Maybe you are looking for

  • Query error

    Hello gurus,                     I am stuck with an issue. I can see the fields in the cube but i can't see the values in queries when i give multiple selection . But when i give single selection i get the value.Can any1 suggest me a remedy. Thanks a

  • Spotlight will not fully index PowerBook used in target disk mode

    I connected my PowerBook in target disk mode to my desktop to transfer files. Quickly added the PowerBook drive to the desktop's privacy list. After restarting the PowerBook, it started indexing, but said it was finished in less than 5 minutes (about

  • WBS element field in PO

    Hi All How can we make the WBS Element in ME22N transction in display mode. our purpose is user not to change the WBS element in ME22N Please give me solutions

  • Workflow not triggered when called within a Dynamic Trigger of HRMS

    Hello, Requeirment :Whenever any data is updated withing the People workbench of HRMS, a notification should be sent with the following message: Employee Number <Empno> has modified emailid from <old> to <new>. To achieve the same a dynamic trigger h

  • Elements won't let me start music at beginning of clips

    i am trying to make a slide show consisting of freeze frames. i want it to have music, so I added my music but pr.elements puts it about 7 seconds after the beginning of the clips. so there's 7 seconds of silence before the music starts. but when I t