Running Jar Files created in Sun Java Studio

Hi everyone,
I am still trying to explore the functionalities (especially as regards deployment issues) of this robust IDE. However I do have a problem. I have developed a very basic program that connects to a database (MSSQL) using Java Studio 8. However after building the jar file, if I try to execute the jar file it gives me this message
java.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver.....
But all goes well within the IDE and it runs well if I use my notepad or vi editor,compile it from the command line and execute the generated class file. The classpath have been set for all the necessary jdbc jar files.
Any Help Will Be Appreciated

1. Sun Java Studio Enterprise 8 is based on NetBeans 4.1 which does not provide direct support for packing an application. One alternative you may want to consider is to use NetBeans 5.0 (http://www.netbeans.info/downloads/download.php?type=5.0) or JSE 8.1 which is based on NB5.0 and which is now in beta (http://developers.sun.com/prodtech/javatools/jsenterprise/downloads/index.jsp).
You may want to refer to http://www.netbeans.org/kb/articles/javase-deploy.html for packing and deploying a standalone application is NB5.0 or JSE8.1.
2. Using JSE8, you may want to try copying all the library jars (including database drivers) used by your application to your projects dist directory manually and then package them all into one jar.
3. You should not have to know the exact location of the jdbc jar on the client machine. How are you instantiating the driver in your code? Are you using 'Class.forName()'? If so, java should be able to pick up the driver from the classpath. (Pl. ref to http://forum.sun.com/jive/thread.jspa?forumID=122&threadID=62696, which may be of help).

Similar Messages

  • How to run java program created in Sun Java Studio

    Hi All,
    sorry for easy question. I'm new in java.
    I have created Swing/AWT application with Sun Java Studio. I can run it using Sun Java Studio and it works properly. How to run this application in DOS-promt using "java ....."? I think, I shall define all classpathes but I dont know exactly.
    Enviroment:
    WinXP
    Sun Java Studio (C:\Sun\studio5u1_se)
    SDK (C:\Sun\j2sdk1.4.2_04)
    Application files (C:\Sun\My)
    Thanks.

    change this to yours
    set path=c:\j2sdk1.4.1_01\bin;c:\j2sdk1.4.1_01\jre\bin;%path%
    set classpath=c:\j2sdk1.4.1_01\lib;c:\jdk1.4.1_01\jre\lib;%classpath%
    go to directory where code is
    javac CLASSNAME.java
    then to run it
    java CLASSNAME
    note also look at executable jar files

  • Problem deploying war created in Sun Java Studio Enterprise 8

    I have, with some help from this forum, converted a portlet application from the Sun Java Studio Enterprise 7 environment to the Sun Java
    Studio Enterprise 8 environment. This portlet application runs in SJSE 8 now but fails when I pdeploy it to the portal server (Portal Server 6
    2005 Q1). The old war created from SJSE 6 does work. The code is identical. The war files are slightly different.
    On deployment I get:
    [DEBUG] Getting Jar File from war...
    [DEBUG] Getting Portlet DD as Stream...
    [DEBUG] Creating DPProviders...
    [DEBUG] Updating the Portlet Application...
    [DEBUG] Adding Providers to DP...
    [DEBUG] Adding provider: provider=__Portlet__timetableEnt8.Timetable
    [DEBUG] Creating DPProvider...
    [DEBUG] Checking for duplicate name: name=__Portlet__timetableEnt8.Timetable
    [DEBUG] Validating modified DP doc...
    [DEBUG] Storing the DP...
    Done Updating Display Profile! Deploying War File to Web Container...
    SUCCESS.But in the logs I see:
    [#|2006-04-04T13:09:58.112-0400|SEVERE|sun-appserver-ee8.1|javax.enterprise.system.container.web|_ThreadID=10;|WebModule
    [/portlet]Error configuring application listener of class
    com.sun.portal.container.portlet.impl.PortletContainerContextListenerImpl
    java.lang.ClassNotFoundException: com.sun.portal.container.portlet.impl.PortletContainerContextListenerImpl
            at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1447)
            at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1228)
            at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3958)
            at org.apache.catalina.core.StandardContext.start(StandardContext.java:4525)
            at com.sun.enterprise.web.WebModule.start(WebModule.java:241)
            at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1086)
            at org.apache.catalina.core.StandardHost.start(StandardHost.java:833)
            at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1086)
            at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:483)
            at org.apache.catalina.startup.Embedded.start(Embedded.java:894)
            at com.sun.enterprise.web.WebContainer.start(WebContainer.java:688)
            at com.sun.enterprise.web.HttpServiceWebContainer.startInstance(HttpServiceWebContainer.java:889)
            at com.sun.enterprise.web.HttpServiceWebContainerLifecycle.onStartup(HttpServiceWebContainerLifecycle.java:50)
            at com.sun.enterprise.server.ApplicationServer.onStartup(ApplicationServer.java:300)
            at com.sun.enterprise.server.PEMain.run(PEMain.java:294)
            at com.sun.enterprise.server.PEMain.main(PEMain.java:220)
    |#]
    [#|2006-04-04T13:09:58.114-0400|SEVERE|sun-appserver-ee8.1|tomcat.server./portlet.Context|_ThreadID=10;|
    Skipped installing application listeners due to previous error(s)|#]
    [#|2006-04-04T13:09:58.114-0400|SEVERE|sun-appserver-ee8.1|tomcat.server./portlet.Context|_ThreadID=10;|
    Error listenerStart|#]
    [#|2006-04-04T13:09:58.115-0400|SEVERE|sun-appserver-ee8.1|tomcat.server./portlet.Context|_ThreadID=10;|
    Context startup failed due to previous errors|#]When I look in the create "New Portlet Channel..." in the am console my application appears in the list but when I create a channel based on it, the whole desktop crashes with this error:
    [#|2006-04-03T11:39:41.699-0400|SEVERE|sun-appserver-ee8.1|javax.enterprise.system.container.web|_ThreadID=16;|
    StandardWrapperValve[desktopServlet]: Servlet.service() for servlet desktopServlet threw exception
    java.lang.IllegalStateException: getWriter() has already been called for this response
         at org.apache.coyote.tomcat5.CoyoteResponse.getOutputStream(CoyoteResponse.java:588)
         at org.apache.coyote.tomcat5.CoyoteResponseFacade.getOutputStream(CoyoteResponseFacade.java:166)
         at com.sun.portal.desktop.DesktopServlet.getWriter(DesktopServlet.java:444)
         at com.sun.portal.desktop.DesktopServlet.service(DesktopServlet.java:328)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
         at sun.reflect.GeneratedMethodAccessor62.invoke(Unknown Source)
         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.ContainerBase.invoke(ContainerBase.java:933)
         at com.sun.enterprise.web.connector.httpservice.HttpServiceProcessor.process(HttpServiceProcessor.java:221)
         at com.sun.enterprise.web.HttpServiceWebContainer.service(HttpServiceWebContainer.java:2072)
    |#]When I remove my custom channel the desktop renders normally.
    As I mentioned before, the war created with 7 did not cause this and the application behaved normally.
    Any insight would be appreciated.
    I am going to look at the diff between the two wars.
    Thanks,
    Allan

    I have the same problem, how do yuo resolve that?
    Edited by: 864937 on Jun 9, 2011 1:43 PM

  • Error with running JAR files created with NetBeans

    I have been having difficulty running the JAR files that NetBeans compiles. When I run my code from NetBeans, it always works just fine, but when I try to run the compiled JAR I get the following errors:
    Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
    at java.lang.ClassLoader.defineClass2(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:719)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:160)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:254)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
    This is happening for multiple projects now, though I don't remember it happening before. What am I doing wrong? Why is this happening? How can I fix it? Thank you for any insights...

    Oh, I forgot to mention, all the NetBeans samples work, just not apps that I create. This is very frustrating!

  • How to run jar file created with higher version on lower version ?

    Hi,
    I downloaded a jar file and trying to run it on Linux machine with Java version 1.4...
    I got error that jar file complied with 1.5 version.
    Is there any way to run it on 1.4 version. I don't want to upgrade Java version of my linux :)
    Regards,
    Ajay

    EJP wrote:
    On the contrary, the 'reality' is that it is better, and probably easier, once you analyse and present the comparative costs and risks correctly, to get the mandate lifted than to back-port code to platform levels for which it was not designed.The main blockade (judging by my observations) for actually doing it is that this is not a simple code change, which is what programmers really, really, really want to keep it within their comfort zone. All of a sudden you're tasked with software upgrades and the demands that it brings, such as testing to make sure everything still works properly and getting grumpy system's administrators to actually go do it.
    I wouldn't be surprised that there are people out there that would rather back port a library than to take the initiative to get Java upgraded :/

  • Cannot create a Sun Java Studio Creator project

    After successfully installing Sun Studio Creator on a machine running Fedora Core 7 I find that I am unable to create a JSF Web Application.
    Studio Creator will create an initial project in the home/john/Creator subdirectory and then create a project.xml file there. The application then hangs while showing the mouse cursor in a wait state that never ends.
    Studio Creator was installed using a config file called "creator-2_1-linux-ml.sp" while running in the -silent mode.
    Why you might ask? Because that is the only way it would install.
    The .sp file contains the following:
    installDir=/home/john/StudioCreator
    jdkHome=�/usr/java/jdk1.6.0_02�
    serialNumber=�trial�
    is.debug=1
    The app was installed using the command ./creator-2_1-linux-ml.bin -silent
    It would not install using xhost + localhost/export DISPLAY=localhost:.0.0
    Any ideas?
    Edited by: skunkboy on Dec 3, 2007 9:05 PM
    Edited by: skunkboy on Dec 3, 2007 9:09 PM

    I am having the same issue. I have kubuntu linux ; downloaded the creator install file "*creator-2_1-linux-ml.bin*" and installed the creator. When studio creator runs, it is unable to create initial project and I see only xml file.
    Eventhough Netbeans works good; but creator has integrated database provided; so it is easy to follow tutorials given on sun website.
    Any clues...

  • Importing jar files in Sun Java Studio

    Hi
    I am new to java and have recently installed Sun Java Studio Enterprise. As a part of assignment, I have been provided a jar file and use it.
    But i have not been able to load it into my program. How do i load it ?

    Hi
    I am new to java and have recently installed Sun Java Studio Enterprise. As a part of assignment, I have been provided a jar file and use it.
    But i have not been able to load it into my program. How do i load it ?

  • How to create frames ...!  in sun java studio creator

    Hello Every One,
    How to create a frame set in java studio creator ...!
    I prefer to run my entire applicaion on a window which comes out as a frame set, rather open in a browser. How to do that ...! if some one knows it help me out.
    Basically this is what i am trying to do.
    in my web page or frame i have an list box on the left
    based on the values selected in the list the information is displayed on the right which has bunch of text boxes.
    through me an idea how to do this using Sun Java Studio Creator.
    Thanks
    Senthil

    As of 1.0 Creator doesn't support creating HTML frames via the designer. However, it may be possible to edit the JSP source to include one by hand.
    Have you tried Page Fragments?
    - WInston

  • Problem running jar files of java in Linux

    I cannot run jar files in java/jdk1.3.1_01/demo in Readhat Linux 6.2
    The command is :--
    [root@localhost Notepad]# java -jar Notepad.jar
    java.lang.NoClassDefFoundError: javax/swing/JPanel
    at java.lang.Class.forName(Class.java:33)
    at kaffe.jar.ExecJarName.main(ExecJarName.java:58)
    at kaffe.jar.ExecJar.main(ExecJar.java:61)
    [root@localhost Notepad]#
    My ~/profile setting is :---
    PATH="$PATH:/usr/X11R6/bin:/usr/java/jdk1.3.1_01/bin:/usr/java/jdk1.3.1_01/jre/bin:/usr/java/jre/lib"
    export JAVA_HOME=/usr/java/jdk1.3.1_01
    export NPX_PLUGIN_PATH=/usr/java/jdk1.3.1_01/jre/plugin/i386/ns4

    [root@localhost Notepad]# java -jar Notepad.jar
    java.lang.NoClassDefFoundError: javax/swing/JPanel
    at java.lang.Class.forName(Class.java:33)
    at
    at
    at kaffe.jar.ExecJarName.main(ExecJarName.java:58)
    at kaffe.jar.ExecJar.main(ExecJar.java:61)
    [root@localhost Notepad]#
    My ~/profile setting is :---
    PATH="$PATH:/usr/X11R6/bin:/usr/java/jdk1.3.1_01/bin:/u
    r/java/jdk1.3.1_01/jre/bin:/usr/java/jre/lib"
    export JAVA_HOME=/usr/java/jdk1.3.1_01
    export
    NPX_PLUGIN_PATH=/usr/java/jdk1.3.1_01/jre/plugin/i386/n
    4Add the line:
    export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar
    Then, run the command "source ~/.profile" and then the jar file should be able to run.
    Bhav

  • Possible to create a JAR file from within a java app?

    Is it possible to create a jar file from within a java application?
    Can it be done more elegantly than by spawning-off another
    process with the Runtime and exec() portions of the api?
    Thanks
    Scott

    Thanks! I was mislead by the API notes for java.util.jar:
    The JarOutputStream class is used to write the contents
    of a JAR file to any output stream.
    I was looking for a class or method to make jar files.
    Seems this is it ;)
    Thanks
    Scott

  • Jar files created in test server page

    Hey everyone,
    I have been trying to follow the steps listed at:
    http://e-docs.bea.com/wls/docs81/webserv/client.html#1070561 to create a client jar. I was trying to use the jars created when you test the server code by running the webpage and d/l them. First off, i was never able to find a servicenamePORT.java file when i un-jarred it. is that a file that is only created when you run the clientgen? Second, if i was to use the clientgen, what is the domainName? is that like the workshop directory? and if that is the case, i don't have a setEnv.cmd file in that directory. can someone help me with that. and finally.... I want to take my client code and run it against a different webservice that will have the same methods, but obv. at a different location. How would i change the ip address that it points to?
    THanks for all and any help
    Jmgreen

    1. Sun Java Studio Enterprise 8 is based on NetBeans 4.1 which does not provide direct support for packing an application. One alternative you may want to consider is to use NetBeans 5.0 (http://www.netbeans.info/downloads/download.php?type=5.0) or JSE 8.1 which is based on NB5.0 and which is now in beta (http://developers.sun.com/prodtech/javatools/jsenterprise/downloads/index.jsp).
    You may want to refer to http://www.netbeans.org/kb/articles/javase-deploy.html for packing and deploying a standalone application is NB5.0 or JSE8.1.
    2. Using JSE8, you may want to try copying all the library jars (including database drivers) used by your application to your projects dist directory manually and then package them all into one jar.
    3. You should not have to know the exact location of the jdbc jar on the client machine. How are you instantiating the driver in your code? Are you using 'Class.forName()'? If so, java should be able to pick up the driver from the classpath. (Pl. ref to http://forum.sun.com/jive/thread.jspa?forumID=122&threadID=62696, which may be of help).

  • Sun Java Studio Enterprise 8.1

    I have an application developed with Forte For Java. Since Forte for java is no longer supported by Sun, I'd like to create a new project with Sun Java Studio Enterprise and migrate the existing java files into the new project so that I can debug and compile with Sun Java Studio Enterprise. Can anybody give some suggestions on how to do this? Or, could anybody tell me where to find a tutorial about Sun Java Studio Enterprise? I found a tutorial here: http://developers.sun.com/prodtech/javatools/jsenterprise/learning/tutorials/index.jsp , but it is only for creating a new project from scratch with UML modeling feature. This doesn't seem to be very helpful for my situation. Thank you!

    I installed Sun Java Studio but I couldn't find the option allowing me to create a new project from scratch. In New Project dialog, there are four options: Standard, UML, Web, Samples. When I select Standard, the description says "Imports an existing Java application into a free-form IDE project. A free-form project uses your existing Ant build script to run, compile, and debug your project." I know I can use the option UML to create a new project with assistance of UML model diagram, but this is not what I want.
    Does anybody have suggestions on this? Thanks in advance.

  • JSF conflict with Sun Java Studio Creator

    I was trying to use JSF but when i was installing Sun Java Studio everything went ok but there was a step saying "Deploying Web Services" that tool a lot of time about 10 minutes. So i cancelled it and the Sun Java Studio Creator was working well then when i was running the small application it didnt do anything. I think something wrong with the application server. I uninstalled Sun Java Studio Creator and installed it again.
    This time no problems in installation. Then when i was creating a new JSF application when i press finish an error(1) appears and the finish button is dimmed so i have to press cancel and another error occurs(2), but the project gives an error message(3)
    I have been trying to solve this problem but i dont know what to do.

    Please check / post the Creator log file ( Tools -> Java Studio Creator Log File)
    Check / post the server log file as well, which will give more info.
    To view the Sun Java System Application Server log file:
    In the Servers window, right-click the Deployment Server node and choose View Server Log.
    In any text editor, open the log file in the following location: install-directory\SunAppServer8\domains\creator\logs\server.log

  • Developing applications with Sun Java Studio Creator

    I downloaded Sun Java Studio Creator yesterday. I'm developing a Java application, however when I went to create a new project there only appeared to be web-related projects that could be created so I haven't figured out how to create a new application project.
    Does this program allow you to create stand-alone java applications??
    thanks,
    Doug

    What JSR says is true. The advantage of using Netbeans is that it works much faster than Java Studio Creator. It also has some nifty wizards for helping create various kinds of java projects.
    However, Java Studio creator is in fact based on Netbeans and it is possible to use JSC to create a java application. Do do so, click on Create New Project, then under Categories, select General...Java Class Library. JSC will create a new project for you with the name you provide. If you then go over to the project browser and right click your mouse on Source Packages and select New...Java Class it will create a class file for you that you can then write your java code into.
    In the project browser you can then right click your mouse over the class you created to compile it and run it.
    Daren

  • Error installing sun java studio creator

    I have downloaded the installable for sun java studio creator 2 update 1 for windows platform. I am unable to install the package. Following is the error Iog I get, when used in debug mode(Notice the last part ErrOut indicating the error). What is going wrong ?
    file type: 0
    file id: 0
    length: 178
    offset: 319579
    file name: instructions.txt
    file type: 5
    file id: 1
    length: 1009
    offset: 319757
    file name: Verify.jar
    file type: 2
    file id: 2
    length: 729
    offset: 320766
    file name: launch.txt
    file type: 4
    file id: 3
    length: 16766119
    offset: 321495
    file name: Windows-Sun-1.4.2_04.exe
    file type: 6
    file id: 4
    length: 249333158
    offset: 17087614
    file name: windows.jar
    Executing launch script command: "C:\DOCUME~1\JATINK~1\LOCALS~1\Temp\LRE5.tmp/bin\java.exe" -cp "";"C:\DOCUME~1\JATINK~1\LOCALS~1\Temp\LRE6.tmp\windows.jar";"" -Dtemp.dir="C:\DOCUME~1\JATINK~1\LOCALS~1\Temp" -Dis.jvm.home="C:\DOCUME~1\JATINK~1\LOCALS~1\Temp\LRE5.tmp" -Dis.jvm.temp="1" -Dis.media.home="C:\DOCUME~1\JATINK~1\LOCALS~1\Temp\LRE6.tmp\windows.jar" -Dis.launcher.file="D:\installables\Java Studio Creator\creator-2_1-windows-ml.exe" -Dis.jvm.file="C:\DOCUME~1\JATINK~1\LOCALS~1\Temp\LRE5.tmp\jvm" -Dis.external.home="D:\installables\Java Studio Creator" -Xms20m -Xmx60m run in working directory D:\installables\Java Studio Creator
    Output from the launch script execution
    StdOut:
    ErrOut:
    Assertion failed: errno == 0 && count == (size_t) size, file ../../../src/share/native/sun/awt/font/fontmanager/fontobjects/fontObject.cpp, line 506
    This application has requested the Runtime to terminate it in an unusual way.
    Please contact the application's support team for more information.

    Hi,
    Which version of windows are you using? which jdk? Did you have any conflicting products installed earlier.
    have you checked the install faqs?
    http://developers.sun.com/prodtech/javatools/jscreator/reference/faqs/index.jsp
    Thanks
    K

Maybe you are looking for

  • Adobe Muse CC Error #1009

    A little bit about how the error started.  I was making edits to our company intranet.  I usually save the file every 15-20 minutes with a quick ctrl+s out of  habit.  A few edits later I went to undo, a save prompt came up again, I figured this was

  • SCA Performance Issues

    Recent datacentre design uses both CSS Content Switches and SCA SSL accelerators. Services working fine, however SSL acceleration actually SLOWS DOWN during the day. Up to four minutes to load a SSL encrypted page in the afternoon as opposed to a mor

  • Automate Archiving Jobs

    Hi We wanted to run the Archive jobs every year by Company Code and Object wise. We have around 7 sales companies  and 10 objects so we have to run 70 jobs Every year. So we wanted to automate this process so that we dodnt need to eneter the texts et

  • What does the menu item "Eliminer les messages supprimés" really means ?

    I have a MobileMe IMAP account; sent messages are stored on the server. Fine. I've deleted many sent messages and they don't appear in my "Sent mail" box. Should be good house cleaning. However those messages are still stored locally in the "Sent mes

  • How to increase the FPS of animation in JavaFX?

    I tried to run the tree animation demo in the official JavaFX Documentation System.out.println("FPS "   + com.sun.javafx.perf.PerformanceTracker   .getSceneTracker(stage.getScene())   .getInstantFPS()); its output FPS: FPS 0.0 FPS 0.0 FPS 0.0 FPS 0.0