Getting java code to compile on unix/linux

I have been using borland JBuilder to run and compile my java code. Recently i tried moving the code to a linux machine in which i have downloaded the JDK to. My classes only use standard java classes with the exception of a jbcl.jar file which has a class that one of my classes relies on. It turns out when i try to run my class i get error messages because it cant find the jar file. Where should I put this jar file? by the way in my class i use the statement: where jbcl.layout is the class i need.
import jbcl.layout.*;

another question. In my class I use the statement
import jbcl.layout.*;
so all i need to do is add the jbcl.jar to my class
path? is my import statement correctIf it compiles in your IDE, then it's correct. You shouldn't have to change anything at all in your source code to use a different compiler or to compile on a different platform. You just have set up the proper environment and parameters--tell it which .java files to compile, which jars or directories to search for classes in (classpath), etc. For IDEs you do that with the Preferences or Options menu item. For command line compilation you do this with command line arguments, config files (a la build.xml for ant), or environment variables (although relying on the CLASSPATH env var is generally a bad idea).

Similar Messages

  • How to track the information/error of java code while compiling.

    Hi,
    I want all the information or errors of java code during compilation.
    So that I can use this information or I can show these errors with different style.
    How to get the java syntax errors?

    Hi,
    I want all the information or errors of java code
    during compilation.
    So that I can use this information or I can show these
    errors with different style.
    How to get the java syntax errors?Redirect the STDOUT/STDERR from the the JAVA/JAVAC command to a file is one way...
    For instance at the commmand line:
    javac myClass.java > STDOUT.txt 2> STDERR.txt (Works for Unix variants or Windows OS's)
    Then you can do what ever you want with the data contained in the files.
    Hope this helps

  • Website to get java codes written

    Hi all,
    I know this might not be the most appropriate folder, but I'm looking at getting java code written. Does anyone know any websites where I can get this done for a good price and in a timely fashion?
    Thanks

    Stona,
    Stick to smokin' weed are surfin' dude, it's more fun.
    Seriously... Getting the friggin degree is the EASY part. Then you go get a job where you are expected to know what you are doing... and if you don't know what you're doing then you leave a trail of hoplessly failed projects, which costs some good people lots of money, and those people are likely to lose faith in IT professionals, which ultimately makes it harder for blokes like me to make a living.
    If you wanna cheat then go flog your dog elsewhere.
    Edited by: corlettk on 5/05/2008 07:33 - typos

  • How to specify a file path in java code to run on Unix machine?

    Hi
    I have a problem when running my project Swing on Unix machine.
    In my code, the user will press a button and then the program will look for the file "ReadMe" in the folder "Documentation" , and reads the content of this file. My code is "Documentation\\ReadMe" and it works well on PC. (The folder "Documentation" is in the same directory with my Java code).
    But when I try on Unix, the program can not read the file. It can only read the file "ReadMe" if I take this file and put it in the same directory with my Java code ( this means not through another folder). So how can we make it read the file in a folder ? It seems that "Documentation\\ReadMe" does not work in Unix, or the symbol "\\" does not work.
    I would be thankful if anybody can help me with this.
    Thank you very much

    You really shouldn't use any path method, as neither are very consistant or platform independent. The JVM provides a way to grab resources from the classpath. These resources can be any data at all, in fact, it's how java itself locates classes. Here's an example how you would do this in a non-static method.
    public URL getReadMe() {
      // In this context the forward slash is universal
      String docDirectory = "Documentation/"
      // We have to use the classloader to grab the resource
      ClassLoader cl = this.getClass().getClassLoader();
      // Next we get the resource 
      URL readMeURL = cl.getResource(docDirectory + "ReadMe");
      return readMeURL;
    }The URL can be used in whatever way you need to get the information out of the resource. If it was an image you might use the "Toolkit" to make an image object out of it. The great thing about this method is it will work even if your loading the program out of a Jar file. The resource paths start at the top of the classpath, just like classes.

  • Java code to connect to unix box(putty)

    i'm having a great problem regarding accessing the putty box from java code.
    I need to read some log files from unix through java code.In my client program when i'm giving hostname and port=22...ssh terminal is getting detected,but i'm confused how to open that unix box by giving the username and password.and how am i goin to embed unix command in it.The entire job i've to do through java code.
    please help!!..Thanks
    Message was edited by:
    liz310
    Message was edited by:
    liz310

    thanks a lot guys for ur time...but i tried in every way..i'm getting hell lot of errors..please help..its really urgent
    /*this is my code:*/
    import com.jcraft.jsch.*;
    import com.jcraft.jsch.Channel;
    import com.jcraft.jsch.JSch;
    import com.jcraft.jsch.JSchException;
    import com.jcraft.jsch.Session;
    import com.jcraft.jsch.UserInfo;
    import java.io.*;
    public class shell_test {
    public static void main(String args[])
    String user="user15";
    String host="punlin040";
    String cmd="ls -l";
    JSch jsch = new JSch();
    try{
    Session session=jsch.getSession(user,host,22);
    session.setPassword("user15");
    //UserInfo usrInfo=new MyUserInfo();
    //session.setUserInfo(usrInfo);
    session.connect();
    Channel channel=session.openChannel("exec");
    ((ChannelExec) channel).setCommand(cmd);
    channel.setXForwarding(true);
    channel.connect();
    //code
    channel.setInputStream(System.in);
    // channel.setOutputStream(System.out);
    //((ChannelExec) channel).setErrStream(System.err);
    InputStream in = channel.getInputStream();
    channel.connect();
    byte[] tmp = new byte[1024];
    while (true)
    while (in.available() > 0)
    int i = in.read(tmp, 0, 1024);
    if (i < 0)
    break;
    System.out.print(new String(tmp, 0, i));
    if (channel.isClosed())
    in.close();
    // System.out.println("JSCH: exit-status: " +
    //channel.getExitStatus());
    break;
    try
    Thread.sleep(1000);
    catch (Exception ee)
    channel.disconnect();
    session.disconnect();
    //code
    //ch.setInputStream(System.in);
    //ch.setOutputStream(System.out);
    }catch(Exception e)
    {e.printStackTrace(); }
    /*public static class MyUserInfo implements UserInfo {
    public String getPassword()
    { return "password"; }
    public String getPassphrase()
    { return ""; }
    public boolean promptPassword(String arg0)
    { return true; }
    public boolean promptPassphrase(String arg0)
    { return true; }
    public boolean promptYesNo(String arg0)
    { return true; }
    public void showMessage(String arg0)
    but i'm getting following errors:
    com.jcraft.jsch.JSchException: java.lang.ClassNotFoundException: com.jcraft.jsch
    .jce.Random
    at com.jcraft.jsch.Session.connect(Session.java:160)
    at com.jcraft.jsch.Session.connect(Session.java:145)
    at shell_test.main(shell_test.java:25)
    Caused by: java.lang.ClassNotFoundException: com.jcraft.jsch.jce.Random
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at com.jcraft.jsch.Session.connect(Session.java:156)
    ... 2 more

  • Java App Deploy Axis in Unix/Linux OS to call an external WService

    Hi!
    I would really appreciate some help in this matter.
    I'm developing an application in Java to call a remote .Net Web Service from probably Unix/Linux/Windows 2000/2003 Operating System.
    My question for you is, what requirements do I need to install before I'm able to call a remote web service from Unix/Linux?
    I would like to keep things as simple as possible. The less software I install the better.
    I'm also considering in using c++ instead of Java if the solution is more simpler.
    Thanks

    I reply to myself, if there's someone interested....
    So far, I' ve found 3 ways to approach this issue:
    1) OpenSSH:
    Install an OpenSSH server on WIN side.
    On LINUX side, write a script that opens an OpenSSH transaction and then call the executable; this script is what I call from Runtime.getRuntime().exec()This way, the executable is executed on WIN.
    2) Wine (Windows emulator for LINUX)
    Install WINE on LINUX side.
    Make the executable reachable from LINUX to WIN side (copy/paste or mount the folder) and call Runtime.getRuntime.exec("wine MYEXE.EXE").
    This way, the executable is executed on LINUX (you need to make all DLLs reachable)
    3) RMI
    Write a RMI server as "exe invoker" and deploy it on WIN side.
    Then, replace the portion of code that calls the executable with an RMI client that invoke the RMI server.
    This way, the executable is executed on WIN.
    Finally, I chose this third way.

  • Urget Help --- Please give me the core java code that connects to UNIX ser

    Can anyone provide the core java code that connects UNIX server after verifying credentials and allow to implements UNIX commands through java program?

    no, you don't want to do that.
    You want to connect yourself, which Java is quite capable of doing, rather than go through some 3rd party client program that's not only specific to a particular operating system but not guaranteed to be installed at any particular machine or if it is to be installed in such a way that you can start it from your Java program.
    And then there's the little matter of figuring out the external API to use that program in the way you intent to (if it has one).

  • Can't get Java to to compile programs.

    Ok, here are the things I have done:
    1) Downloaded Jsdk 1.3 and installed the package.
    2) Set the classpath and path:
    @ECHO OFF
    PROMPT $P$G
    SET PATH=%PATH%;%JAVAHOME%\BIN
    PATH=c:\windows;c:\windows\COMMAND;C:\JDK1.3\BIN
    SET CLASSPATH=.;C:\jdk1.3\lib\tools.jar,%CLASSPATH%
    3) made a source file
    4) Went into MS-Dos and then into the corect directory where the source file is.
    5) I then tried to compile the source file with the "javac" command, but all I get is this "bad command or file name."
    What am I doing wrong? I already uninstalled and reinstalled 1.3 sdk and still no luck. I keep getting "bad command or file name" error. I tried to compile the program on a different computer with the same path and classpath and it worked fine.

    Make sure that JDK is installed in C:\jdk1.3
    Change this:
    SET PATH=%PATH%;%JAVAHOME%\BIN
    to:
    SET PATH=%PATH%;C:\jdk1.3\BIN
    Or set JAVAHOME that you seem to be using to set the path:
    SET JAVAHOME=C:\jdk1.3
    SET PATH=%PATH%;%JAVAHOME%\BIN

  • Can java code be compiled as an o. file and how?

    Some langyages produce o. files during the compiling process. Can Java do that?

    Some langyages produce o. files during the compiling
    process. Can Java do that?No, the Java compiler produces .class files. .o files contain binary
    date to be natively linked into an executable. .class files are loaded by
    the JVM and run by it.
    kind regards,
    Jos

  • How to get return code of compiling a package

    Hi,
    i want to compile a package and if it was not succesfull to write the error_message from "show errors" into a file.
    thx
    Wolle

    the problem with compiling individual packages is that you might inadvertently invalidate others. you should also programmatically check package dependencies too so you dont break any accidentally.
    if you're only compiling package bodies, this shouldn't be an issue, but if youre also compiling specs, this is something you should keep an eye on.
    i wrote an application that uploads new packages i commit in cvs to our database and then recompiles them. it then reports whether or not compilation was successful. this helps eliminate alot of user error when people manually recompile packages in HA environments. however, i recompile the entire schema when i do this (this is not something run very often). i can get away with this at my shop because the schema is very small, but this might not be a practical solution for everyone.
    this is how i check for dependencies:
    FROM public_dependency pd, user_objects uo
    WHERE referenced_object_id IN (select object_id from user_objects where object_name= UPPER(?))
    AND uo.object_id = pd.object_id
    this is useful for saving a snapshot of current package (in case of reversion):
    SELECT TEXT FROM USER_SOURCE WHERE NAME = ?
    this is how you can recompile the schema:
    DBMS_UTILITY.COMPILE_SCHEMA(?, TRUE, TRUE);
    i do a check for invalid objects in the schema before i even start (And exit with error if any are found) :
    SELECT OBJECT_NAME, STATUS
    FROM USER_OBJECTS
    WHERE (OBJECT_TYPE='PACKAGE' OR OBJECT_TYPE='PACKAGE BODY')
    AND STATUS <> 'VALID'
    Hope this info helps.
    Edited by: user577162 on Aug 25, 2008 2:21 PM

  • Getting java to compile

    I just downloaded the j2ee SDK and am hoping to compile some simple java applets. HOwever, I am having difficulty either finding an appropriate FAQ or getting some code to compile.
    When I type in javac on the command line (in windows xp) it brings back "javac is not recognized as an internal or external command"
    I tried creating under system properties / advanced/ environment variables/ a system variable called java with the path c:\Program Files\java\jdk1.5.0_04\bin but this did not solve it.
    Any pointers to a FAQ, the correct forum to post this to, or any other info would be greatly appreciated.
    Thanks,
    SQLFriend

    The problem seems to be that 'javac' is not in the PATH.
    You will need to add c:\Program Files\java\jdk1.5.0_04\bin to the PATH variable, as specified in http://java.sun.com/j2se/1.4.2/install-windows.html#Environment.
    Ref:
    http://java.sun.com/docs/books/tutorial/getStarted/cupojava/win32.html
    Also, for questions on java, javaforums are available at:
    http://forum.java.sun.com/index.jspa

  • Problem when connecting locally to Oracle Database 10g from Java code

    Good afternoon,
    I try to connect to my local Oracle 10g from JAVA code. Could somebody tells me what are the 'values' to enter in place of 'value1, value2, value3' in the following:
    final String connectionURLThin = "jdbc:oracle:thin:@value1:value2:value3";
    I tried to put my 'user' and 'pw' credentials I used when connecting with SQL*PLUS:
    value1=my_user_name
    value2=my_pw
    value3=my_schema
    but it doest work. Besides where could have I to put the 'WORKSPACE" name?
    Thanks for any help.
    Claude
    Details:
    ERR MESSAGE----------------------
    Exception in thread "main" java.lang.NoClassDefFoundError: oracle/dms/instrument/ExecutionContextForJDBC
    at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:365)
    at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
    at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:854)
    at java.sql.DriverManager.getConnection(DriverManager.java:620)
    at java.sql.DriverManager.getConnection(DriverManager.java:200)
    at javaapplication6.ConnectionExample.driverManager(ConnectionExample.java:138)
    at javaapplication6.Main.main(Main.java:36)
    Caused by: java.lang.ClassNotFoundException: oracle.dms.instrument.ExecutionContextForJDBC
    at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:319)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:264)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:332)
    ... 8 more
    Java Result: 1
    BUILD SUCCESSFUL (total time: 0 seconds)
    ---------------------ERR MESSAGE
    JAVA code------------------it compiles but throw an error when running there -> (*)...
    final String driverClass = "oracle.jdbc.driver.OracleDriver";
    final String connectionURLThin = "jdbc:oracle:thin:@jeffreyh3:1521:CUSTDB";
    final String userID = "scott";
    final String userPassword = "tiger";
    final String queryString = "SELECT" +
    " user " +
    " , TO_CHAR(sysdate, 'DD-MON-YYYY HH24:MI:SS') " +
    "FROM dual";
    public void driverManager() {
    Connection con = null;
    Statement stmt = null;
    ResultSet rset = null;
    try {
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    con = DriverManager.getConnection(connectionURLThin, userID, userPassword); // (*) prob here
    stmt = con.createStatement ();
    rset = stmt.executeQuery(queryString);
    rset.close();
    stmt.close();
    } catch (SQLException e) {e.printStackTrace();
    --------------------JAVA JDK 1.6
    My system ------------------------
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    PL/SQL Release 10.2.0.1.0 - Production
    CORE 10.2.0.1.0 Production
    TNS for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production

    Yes, the network connection could not be established. Like the error said.
    What you're asking about is the exact reason, but that could be any number of things and not at all related to code. You could have the wrong host, the wrong port. A firewall could be blocking the outgoing connection, a firewall could be blocking the incoming connection. Etc. etc.

  • Java code in jsp source files is not allowed in ojsp.next mode.

    Hi,
    I’m working on WC Spaces Customization library “com.acme.custom.webcenter.spaces.war”. From time to time, when I deploy the library to WC Server, it errors out.
    weblogic.management.DeploymentException: Cannot undeploy library Extension-Name: com.acme.custom.webcenter.spaces, Specification-Version: 11.1.1, Implementation-Version: 11.1.1.2.113 from server WC_Spaces, because the following deployed applications reference it: webcenter-rest.war, spaces.war, sharepoint-servlet.war, webcenter-rss.war
    If I try to login the Spaces, I get “Java code in jsp source files is not allowed in ojsp.next mode.” Should I stop the Spaces server before the deployment? In this case, other people won’t have accesses to Spaces? The deployment error doesn’t happen all the time.
    oracle.jsp.parse.JavaCodeException: Line # 6, oracle.jsp.parse.JspParseTagScriptlet@5b9864ca
    Error: Java code in jsp source files is not allowed in ojsp.next mode.
    at oracle.jsp.parse.JspParseTagCore.createNode(JspParseTagCore.java:263)
    at oracle.jsp.parse.JspUtils.createChildNodes(JspUtils.java:2489)
    at oracle.jsp.parse.JspParseTagFile.createTree(JspParseTagFile.java:475)
    at oracle.jsp.parse.OracleJsp2Java.transformImpl(OracleJsp2Java.java:535)
    at oracle.jsp.parse.OracleJsp2Java.transform(OracleJsp2Java.java:593)
    at oracle.jsp.runtimev2.JspPageCompiler.attemptCompilePage(JspPageCompiler.java:691)
    at oracle.jsp.runtimev2.JspPageCompiler.compileBothModes(JspPageCompiler.java:490)
    at oracle.jsp.runtimev2.JspPageCompiler.parseAndGetTreeNode(JspPageCompiler.java:457)
    at oracle.jsp.runtimev2.JspPageInfo.compileAndLoad(JspPageInfo.java:624)
    at oracle.jsp.runtimev2.JspPageTable.compileAndServe(JspPageTable.java:645)
    at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:385)
    at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:802)
    at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:726)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    Buildfile: C:\JDeveloper\mywork\LamwWebCenterSpacesExtensions\WebCenterSpacesSharedLibExtension\build.xml
    =======
    init-wls:
    deploy-shared-lib:
    [echo] ----------------------------
    [echo] C:\JDeveloper\mywork\myuserconfigfile.secure C:\JDeveloper\mywork\myuserkeyfile.secure claptd01:7001 C:\JDeveloper\mywork\XxxWebCenterSpacesExtensions/WebCenterSpacesSharedLibExtension/deploy/exploded WC_Spaces com.acme.custom.webcenter.spaces
    [exec]
    [exec] CLASSPATH=C:\oracle\MIDDLE~1.5\patch_wls1035\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\oracle\MIDDLE~1.5\patch_jdev1111\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\oracle\MIDDLE~1.5\JDK160~1\lib\tools.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\lib\weblogic_sp.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\lib\weblogic.jar;C:\oracle\MIDDLE~1.5\modules\features\weblogic.server.modules_10.3.5.0.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\lib\webservices.jar;C:\oracle\MIDDLE~1.5\modules\ORGAPA~1.1/lib/ant-all.jar;C:\oracle\MIDDLE~1.5\modules\NETSFA~1.0_1/lib/ant-contrib.jar;.;%JAVA_HOME\jre\lib;C:\Apache\apache-cxf\lib;C:\Apache\apache-cxf\lib\cxf-manifest.jar;.\build\classes;C:\Program Files\Java\jre6\lib\ext\QTJava.zip;C:\oracle\MIDDLE~1.5\ORACLE~1/modules/oracle.jrf_11.1.1/jrf-wlstman.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\lib\ADF-SH~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\lib\ADFSCR~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\lib\mdswlst.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\AUDITW~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\IGFWLS~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\jps-wlst.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\jrf-wlst.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\OAMAP_~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\OAMAUT~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\ossoiap.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\OSSOIA~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\OVDWLS~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\SSLCON~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\wsm-wlst.jar
    [exec]
    [exec] PATH=C:\oracle\MIDDLE~1.5\patch_wls1035\profiles\default\native;C:\oracle\MIDDLE~1.5\patch_jdev1111\profiles\default\native;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\native\win\32;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\bin;C:\oracle\MIDDLE~1.5\modules\ORGAPA~1.1\bin;C:\oracle\MIDDLE~1.5\JDK160~1\jre\bin;C:\oracle\MIDDLE~1.5\JDK160~1\bin;C:\Program Files\PHP52\;C:\Program Files\Common Files\OTG;C:\oracle\product\10.2.0\client_1\bin;C:\oracle\ora_adi\bin;C:\PROGRA~1\REFLEC~1;C:\Program Files\Reflection;C:\Program Files\Oracle\jre\1.1.8\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;E:\MSSQL7\BINN;C:\Program Files\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Common Files\Roxio Shared\DLLShared\;C:\Program Files\ATI Technologies\ATI.ACE\;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;C:\Program Files\Microsoft SQL Server\80\Tools\Binn\;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\glassfish3\jdk\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Vim\vim73;c:\apache\ant\bin;c:\jboss\bin;C:\Apache\apache-cxf\bin;C:\glassfish\bin;C:\Program Files\QuickTime\QTSystem\;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\native\win\32\oci920_8
    [exec]
    [exec] Your environment has been set.
    [exec]
    [exec] CLASSPATH=C:\oracle\MIDDLE~1.5\patch_wls1035\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\oracle\MIDDLE~1.5\patch_jdev1111\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\oracle\MIDDLE~1.5\JDK160~1\lib\tools.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\lib\weblogic_sp.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\lib\weblogic.jar;C:\oracle\MIDDLE~1.5\modules\features\weblogic.server.modules_10.3.5.0.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\lib\webservices.jar;C:\oracle\MIDDLE~1.5\modules\ORGAPA~1.1/lib/ant-all.jar;C:\oracle\MIDDLE~1.5\modules\NETSFA~1.0_1/lib/ant-contrib.jar;.;%JAVA_HOME\jre\lib;C:\Apache\apache-cxf\lib;C:\Apache\apache-cxf\lib\cxf-manifest.jar;.\build\classes;C:\Program Files\Java\jre6\lib\ext\QTJava.zip;C:\oracle\MIDDLE~1.5\ORACLE~1/modules/oracle.jrf_11.1.1/jrf-wlstman.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\lib\ADF-SH~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\lib\ADFSCR~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\lib\mdswlst.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\AUDITW~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\IGFWLS~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\jps-wlst.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\jrf-wlst.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\OAMAP_~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\OAMAUT~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\ossoiap.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\OSSOIA~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\OVDWLS~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\SSLCON~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\wsm-wlst.jar;C:\oracle\MIDDLE~1.5\utils\config\10.3\config-launch.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\common\derby\lib\derbynet.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\common\derby\lib\derbyclient.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\common\derby\lib\derbytools.jar;;
    [exec]
    [exec] Initializing WebLogic Scripting Tool (WLST) ...
    [exec]
    [exec] Welcome to WebLogic Server Administration Scripting Shell
    [exec]
    [exec] Type help() for help on available commands
    [exec]
    [exec]
    [exec] Deploy started at Wed Mar 28 12:25:08 2012
    [exec]
    [exec] Connecting to t3://claptd01:7001 with userid weblogic ...
    [exec] Successfully connected to Admin Server 'AdminServer' that belongs to domain 'base_domain'.
    [exec]
    [exec] Warning: An insecure protocol was used to connect to the
    [exec] server. To ensure on-the-wire security, the SSL port or
    [exec] Admin port should be used instead.
    [exec]
    [exec] Location changed to edit tree. This is a writable tree with
    [exec] DomainMBean as the root. To make changes you will need to start
    [exec] an edit session via startEdit().
    [exec]
    [exec] For more help, use help(edit)
    [exec] You already have an edit session in progress and hence WLST will
    [exec] continue with your edit session.
    [exec]
    [exec] Starting an edit session ...
    [exec] Started edit session, please be sure to save and activate your
    [exec] changes once you are done.
    [exec] Deploying application from C:\JDeveloper\mywork\XxxWebCenterSpacesExtensions\WebCenterSpacesSharedLibExtension\deploy\exploded\com.acme.custom.webcenter.spaces.war to targets WC_Spaces (upload=true) ...
    [exec] <Mar 28, 2012 12:25:10 PM EDT> <Info> <J2EE Deployment SPI> <BEA-260121> <Initiating deploy operation for application, com.acme.custom.webcenter.spaces [archive: C:\JDeveloper\mywork\XxxWebCenterSpacesExtensions\WebCenterSpacesSharedLibExtension\deploy\exploded\com.acme.custom.webcenter.spaces.war], to WC_Spaces .>
    [exec] You have an edit session in progress, hence WLST will not
    [exec] block for your deployment to complete.
    [exec] Started the Deployment of Application. Please refer to the returned WLSTProgress object or variable LAST to track the status.
    [exec]
    [exec] ### ### ###: Deploy done
    [exec]
    [exec] 0
    [exec]
    [exec] ### ### ###: Status of Deploy
    [exec]
    [exec] Current Status of your Deployment:
    [exec] Deployment command type: deploy
    [exec] Deployment State : running
    [exec] Deployment Message : [Deployer:149140]The task cannot be processed further until the current edit session is activated. When this occurs, task processing will continue. The user can exit the deployer tool without affecting the task.
    [exec]
    [exec]
    [exec] ### ### ###: Saving
    [exec]
    [exec] Saving all your changes ...
    [exec] Saved all your changes successfully.
    [exec]
    [exec] ### ### ###: Activating
    [exec]
    [exec] Activating all your changes, this may take a while ...
    [exec] The edit lock associated with this edit session is released
    [exec] once the activation is completed.
    [exec] This Exception occurred at Wed Mar 28 12:25:18 EDT 2012.
    [exec] weblogic.management.DeploymentException: Cannot undeploy library Extension-Name: com.acme.custom.webcenter.spaces, Specification-Version: 11.1.1, Implementation-Version: 11.1.1.2.113 from server WC_Spaces, because the following deployed applications reference it: webcenter-rest.war, spaces.war, sharepoint-servlet.war, webcenter-rss.war
    [exec]      at weblogic.deploy.event.DeploymentEventManager.sendVetoableDeploymentEvent(DeploymentEventManager.java:337)
    [exec]      at weblogic.deploy.internal.targetserver.operations.AbstractOperation.fireVetoableDeploymentEvent(AbstractOperation.java:781)
    [exec]      at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:216)
    [exec]      at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:747)
    [exec]      at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1216)
    [exec]      at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:250)
    [exec]      at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159)
    [exec]      at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:171)
    [exec]      at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:13)
    [exec]      at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:46)
    [exec]      at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
    [exec]      at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    [exec]      at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    [exec] Caused by: weblogic.deploy.event.DeploymentVetoException: Cannot undeploy library Extension-Name: com.acme.custom.webcenter.spaces, Specification-Version: 11.1.1, Implementation-Version: 11.1.1.2.113 from server WC_Spaces, because the following deployed applications reference it: webcenter-rest.war, spaces.war, sharepoint-servlet.war, webcenter-rss.war
    [exec]      at weblogic.application.library.LibraryDeploymentListener.verifyLibrary(LibraryDeploymentListener.java:123)
    [exec]      at weblogic.application.library.LibraryDeploymentListener.vetoableApplicationActivate(LibraryDeploymentListener.java:58)
    [exec]      at weblogic.application.library.LibraryDeploymentListener.vetoableApplicationDeploy(LibraryDeploymentListener.java:64)
    [exec]      at weblogic.deploy.event.VetoableDeploymentEvent$2.notifyListener(VetoableDeploymentEvent.java:70)
    [exec]      at weblogic.deploy.event.DeploymentEventManager.sendVetoableDeploymentEvent(DeploymentEventManager.java:335)
    [exec] None
    [exec] #########################################################
    [exec] ##### Deployment Failed #########
    [exec] ##### Contact support with Exception Stack #########
    [exec] #########################################################
    [exec]
    [exec]
    [exec] Exiting WebLogic Scripting Tool.
    [exec]
    [exec] <Mar 28, 2012 12:25:18 PM EDT> <Warning> <JNDI> <BEA-050001> <WLContext.close() was called in a different thread than the one in which it was created.>
    [echo] ----------------------------
    [echo] Restarting the app
    [echo] ----------------------------
    [exec]
    [exec] CLASSPATH=C:\oracle\MIDDLE~1.5\patch_wls1035\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\oracle\MIDDLE~1.5\patch_jdev1111\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\oracle\MIDDLE~1.5\JDK160~1\lib\tools.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\lib\weblogic_sp.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\lib\weblogic.jar;C:\oracle\MIDDLE~1.5\modules\features\weblogic.server.modules_10.3.5.0.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\lib\webservices.jar;C:\oracle\MIDDLE~1.5\modules\ORGAPA~1.1/lib/ant-all.jar;C:\oracle\MIDDLE~1.5\modules\NETSFA~1.0_1/lib/ant-contrib.jar;.;%JAVA_HOME\jre\lib;C:\Apache\apache-cxf\lib;C:\Apache\apache-cxf\lib\cxf-manifest.jar;.\build\classes;C:\Program Files\Java\jre6\lib\ext\QTJava.zip;C:\oracle\MIDDLE~1.5\ORACLE~1/modules/oracle.jrf_11.1.1/jrf-wlstman.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\lib\ADF-SH~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\lib\ADFSCR~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\lib\mdswlst.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\AUDITW~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\IGFWLS~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\jps-wlst.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\jrf-wlst.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\OAMAP_~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\OAMAUT~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\ossoiap.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\OSSOIA~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\OVDWLS~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\SSLCON~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\wsm-wlst.jar
    [exec]
    [exec] PATH=C:\oracle\MIDDLE~1.5\patch_wls1035\profiles\default\native;C:\oracle\MIDDLE~1.5\patch_jdev1111\profiles\default\native;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\native\win\32;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\bin;C:\oracle\MIDDLE~1.5\modules\ORGAPA~1.1\bin;C:\oracle\MIDDLE~1.5\JDK160~1\jre\bin;C:\oracle\MIDDLE~1.5\JDK160~1\bin;C:\Program Files\PHP52\;C:\Program Files\Common Files\OTG;C:\oracle\product\10.2.0\client_1\bin;C:\oracle\ora_adi\bin;C:\PROGRA~1\REFLEC~1;C:\Program Files\Reflection;C:\Program Files\Oracle\jre\1.1.8\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;E:\MSSQL7\BINN;C:\Program Files\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Common Files\Roxio Shared\DLLShared\;C:\Program Files\ATI Technologies\ATI.ACE\;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;C:\Program Files\Microsoft SQL Server\80\Tools\Binn\;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\glassfish3\jdk\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Vim\vim73;c:\apache\ant\bin;c:\jboss\bin;C:\Apache\apache-cxf\bin;C:\glassfish\bin;C:\Program Files\QuickTime\QTSystem\;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\native\win\32\oci920_8
    [exec]
    [exec] Your environment has been set.
    [exec]
    [exec] CLASSPATH=C:\oracle\MIDDLE~1.5\patch_wls1035\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\oracle\MIDDLE~1.5\patch_jdev1111\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\oracle\MIDDLE~1.5\JDK160~1\lib\tools.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\lib\weblogic_sp.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\lib\weblogic.jar;C:\oracle\MIDDLE~1.5\modules\features\weblogic.server.modules_10.3.5.0.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\server\lib\webservices.jar;C:\oracle\MIDDLE~1.5\modules\ORGAPA~1.1/lib/ant-all.jar;C:\oracle\MIDDLE~1.5\modules\NETSFA~1.0_1/lib/ant-contrib.jar;.;%JAVA_HOME\jre\lib;C:\Apache\apache-cxf\lib;C:\Apache\apache-cxf\lib\cxf-manifest.jar;.\build\classes;C:\Program Files\Java\jre6\lib\ext\QTJava.zip;C:\oracle\MIDDLE~1.5\ORACLE~1/modules/oracle.jrf_11.1.1/jrf-wlstman.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\lib\ADF-SH~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\lib\ADFSCR~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\lib\mdswlst.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\AUDITW~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\IGFWLS~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\jps-wlst.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\jrf-wlst.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\OAMAP_~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\OAMAUT~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\ossoiap.jar;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\OSSOIA~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\OVDWLS~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\SSLCON~1.JAR;C:\oracle\MIDDLE~1.5\ORACLE~1\common\wlst\RESOUR~1\wsm-wlst.jar;C:\oracle\MIDDLE~1.5\utils\config\10.3\config-launch.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\common\derby\lib\derbynet.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\common\derby\lib\derbyclient.jar;C:\oracle\MIDDLE~1.5\WLSERV~1.3\common\derby\lib\derbytools.jar;;
    [exec]
    [exec] Initializing WebLogic Scripting Tool (WLST) ...
    [exec]
    [exec] Welcome to WebLogic Server Administration Scripting Shell
    [exec]
    [exec] Type help() for help on available commands
    [exec]
    [exec]
    [exec] Redeploy of Spaces Application started at Wed Mar 28 12:25:21 2012
    [exec]
    [exec] Connecting to t3://claptd01:7001 with userid weblogic ...
    [exec] Successfully connected to Admin Server 'AdminServer' that belongs to domain 'base_domain'.
    [exec]
    [exec] Warning: An insecure protocol was used to connect to the
    [exec] server. To ensure on-the-wire security, the SSL port or
    [exec] Admin port should be used instead.
    [exec]
    [exec] Redeploying application webcenter ...
    [exec] <Mar 28, 2012 12:25:28 PM EDT> <Info> <J2EE Deployment SPI> <BEA-260121> <Initiating redeploy operation for application, webcenter#11.1.1.4.0 [archive: null], to WC_Spaces .>
    [exec] [Deployer:149140]The task cannot be processed further until the current edit session is activated. When this occurs, task processing will continue. The user can exit the deployer tool without affecting the task.
    [exec] ..........................................Failed to redeploy the application with status failed
    [exec] Current Status of your Deployment:
    [exec] Deployment command type: redeploy
    [exec] Deployment State : failed
    [exec] Deployment Message : java.lang.Exception: [DeploymentService:290036]Deployment for request id '1332951945158' is deferred since target 'WC_Spaces' is disconnected.
    [exec] No stack trace available.
    [exec] None
    [exec] #########################################################
    [exec] ##### ReDeploy Spaces Failed #########
    [exec] ##### Contact support with Exception Stack #########
    [exec] #########################################################
    [exec]
    [exec]
    [exec] Exiting WebLogic Scripting Tool.
    [exec]
    [exec] <Mar 28, 2012 12:27:34 PM EDT> <Warning> <JNDI> <BEA-050001> <WLContext.close() was called in a different thread than the one in which it was created.>
    BUILD SUCCESSFUL
    Total time: 2 minutes 31 seconds
    Edited by: 891549 on Mar 29, 2012 12:01 PM

    I don't think that this error is based on ojsp.next mode. The first error I see is that the application can't be undeployed. After that you get the 'ava code in jsp source files is not allowed in ojsp.next mode.' error. As you said this only happens sometimes which also point to an other problem and not to the jsp error.
    Have you ask this on the {forum:id=354} forum?
    For me it's more a deployment/redeployment question.
    Timo

  • Where to apply java codes?

    Good Day:
    Perhaps this sound funny....I bought a Java book to learn the coding...pretty interesting...but after all, it didn't tell where can I type and test all those codes.
    After much reading, understand that it should be applied onto the JDK. Am I right? so I went to Java site and downloaded it. But nothing happened? I even borrow some other machine to install the JDK, still the same????
    When I check form control panel, the JDK and JRE successfully install. Pls help. After all, I need to start on where can i test my java codes?
    Many thanks for your reply.

    hellbinder, my apology...i guess you and everyone
    confuse with my question.
    Ok, see, what I need is to type in the code as per
    given in the book i bought. I understand that it got
    to be typing in the JDK in order to be able to test
    it out. So I download the JDK (including JRE & IDE)
    and had it install on my pc. Then now, I still could
    find the JDK (what I think/mean the "text editor"
    here) for me to type in the java codes.
    Or shall I re-phare in in suce, let's imagine, if
    given with a stack of words and fonts, we type in
    note pad may be. then now given with the Java codes,
    where shall i type it? JDK right? thus I installed
    JDK but I couldn't find or launch it to type in those
    Java codes?!
    Thanks!You don't "type in the java codes" in your JDK. You use a texteditor to "type in the java codes" and compile "the java codes" with the compiler from your JDK, and after that you run "the java (byte)codes" with the JRE from your JDK.
    Everything is explained step-by-step in the tutorial I posted earlier. Please take the time to follow those steps.

  • How to compile connection pool sample java code

    I recently bought David Knox's "Effective Oracle Database 10g Security by Design", and have been working through his examples with client identifiers and how to leverage database security with anonymous connection pools.
    The database side of things I totally understand and have set up, but I now want to compile/run the java code examples, but don't know what is required to compile this.
    I'm running Oracle 10.2.0.4 (64-bit) Enterprise Edition on a Linux (RHEL 5) PC. Java version is 1.6.0_20. Relevant .bash_profile environment variables are as follows:
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
    export CLASSPATH=$ORACLE_HOME/jre:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
    export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin
    When I try to compile, I get:
    oracle:DB10204$ java FastConnect.java
    Exception in thread "main" java.lang.NoClassDefFoundError: FastConnect/java
    Caused by: java.lang.ClassNotFoundException: FastConnect.java
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    Could not find the main class: FastConnect.java. Program will exit.
    The java source code of one of the examples is below. Is someone able to point me in the right direction as to how I get this to compile? Do I just have a syntax and/or environment configuration modification to do, or is there more to it than that to get this example working? Any help much appreciated.
    oracle:DB10204$   cat FastConnect.java
    package OSBD;
    import java.sql.*;
    import oracle.jdbc.pool.OracleDataSource;
    public class FastConnect
      public static void main(String[] args)
        long connectTime=0, connectionStart=0, connectionStop=0;
        long connectTime2=0, connectionStart2=0, connectionStop2=0;
        ConnMgr cm = new ConnMgr();
        // time first connection. This connection initializes pool.
        connectionStart = System.currentTimeMillis();
        Connection conn = cm.getConnection("SCOTT");
        connectionStop = System.currentTimeMillis();
        String query = "select ename, job, sal from person_view";
        try {
          // show security by querying from View
          Statement stmt = conn.createStatement();
          ResultSet rset = stmt.executeQuery(query);
          while (rset.next()) {
            System.out.println("Name:   " + rset.getString(1));
            System.out.println("Job:    " + rset.getString(2));
            System.out.println("Salary: " + rset.getString(3));
          stmt.close();
          rset.close();
          // close the connection which resets the database session
          cm.closeConnection(conn);
          // time subsequent connection as different user
          connectionStart2 = System.currentTimeMillis();
          conn = cm.getConnection("KING");
          connectionStop2 = System.currentTimeMillis();
          // ensure database can distinguish this new user
          stmt = conn.createStatement();
          rset = stmt.executeQuery(query);
          while (rset.next()) {
            System.out.println("Name:   " + rset.getString(1));
            System.out.println("Job:    " + rset.getString(2));
            System.out.println("Salary: " + rset.getString(3));
          stmt.close();
          rset.close();
          cm.closeConnection(conn);
        } catch (Exception e)    { System.out.println(e.toString()); }
        // print timing results
        connectTime = (connectionStop - connectionStart);
        System.out.println("Connection time for Pool: " + connectTime + " ms.");
        connectTime2 = (connectionStop2 - connectionStart2);
        System.out.println("Subsequent connection time: " +
                            connectTime2 + " ms.");
    }Code download is at: http://www.mhprofessional.com/getpage.php?c=oraclepress_downloads.php&cat=4222
    I'm looking at Chapter 6.

    stuartu wrote:
    When I try to compile, I get:
    oracle:DB10204$  java FastConnect.java
    Exception in thread "main" java.lang.NoClassDefFoundError: FastConnect/java
    Caused by: java.lang.ClassNotFoundException: FastConnect.java
    I will try to explain what is happening here.
    You are launching java telling it to run a class named 'java' in a package named 'FastConnect'
    and java says it cannot find that class.
    What you intended to do:
    $ # make the directory structure match the package structure
    $ mkdir OSBD
    $ # move the source file in the directory structure so it matches the package structure
    $ mv FastConnect.java OSBD/
    $ # compile OSBD/FastConnect.java to OSBD/FastConnect.class
    $ javac OSBD/FastConnect.java
    $ # launch java using the OSBD/FastConnect class
    $ java -cp . OSBD.FastConnectNote that the package 'OSBD' does not follow the recommended naming conventions
    you might consider changing that to 'osbd'.

Maybe you are looking for

  • How update area field when geometry is updated

    hi all, plz can someone help me to find solution or give me a way to solve my problem i would like to create procedure to recalculate the area of geom and insert it the value in the specified field when the geom is updated. I try 2 methods but no one

  • Unknown error (-45054) won't let me spend!

    Does anyone know what "We could not complete your iTunes Store request. An unknown error occurred (-45054)" actually means - and how I go about resolving I'm trying to make a purchase and this error is making me save my money!

  • New imac, lightroom and cs3 can't read NEF files?  What to do

    Adobe support is down so I am here for help from all of you. I don't have a clue what bridge is or whether I need to use both bridge and Lightroom. Anyway, I will be importing nef files from a D300 to an external drive onsite with a windows xp pro la

  • FATAL ERROR in native method: Wrong Method ID

    I have a piece of C code from which I am trying to launch a piece of Java, but I am having severe problems just trying to get a simple integer value returned from any Java function. I keep getting the error message "FATAL ERROR in native method: Wron

  • I can't open safari in my ipad 2, can someone please help me?

    I can't open safari in my ipad 2, can someone please help me how to solve this problem?