Issue in setting java classpath using bash

I tried creating a script file for executing my java code in my linux machine.Below is the script which i created.
#!/bin/sh
HOME=`pwd`
JAVA_HOME=$HOME/jre
CLASSES=$HOME/classes
CLASS_PATH=$CLASSES/Testing.jar:$CLASSES/server/Server.jar
"${JAVA_HOME}"/bin/java -cp "$CLASS_PATH" 'com.project.testing.Tester' '10000'It worked perfectly.But if i put this script in a directory containing spaces in its name, it is not working and it is throwing the below exception
Exception in thread "main" java.lang.NoClassDefFoundError: com/project/testing/Tester
So i modified the script to escape the spaces in the class path variable.Below is the modified script
#!/bin/sh
HOME=`pwd`
JAVA_HOME=$HOME/jre
CLASSES=$HOME/classes
CLASS_PATH=$CLASSES/Testing.jar:$CLASSES/server/Server.jar
CLASS_PATH=$(echo $CLASS_PATH | sed 's/ /\\ /g')
"${JAVA_HOME}"/bin/java -cp "$CLASS_PATH" 'com.project.testing.Tester' '10000'But still i am getting the same exception.
Please help me to solve this problem.

julians wrote:
>
You think?? Why don't you just find out? The classpath is one of the system properties, so just write a Java program which simply writes all of the system properties to stdout. Then look at the system property which contains the classpath.
Sorry you didn't understand my question.Your answer is irrelevant to my questionThen you should explain your question better, using something less totally useless than "not working".
My question is I can read.
It has nothing to do with bash.There is some issue with java in the way it treats the argument after -cp option.If i can find out why should i post it here?.No. Java isn't treating any arguments. Your shell (bash) is treating the arguments. If you think it's Java, then you should investigate that. Which is why I posted what I did. If you think it's irrelevant then it must not be Java causing the problem. Of course you didn't even try it. Time-waster.
Please simulate this issue and respond to my postYou want me to buy a computer and install bash and try to reproduce your problem? Don't be ridiculous. Do your own work.

Similar Messages

  • Set system classpath using java program??

    Hi,
    I want to set the System classpath using java program. Can somebody please tell how to do this.
    Prashant

    but this will set the classpath for that particular JVM only.
    Isn't it??? I want that of SYSTEM so that user can access that class path from any JVM instance.
    Prashant

  • Help, how to install jvm and set the classpath using a batch file

    hello,
    i have created my java application and now have to create an installable / batch file which will install the JVM on the users machine and also the java packages such as javamail and the class files that i have created . it also has to set the classpath.
    i would like to know if anyone can tell me how to go about iti.e. how can i install the JVM using a batch file and then place the javamial packages etc in the apropriate directory .
    or is it advisable to explain it to the user how to go about it in tht user manual.
    and would also like to know that if i install the JVM will the path for the java.exe be set
    or will i have to set the path explicitly from the "batch file" so that the user can run the application without and problem just by running the java command followed by filename from the command prompt.

    hi,
    I have windows and I use it.
    The only problem with the free edition is that you can only create 1 launcher and that during the installation you get 1 popup showing that the installer was created with an unregistered version.
    Stijn

  • Tomcat Installation and setting Java Classpath

    Please help me in setting up Java classpath for Tomcat Server. I am unable to start the Server itself.

    try this it worked for me..install Tomcat and Ant in 2 seperate directories, if you are win98 or less edit your autoexec.bat file and set the class paths as follows
    set PATH=C:\jdk1.3\bin;%PATH%
    set ANT_HOME=C:\Ant
    set TOMCAT_HOME=C:\Tomcat
    set JAVA_HOME=C:\jdk1.3
    If you are using windows 2000 or NT you have to goto control panel --> system --> advanced and click environment variables
    for name type in say TOMCAT_HOME and for value type in c:\Tomcat
    restart your computer.
    Then goto tomcat\bin and type startup....in a browser type in http://localhost:8080 and you are in
    hope this helps

  • Need Help Setting Java Classpath

    I have installed JCreator LE and the JDK 1.6.02 and the JRE 1.6.02 as well as the API's into my JDK doc directory.
    I can't figure out how to set the classpath to allow me to run java programs and I can't figure out how to get java.exe to run either.
    WinXP doesn't come with an autoexec.bat file so that route for setting my classpath is out... I can get to the DOS command prompt just fine but don't know what to type. When I try running any program like java.exe from the JDK a small DOS like box appears for a split second and then disappears.
    If someone could help me solve this/these problems I'd be very grateful. Thanks

    Thanks for your help. I set my CLASSPATH option
    within system/advanced/setvar to: "C:\Program
    Files\Java\jdk1.6.0_02\bin" Which is precisely where
    my jdk is located. Wrong. That directory needs to be in your PATH, not CLASSPATH. PATH tells the operating system where to find .exe files like javac.exe and java.exe.
    CLASSPATH tells the JVM where to look for your .class files
    I've tinkered around and around and I still can't get
    it to work... My confidence in my computer savyness
    is beginning to deteriorate... I've been reading two
    books on java and believe I'm understanding OO pretty
    well into the later chapters at present. I read
    through Suns online tutorial as well and just am not
    understanding what I'm doing wrong here. Thanks-Read the docs for both javac.exe and java.exe. Both take a -classpath option when you run in a command shell. That's the correct way to specify CLASSPATH.
    Do not use an environment variable. That is the wrong way to go about it.
    When you graduate to application servers it'll be a different matter, but by then perhaps you'll understand better.
    %

  • Setting Java CLASSPATH on WINDOWS

    suppose i have the following values to set for CLASSPATH
    C:\Program Files\Common Files\System\Mapi\1033\NT
    and
    abc-win32
    is this correct
    C:\Progra~1\Commo~1\System\Mapi\1033\NT;abc~
    thanks.

    I think that you should use long file namesi don't understand "long file names". just for my own knowledge, how can this
    very thing be done?

  • Issue in setting classpath using bash

    I tried creating a script file for executing my java code in my linux machine.Below is the script which i created.
    #!/bin/sh
    HOME=`pwd`
    JAVA_HOME=$HOME/jre
    CLASSES=$HOME/classes
    CLASS_PATH=$CLASSES/Testing.jar:$CLASSES/server/Server.jar
    "${JAVA_HOME}"/bin/java -cp "$CLASS_PATH" 'com.project.testing.Tester' '10000'
    It worked perfectly.But if i put this script in a directory containing spaces in its name, it is not working and it is throwing the below exception
    Exception in thread "main" java.lang.NoClassDefFoundError: com/project/testing/Tester
    So i modified the script to escape the spaces in the class path variable.Below is the modified script
    #!/bin/sh
    HOME=`pwd`
    JAVA_HOME=$HOME/jre
    CLASSES=$HOME/classes
    CLASS_PATH=$CLASSES/Testing.jar:$CLASSES/server/Server.jar
    CLASS_PATH=$(echo $CLASS_PATH | sed 's/ /\\ /g')
    "${JAVA_HOME}"/bin/java -cp "$CLASS_PATH" 'com.project.testing.Tester' '10000'
    But still i am getting the same exception.
    Please help me to solve this problem

    julians wrote:
    >
    You think?? Why don't you just find out? The classpath is one of the system properties, so just write a Java program which simply writes all of the system properties to stdout. Then look at the system property which contains the classpath.
    Sorry you didn't understand my question.Your answer is irrelevant to my questionThen you should explain your question better, using something less totally useless than "not working".
    My question is I can read.
    It has nothing to do with bash.There is some issue with java in the way it treats the argument after -cp option.If i can find out why should i post it here?.No. Java isn't treating any arguments. Your shell (bash) is treating the arguments. If you think it's Java, then you should investigate that. Which is why I posted what I did. If you think it's irrelevant then it must not be Java causing the problem. Of course you didn't even try it. Time-waster.
    Please simulate this issue and respond to my postYou want me to buy a computer and install bash and try to reproduce your problem? Don't be ridiculous. Do your own work.

  • Issues while configuring java application using JDO with MS JDBC Driver 1.0

    We are in the process of configuring our java application with the production version of SQL Server 2005 Java Database Connectivity (JDBC) Driver 1.0. We are facing issues getting it to work with Sun App Server using JDO concept.
    After creating the data store, adding the JDBC driver to the application server classpath through console and also copying the driver into the lib directory, we are still getting the below error.
    Following is the stack trace encountered while running the application
    [#|2006-02-15T10:21:25.493+0530|WARNING|sun-appserver-pe8.1_02|javax.enterprise.system.container.ejb.entity.finder|_ThreadID=30;|JDO74010: Bean 'InventoryEJB' method ejbFindAllInventoryItems: problems running JDOQL query.
    com.sun.jdo.api.persistence.support.JDOFatalInternalException: JDO76519: Failed to identify vendor type for the data store.
    NestedException: java.sql.SQLException: Error in allocating a connection. Cause: javax.transaction.SystemException
         at com.sun.jdo.spi.persistence.support.sqlstore.impl.SQLPersistenceManagerFactory.initializeSQLStoreManager(SQLPersistenceManagerFactory.java:870)
         at com.sun.jdo.spi.persistence.support.sqlstore.impl.SQLPersistenceManagerFactory.getFromPool(SQLPersistenceManagerFactory.java:786)
         at com.sun.jdo.spi.persistence.support.sqlstore.impl.SQLPersistenceManagerFactory.getPersistenceManager(SQLPersistenceManagerFactory.java:673)
         at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerFactoryImpl.getPersistenceManager(PersistenceManagerFactoryImpl.java:849)
         at com.sun.jdo.spi.persistence.support.sqlstore.impl.PersistenceManagerFactoryImpl.getPersistenceManager(PersistenceManagerFactoryImpl.java:681)
         at com.sun.j2ee.blueprints.supplier.inventory.ejb.InventoryEJB1142755294_ConcreteImpl.jdoGetPersistenceManager(InventoryEJB1142755294_ConcreteImpl.java:530)
         at com.sun.j2ee.blueprints.supplier.inventory.ejb.InventoryEJB1142755294_ConcreteImpl.ejbFindAllInventoryItems(InventoryEJB1142755294_ConcreteImpl.java:146)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:147)
         at com.sun.ejb.containers.EJBLocalHomeInvocationHandler.invoke(EJBLocalHomeInvocationHandler.java:185)
         at $Proxy164.findAllInventoryItems(Unknown Source)
         at com.sun.j2ee.blueprints.supplier.inventory.web.DisplayInventoryBean.getInventory(Unknown Source)
         at org.apache.jsp.displayinventory_jsp._jspService(displayinventory_jsp.java:119)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:105)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:336)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:251)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
         at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
         at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:257)
         at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
         at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)
         at java.security.AccessController.doPrivileged(Native Method)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:723)
         at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:482)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:417)
         at org.apache.catalina.core.ApplicationDispatcher.access$000(ApplicationDispatcher.java:80)
         at org.apache.catalina.core.ApplicationDispatcher$PrivilegedForward.run(ApplicationDispatcher.java:95)
         at java.security.AccessController.doPrivileged(Native Method)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:313)
         at com.sun.j2ee.blueprints.supplier.inventory.web.RcvrRequestProcessor.doPost(Unknown Source)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:767)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:249)
         at java.security.AccessController.doPrivileged(Native Method)
         at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
         at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:282)
         at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:165)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:257)
         at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:55)
         at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:161)
         at java.security.AccessController.doPrivileged(Native Method)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:263)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
         at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:225)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:173)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:132)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:551)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:933)
         at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:185)
         at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:653)
         at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:534)
         at com.sun.enterprise.web.connector.grizzly.ProcessorTask.doTask(ProcessorTask.java:403)
         at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:55)
    Can anyone help me on this issue?
    Regards,
    Bindu

    I have already tried this before and this not work too, but strange that even if I use JDBC:ODBC bridge driver, the return value for output parameters are not correct, that is, only return the value that I input but not the value after executed in the procedure....
    The code that I used with JDBC:ODBC bridge is as follow:
    public static void main(String[] args) {
    String url = "jdbc:odbc:;DRIVER=SQL Server;Persist Security Info=False;database=db;Server=sql;uid=sa;pwd=pwd";
              Connection con;
              ResultSet rs = null;
    CallableStatement callS = null;
              try {
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              } catch(java.lang.ClassNotFoundException e) {
                   System.err.print("ClassNotFoundException: ");
                   System.err.println(e.getMessage());
              try {
                   con=DriverManager.getConnection(url);
    callS = con.prepareCall("{ call dbo.CpJavaTest (?)}");
    callS.registerOutParameter(1, Types.INTEGER);
    callS.execute();
    rs=callS.getResultSet();
    int ret = callS.getInt(1);
    System.out.println("return value : " + ret);
                   while (rs.next()) {
                        String f1 = rs.getString(4);
                        String f2 = rs.getString(5);
                        System.out.println(f1 + " " + f2);
              } catch(SQLException ex) {
                   System.out.println("SQLException: " + ex.getMessage());
    The value of the output parameter is same as what I inputed! Hope any one can teach me how to correct it...
    Thank you very much!

  • Is it possible to set instance classpath using asadmin?

    Hey all,
    I have the exciting task (YAY for me) of creating an installer for our software onto the Sun ONE AS. Basically I give the end user a few input panels to enter the few arguments that I need and then I want my installer to perform all the rest of the deployment. I am stuck with using InstallShield! I have been using asadmin and it's been great so far. It performs everything the Web based admin tool does but quicker. The only problem I'm having is that when I go to deploy our ejb's I'm getting classnotfound exceptions. This is fair enough and makes sense. But I want to know is there anyway of using asadmin to add jars to an instances classpath? I can't seem to find info anywhere on how to do it? using the web based admin tool to do it is easy but have to avoid getting the end user to do this step...
    Any answers/hints/tops anyone???
    Cheers
    Paul

    You can use asadmin to change instance classpath by
    using set subcommand and setting <server_name>.java-config.server-classpath attribute to the desired value (you can use get subcommand first to get the original path, append what you need and use set to modify it). Relevant admin guide URLs are:
    http://docs.sun.com/source/816-7156-10/agsvrprf.html#1022664
    http://docs.sun.com/source/816-7156-10/agcmdln.html
    Hope this helps....

  • Setting java classpath [SOLVED]

    Hi everybody,
    I am sure this is not hard, but I have been looking for some time now and just couldn't figure out how to do it. Trying to run simple java applications (I am just learning...) I allways get this error
    Exception in thread "main" java.lang.NoClassDefFoundError: /opt/java/jre/bin/
    Caused by: java.lang.ClassNotFoundException: .opt.java.jre.bin.
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
    So after doing some research I am pretty sure this is because my classpath is not set, but I can't figure out the correct directory. I assumed this would be
    /opt/java/bin
    So I added these lines to my .basrc
    export PATH=/opt/java/bin:$PATH
    export JAVA_HOME="/opt/java/"
    export CLASSPATH=.:/opt/java/
    I think java is installed just fine, cause I can run eclipse without problems..
    But it doesn't work... so please help me :)
    Last edited by daJense (2009-05-25 14:10:49)

    First, Thx for replying.. so here is what I get using echo
    [jens@jense-mobile Kap02]$ echo $PATH
    /opt/java/bin:/opt/java/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/share/eclipse:/opt/java/bin:/opt/java/jre/bin:/opt/kde/bin:/usr/share/netbeans/bin/:/usr/bin/perlbin/site:/usr/bin/perlbin/vendor:/usr/bin/perlbin/core:/opt/qt/bin:/home/db2inst1/sqllib/bin:/home/db2inst1/sqllib/adm:/home/db2inst1/sqllib/misc:/home/db2inst1/sqllib/db2tss/bin
    [jens@jense-mobile Kap02]$
    Now for studying I try to run simple java apps from commandline. Using the -cp option I got my programm to work (it's "HelloWorld"). So if I set up a directory
    ~/javaapps/
    How would I set this path so I don't have to use the -cp option every time I invoke an app

  • Set java classpath.

    hai,
    how to export- set classpath on linux platform.where is jdk located on fedora linux.

    hai,
    i got all u had told,but classpath is set compiles and run only one java class.
    for ex if a class A object is called by class B which has main method and both are put in same folder,their i am finding prob's.problem is class B(main class) doesn't find class A objects and gives errors.

  • How to set a CLASSPATH in JBuilder8

    I know it's probably a really easy answer or an incredibly stupid question but how do you set a classpath using JBuilder8 I'm trying to run a web-service and I need no access "axis jar files" I could really do with some help
    thanks
    "be wildered IT intern"

    Hello and thank's ever so much for your help sadly It still won't co-operate at this stage I can only beg for help it's vtal I have this running today!!!
    so this is the main part of the code thats causing problems
    package samples.userguide.example2 ;
    import org.apache.axis.client.Call;
    import org.apache.axis.client.Service;
    import org.apache.axis.encoding.XMLType;
    import org.apache.axis.utils.Options;
    import javax.xml.rpc.ParameterMode;
    I've added the libraries and this is what the window shows :
    project project properties _ libraries required
    Axis
    Apache Soap
    Xerces
    Ant
    JDK 1.4.1-b21
    When I try to run anything I get the following errors
    Erreurs
    Classe org.apache.axis.client.Call non accessible ; fichier org/apache/axis/client/Call.class introuvable � la ligne 3
    Classe org.apache.axis.client.Service non accessible ; fichier org/apache/axis/client/Service.class introuvable � la ligne 4
    Classe org.apache.axis.encoding.XMLType non accessible ; fichier org/apache/axis/encoding/XMLType.class introuvable � la ligne 5
    Classe org.apache.axis.utils.Options non accessible ; fichier org/apache/axis/utils/Options.class introuvable � la ligne 6
    Classe javax.xml.rpc.ParameterMode non accessible ; fichier javax/xml/rpc/ParameterMode.class introuvable � la ligne 7
    Classe Options introuvable dans classe samples.userguide.example2.CalcClient � la ligne 12
    Classe Options introuvable dans classe samples.userguide.example2.CalcClient � la ligne 12
    Classe Service introuvable dans classe samples.userguide.example2.CalcClient � la ligne 33
    Classe Service introuvable dans classe samples.userguide.example2.CalcClient � la ligne 33
    Classe Call introuvable dans classe samples.userguide.example2.CalcClient � la ligne 34
    Classe Call introuvable dans classe samples.userguide.example2.CalcClient � la ligne 34
    Variable XMLType introuvable dans classe samples.userguide.example2.CalcClient � la ligne 38
    Variable ParameterMode introuvable dans classe samples.userguide.example2.CalcClient � la ligne 38
    Variable XMLType introuvable dans classe samples.userguide.example2.CalcClient � la ligne 39
    Variable ParameterMode introuvable dans classe samples.userguide.example2.CalcClient � la ligne 39
    Variable XMLType introuvable dans classe samples.userguide.example2.CalcClient � la ligne 40
    Imports
    CalcClient
    CalcClient()
    main(String[] args)

  • How to set the classpath and path from the jsp to call  java class function

    Hi Exprets,
    I have a requirement to call a java class function which returns a hashmap object from the jsp. The java class in present in one jar file and that jar file is location somewhere in unix path. So the requirement is to set the classpath for that jar file and then create the object of the java class and then call the function.
    If any one know how to achieve it, please reply as soon as possible.
    thanks in advance,
    swapna soni.

    It is never advisable to store large data sets in the session. But it will depend on a lot of factors:
    1. How costly is the query retrieving the data from the database?
    If it's a complex query with lots of joins and stuff, then it will be better to store it in the session as processing the query each time will take a lot of time and will decrease performance. On the other hand if the query is simple then it's advisable not to store it in the session, and fetch it each time.
    2. Are there chances for the data to become stale within a session?
    In this case storing the data is session will mean holding the stale data till the user session lasts which is not right.
    3. How many data sets does the session already holds?
    If there are large no. of data sets already present in the session, then it's strictly not advisable to store the data in the session.
    4. Does the server employ some kind of caching mechanism?
    Using session cache can definitely improve performance.
    You will have to figure out, what is the best way analyzing all the factors and which would be best in the situation. As per my knowledge, session is the only place where session specific data can be stored.
    Also, another thing, if the data set retrieved is some kind of data to be displayed in reports, then it would be better to use a pagination query, which will retrieve only the specific no. of rows at a time. A navigation provided in the UI will retrieve the next/previous data set to display.
    Thanks,
    Shakti

  • Setting the Classpath of a VM launched using JDI

    I using VirtualMachineManager to get a LauchingConnector and fire off a new VM.
    It seems that there should be some way of me setting the classpath for this new VM.
    In general I'd like a list of the options that I can put in that argument map.

    In J2SE 5.0, jdb has a new option that will list the available connectors and the arguments that can be passed to them EG:
    jdb -listconnectors
    Available connectors are:
    Connector: com.sun.jdi.CommandLineLaunch Transport: dt_socket
    description: Launches target using Sun Java VM command line and attaches to it
    Argument: home Default value: /net/foo/p/jdk/1.5.0/jre
    description: Home directory of the SDK or runtime environment used to launch the application
    Argument: options (no default)
    description: Launched VM options
    Required Argument: main (no default)
    description: Main class and arguments, or if -jar is an option, the main jar file and arguments
    Argument: suspend Default value: true
    description: All threads will be suspended before execution of main
    Required Argument: quote Default value: "
    description: Character used to combine space-delimited text into a single command line argument
    Required Argument: vmexec Default value: java
    description: Name of the Java VM launcher
    This means that you would want to put "-classpath ......" into the 'options' argument.
    Hope this helps

  • Setting classpath using batch, but

    i am really confused now,i have my own java application, i convert it into exe and now it is located in C:\myprogram folder,
    this program is associated with the .txt file
    thats the reason why i conveert it into an exe
    but the problem is, when i double click on the txt file, i got an error "noclassdeffounderror: MYPROGRAM"( ihave associted txt with my program )
    that happens only when i double click on the txt file outside the bin directory
    if txt file i clicked is in the bin dir, it will be launched without error
    do i need to do it using batch(set the classpath)
    but since my program is an exe how should i write in the batch??
    so, can anyone help me??thansk
    Edited by: E.D.-inc on Sep 28, 2007 1:18 PM
    Edited by: E.D.-inc on Sep 28, 2007 1:44 PM

    So you are having an error when you run a native application. As I said before this is not a Java question.
    Possibly whatever tool you used to create the .exe file is faulty or was misused in some way. The makers of that tool would be the people to ask.
    Possibly the .exe you created requires some particular configuration of your machine (system variables and the like). Again, consult the documentation of whatever tool you used to create the .exe, or ask whoever supports it.
    It seems to me a bit overly complicated to create an .exe instead of arranging for a Java application to run in response to the text files being "opened". There were detailed instructions (for Windows) posted on this site within the last day or so saying how this is done. You might like to search for them.

Maybe you are looking for

  • ITunes Account for new iPhone without a computer?

    I just got an iPhone 3G that I am trying to update and get applications on, but I don't have a home computer. Is there a way I can login and create an iTunes Account virtually? I don't want to purchase iTunes, just connect, set up account for apps, a

  • Time Machine Deleted a VM Fusion Machine?

    Hi, I have restored my documents folder with time machine but in doing so I did not realise that it would remove my fusion virtual machine folder? Does anyone know how I can get them back?  I have been searching the net but not much luck here? any he

  • Wait screen needs to be visible before playing flash movie

    I have a Flash Video that I want to embed in my website: http://www.mrrogershood.com <don't ask The client wants there to be a "wait screen" so they can see something before the video starts playing. This is exactly how his needs to look: http://www.

  • Writing the filename as the prefix for bates or page numbering during batch process.  PRO 9

    While batch processing in Acrobat PRO 9 I am trying to insert the file name as the prefix automaticily either for page numbering or bates labeling. Not very good with javascript.  Any one have any ideas? Everyone is always asking to have the filename

  • Change Tracking has been marked inconsistent after live migration

    We run a 3 node Server 2012 R2 cluster and backup using DPM 2012 R2 Everytime a VM is live migrated to another node, when DPM next tries to back it up, the recovery point fails with the "Change Tracking has been marked inconsistent" error and a consi