Problem in parsing a jar file

Hi Friends,
I am using Tomcat5.5 & Eclipse 3.1.2 to create jsf applications, i have added myfaces-all.jar in to my WEB-INF/lib folder and started the server.
While starting the server it gives message like following, i can't figure it out, can anyone help me in this regard.
WARNING: Can't parse file: 'jar:file:/.../eclipse/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/webapps/jsfMyfaces/WEB-INF/lib/myfaces-all.jar!/META-INF/faces-config.xml'.
java.net.ConnectException: Connection refused: connect
     at java.net.PlainSocketImpl.socketConnect(Native Method)
     at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
     at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
     at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
     at java.net.Socket.connect(Socket.java:507)
     at java.net.Socket.connect(Socket.java:457)
     at sun.net.NetworkClient.doConnect(NetworkClient.java:157)
     at sun.net.www.http.HttpClient.openServer(HttpClient.java:365)
     at sun.net.www.http.HttpClient.openServer(HttpClient.java:477)
     at sun.net.www.http.HttpClient.<init>(HttpClient.java:214)
     at sun.net.www.http.HttpClient.New(HttpClient.java:287)
     at sun.net.www.http.HttpClient.New(HttpClient.java:299)
     at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:792)
     at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:744)
     at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:669)
     at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:913)
     at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:973)
     at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(XMLEntityManager.java:905)
     at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDTDEntity(XMLEntityManager.java:872)
     at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.setInputSource(XMLDTDScannerImpl.java:282)
     at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(XMLDocumentScannerImpl.java:1021)
     at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
     at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
     at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
     at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
     at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
     at org.apache.commons.digester.Digester.parse(Digester.java:1548)
     at com.sun.faces.config.ConfigureListener.parse(ConfigureListener.java:1182)
     at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:228)
     at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3727)
     at org.apache.catalina.core.StandardContext.start(StandardContext.java:4162)
     at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012)
     at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
     at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012)
     at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
     at org.apache.catalina.core.StandardService.start(StandardService.java:450)
     at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
     at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
     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.startup.Bootstrap.start(Bootstrap.java:275)
     at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Mar 22, 2006 5:48:14 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener
javax.faces.FacesException: Can't parse file: 'jar:file:/.../eclipse/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/webapps/jsfMyfaces/WEB-INF/lib/myfaces-all.jar!/META-INF/faces-config.xml'.
     at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:240)
     at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3727)
     at org.apache.catalina.core.StandardContext.start(StandardContext.java:4162)
     at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012)
     at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
     at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012)
     at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
     at org.apache.catalina.core.StandardService.start(StandardService.java:450)
     at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
     at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
     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.startup.Bootstrap.start(Bootstrap.java:275)
     at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: java.net.ConnectException: Connection refused: connect
     at java.net.PlainSocketImpl.socketConnect(Native Method)
     at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
     at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
     at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
     at java.net.Socket.connect(Socket.java:507)
     at java.net.Socket.connect(Socket.java:457)
     at sun.net.NetworkClient.doConnect(NetworkClient.java:157)
     at sun.net.www.http.HttpClient.openServer(HttpClient.java:365)
     at sun.net.www.http.HttpClient.openServer(HttpClient.java:477)
     at sun.net.www.http.HttpClient.<init>(HttpClient.java:214)
     at sun.net.www.http.HttpClient.New(HttpClient.java:287)
     at sun.net.www.http.HttpClient.New(HttpClient.java:299)
     at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:792)
     at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:744)
     at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:669)
     at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:913)
     at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:973)
     at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(XMLEntityManager.java:905)
     at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDTDEntity(XMLEntityManager.java:872)
     at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.setInputSource(XMLDTDScannerImpl.java:282)
     at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDispatcher.dispatch(XMLDocumentScannerImpl.java:1021)
     at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
     at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
     at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
     at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
     at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
     at org.apache.commons.digester.Digester.parse(Digester.java:1548)
     at com.sun.faces.config.ConfigureListener.parse(ConfigureListener.java:1182)
     at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:228)
     ... 15 more
Note: When i removed this myfaces-all.jar from my lib folder, the application executes without any error.
Thanks & Regards,
Sella

try to open the jar and see if contains no errors. For example with winrar.

Similar Messages

  • Problem in Creating a jar file using java.util.jar and deploying in jboss 4

    Dear Techies,
    I am facing this peculiar problem. I am creating a jar file programmatically using java.util.jar api. The jar file is created but Jboss AS is unable to deploy this jar file. I have also tested that my created jar file contains the same files. When I create a jar file from the command using jar -cvf command, Jboss is able to deploy. I am sending the code , please review it and let me know the problem. I badly require your help. I am unable to proceeed in this regard. Please help me.
    package com.rrs.corona.solutionsacceleratorstudio.solutionadapter;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.util.jar.JarEntry;
    import java.util.jar.JarOutputStream;
    import java.util.jar.Manifest;
    import com.rrs.corona.solutionsacceleratorstudio.SASConstants;
    * @author Piku Mishra
    public class JarCreation
         * File object
         File file;
         * JarOutputStream object to create a jar file
         JarOutputStream jarOutput ;
         * File of the generated jar file
         String jarFileName = "rrs.jar";
         *To create a Manifest.mf file
         Manifest manifest = null;
         //Attributes atr = null;
         * Default Constructor to specify the path and
         * name of the jar file
         * @param destnPath of type String denoting the path of the generated jar file
         public JarCreation(String destnPath)
         {//This constructor initializes the destination path and file name of the jar file
              try
                   manifest = new Manifest();
                   jarOutput = new JarOutputStream(new FileOutputStream(destnPath+"/"+jarFileName),manifest);
              catch(Exception e)
                   e.printStackTrace();
         public JarCreation()
         * This method is used to obtain the list of files present in a
         * directory
         * @param path of type String specifying the path of directory containing the files
         * @return the list of files from a particular directory
         public File[] getFiles(String path)
         {//This method is used to obtain the list of files in a directory
              try
                   file = new File(path);
              catch(Exception e)
                   e.printStackTrace();
              return file.listFiles();
         * This method is used to create a jar file from a directory
         * @param path of type String specifying the directory to make jar
         public void createJar(String path)
         {//This method is used to create a jar file from
              // a directory. If the directory contains several nested directory
              //it will work.
              try
                   byte[] buff = new byte[2048];
                   File[] fileList = getFiles(path);
                   for(int i=0;i<fileList.length;i++)
                        if(fileList.isDirectory())
                             createJar(fileList[i].getAbsolutePath());//Recusive method to get the files
                        else
                             FileInputStream fin = new FileInputStream(fileList[i]);
                             String temp = fileList[i].getAbsolutePath();
                             String subTemp = temp.substring(temp.indexOf("bin")+4,temp.length());
    //                         System.out.println( subTemp+":"+fin.getChannel().size());
                             jarOutput.putNextEntry(new JarEntry(subTemp));
                             int len ;
                             while((len=fin.read(buff))>0)
                                  jarOutput.write(buff,0,len);
                             fin.close();
              catch( Exception e )
                   e.printStackTrace();
         * Method used to close the object for JarOutputStream
         public void close()
         {//This method is used to close the
              //JarOutputStream
              try
                   jarOutput.flush();
                   jarOutput.close();
              catch(Exception e)
                   e.printStackTrace();
         public static void main( String[] args )
              JarCreation jarCreate = new JarCreation("destnation path where jar file will be created /");
              jarCreate.createJar("put your source directory");
              jarCreate.close();

    Hi,
    I have gone through your code and the problem is that when you create jar it takes a complete path address (which is called using getAbsolutePath ) (when you extract you see the path; C:\..\...\..\ )
    You need to truncate this complete path and take only the path address where your files are stored and the problem must be solved.

  • Problem while loading a jar file into database

    Hi All,
    We are using Oracle 8.1.5 in Solaris. When I try to load a jar file into the database by using loadjava it gives the following error
    Error while processing jar cryptix32.jar
    Exception java.io.IOException: Load Java is unable to handle compressed entries: cryptix/provider/Cryptix.class
    loadjava: 1 errors
    Can anybody suggest anything to overcome this. Thanks in advance.

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by John Emmer ([email protected]):
    I presume you've tried creating the jar w/o compressing it? If not, and even if you didn't create the jar, then first unpack the jar into a directory and re-jar it without using compression.<HR></BLOCKQUOTE>
    Hi John,
    Thanks for your help. I unpacked the jar and rhen re-jared it with -0 (uncompress ) option. The above error is gone. But I am getting another problem. I am getting the following error for all the classes except the property files.
    Error while resolving class cryptix/cryptix/provider/cipher/Rijndael
    ORA-04043: object cryptix/cryptix/provider/cipher/Rijndael does not exist
    But the class is there in the jar. I am able to load single individual classes. Can anybody help me in this matter. Thanks in advance.

  • Can someone help me with a problem of parsing an XML file?

    Hello,
    I'm having some problems parsing an xml file. I get a SAXNotSupportedException when setting a property value.
    Here is the piece of code where I have the problem:
    SAXParserFactory spf = SAXParserFactory.newInstance();
    spf.setNamespaceAware(true);
    SAXParser saxParser = spf.newSAXParser();
    XMLReader xmlReader = saxParser.getXMLReader();
    DefaultHandler defHandler = new DefaultHandler();
    xmlReader.setProperty("http://xml.org/sax/properties/lexical-handler", defHandler);
    and the log is:
    Problem with the parser org.xml.sax.SAXNotSupportedException: PAR012 For propertyID "http://xml.org/sax/properties/lexical-handler", the value "org.xml.sax.helpers.DefaultHandler@4ff4f74a" cannot be cast to LexicalHandler.
    http://xml.org/sax/properties/lexical-handler org.xml.sax.helpers.DefaultHandler@4ff4f74a LexicalHandler
    I've been working on this problem but I can't find the error.
    Does anyone have an idea of what to do to solve it?
    Thanx in advance,
    M@G

    before deciding which XML technology to use, you should see if your application fit in the category below:
    use SAX:
    1. The XML file is rather large (30 or 40+ MB)
    2. I don't need the xml document in memory. I will parse the document and store the data in my own object.
    use DOM or JDOM
    1. The XML file is relatively small (less than 30 MB) or I can increase the runtime memory for larger xml file.
    2. I will need to walk up and down the xml document tree severals time.
    3. My application is in Java and it's not going to be rewritten in C++, etc (use JDOM)
    NOTE:
    JDOM is rather easier to use (for Java developer), but it's not an www.org.com standardlized xml parser.
    personally, i like JDOM for traversing the DOM.

  • Problem loading Applets from Jar files on 64 bit machine

    I am developing an applet (extends Applet but uses swing components) using JDK 1.6 (Though these problems still happen in JDK 1.7) and I am unable to get the applet to load on a 64 bit machine in most cases. The web server(s) are running on localhost and I am connecting on the same machine using a local network ip address (such as 192.168.*.*)
    Below are all of my test results. Can someone provide a suggestion for repairing this? The Windows Server machine is a clients computer I access to it via remote desktop but I can't do much with it though I do have administrator rights. The Windows 7 machine is my development platform so I have been able to do extensive testing on it.
    This problem is presenting in the following environments when trying to load an applet from JAR files in a HTML document using the Applet or Object tag.
    Windows Server 2008 (Intel Chipset)
    Tested Browsers:
    Internet Explorer 9 (32 bit) - Shows it is blocked by default then simply shows an x when loaded from a web page, same result when loading from local drive.
    Windows 7 Home Premium (AMD Chipset)
    Tested Browsers:
    Firefox 6.0.1 (32 bit) - Java logo shows with spinner, after a few minutes there is finally an error that a class in the jar was not found
    Internet Explorer 9 (32 bit) - Java logo shows with spinner, after a few minutes there is finally an error that a class in the jar was not found
    Internet Explorer 9 (64 bit) - Java logo shows with spinner and most of the windows desktop manager freezes, keyboard is the only thing that responds so you can alt-tab to another app to regain control of the desktop.
    Chrome (32 bit) - Java logo shows with spinner, after a few minutes there is finally an error that a class in the jar was not found
    The only way I have been able to get a Java applet to run on a 64 bit machine are the following ways.
    Firefox 9 nightly (64 bit) works perfectly! Go Firefox!
    Internet Explorer 9 (32 bit) loading directly from drive (c:\...)
    Chrome (32 bit) loading directly from drive (c:\...)
    Firefox 6.0.1 (32 bit) loading directly from drive (c:\....)
    Can someone please help! I've been fighting with this bug for over a week and I can't find anything that will solve it, I have noticed that in some cases if my jar has very little code in it than it will run on the server, but the minute I start adding things to it the jar won't load anymore.

    jschell wrote:
    rritoch wrote:
    I am developing an applet (extends Applet but uses swing components) using JDK 1.6 (Though these problems still happen in JDK 1.7) and I am unable to get the applet to load on a 64 bit machine in most cases.
    To clarify...
    1. You have tried it on 32 bit machine? Exactly which OS?I tested this on Windows Vista Business which is in 32 bit mode and the applets run without any problems
    >
    2. Your only 64 bit tests have involved 2008/Win7?
    If so then I would suspect something with windows not java. Probably permissions.
    The web server(s) are running on localhost and I am connecting on the same machine using a local network ip address (such as 192.168.*.*)
    Yes, I haven't tried running the jars on other operating systems.
    >
    I don't understand that. If you are running on localhost then you should connect to localhost. If running on an IP then you should connect to that. Perhaps you meant that you have tested using both of those?I'm testing using the lan ip address but I'm connecting from the same machine. I've tried localhost and that didn't work so I tried lan ip since that will likely have a different java security context than localhost. At first I was blaming the IIS server but I downloaded the jar directly and using HTTP fox was able to verify that the jar is being sent with the correct mime-type and that the server can upload the jar file without a problem. This leaves me to believe the problem is with Java.

  • Problem with images in .jar file

    Hi all!
    I've got a severe problem when deploying an application via web start:
    the images withhin a deployed .jar file are not found.
    So far I've tried a number of things to get the images back, none of which are working.
    I've found different threads concerning this topic, e.g.:
    http://forum.java.sun.com/thread.jspa?threadID=396363
    http://forum.java.sun.com/thread.jspa?threadID=465795&messageID=2141351
    but sadly, they didn't help me out.
    Here is my code I'm using:
      private ImageIcon loadIconFromClassLoader(String tszRelPath)
        ImageIcon tIcon = null;
        cCat.info("tszRelPath = "+ tszRelPath);
        // this line simply leads to a crash of the whole application
        //tszRelPath = tszRelPath.replaceAll("\\", "/");
        if(!tszRelPath.startsWith("/"))
          tszRelPath = "/" + tszRelPath;
        cCat.info("modified tszRelPath = " + tszRelPath);
        URL tURL = ClassLoader.getSystemResource(tszRelPath);
        if(tURL == null)
          // this too crashes my application
          //tURL = PlainResourceProvider.class.getResource(tszRelPath);
        if(tURL != null)
          tIcon = new ImageIcon(tURL);
        return tIcon;
      }I've also tried
    PlainResourceProvider.class.getClassLoader().getResource()PlainResourceProvider is part of the .jar that involves the images.
    Of course all the .class files in the .jar file are easily accesible
    I would be so thankful, if just anyone could help me to solve this problem.
    I am going crazy.
    Thanks in advance, Christoph

    You should take care of the directory structure according to the package structure.
    I for example have this jar:
    C:\source\java\ebank2_util\smsunlock>unzip -l pro-ebank_sms_unlock.jar
    Archive:  pro-ebank_sms_unlock.jar
    Length    Date    Time    Name
          0  10-28-05  17:27   hu/
          0  10-28-05  17:27   hu/khb/
          0  10-28-05  18:17   hu/khb/smsunlock/
        256  11-07-05  16:33   hu/khb/smsunlock/DButils$MySQLException.class
       4229  11-07-05  16:33   hu/khb/smsunlock/DButils.class
       1700  11-07-05  16:33   hu/khb/smsunlock/GUI$1.class
       2318  11-07-05  16:33   hu/khb/smsunlock/GUI$2.class
        988  11-07-05  16:33   hu/khb/smsunlock/GUI$3.class
       1402  11-07-05  16:33   hu/khb/smsunlock/GUI$mywl.class
       5630  11-07-05  16:33   hu/khb/smsunlock/GUI.class
        818  11-07-05  16:33   hu/khb/smsunlock/LimitedLength_TextField.class
       2452  11-07-05  16:33   hu/khb/smsunlock/Main.class
        900  11-07-05  16:33   hu/khb/smsunlock/MyInputStream.class
          0  11-07-05  16:33   META-INF/
         98  10-27-05  15:53   META-INF/manifest.mf
         90  11-07-05  16:33   hu/khb/smsunlock/properties
      20881                    16 filesAnd the resource is loaded like this from hu.khb.smsu.Main:
    InputStream is = new MyInputStream( Main.class.getResourceAsStream( "properties" ) );

  • Problem with addition of jar file to DC

    Hi WDers,
    I have a DC of type WD.
    I'm trying to add com.sap.security.api.jar file to this component so that I can get IUser and work on it.
    I have added this security jar file as an External jar file to the DC. But whenever I try to DC->Build, the jar entry is going away. So the Build is failing.
    Can you kindly let me know why this is happening?
    Or is there any other way to add a jar file so that I can use the IUser interface in my view?
    Thanks in Advance
    RK

    Hello,
    Add the Standard DC "com.sap.security.api.sda" from the SAP-JEE. This ahould solve the problem.
    To do that follow the steps:
    1. Go to the "DC Metadata" option available under the DC.
    2. Go to "Used DCs" and choose "Add used DCs" from the context menu which appears on a right click at the Used Dcs option.
    3.Select "com.sap.security.api.sda" under SAP-JEE and choose finish.
    4. Build the DC to gain access to the IUser and other related classes.
    Bala.

  • Problem with installer of jar file....!!!

    Hi All,
    I had created a installer of my java application. after the installation when i click on jar file,jar file will execute but not locating to installed program files folder.
    But if i set the Startin property of shortcut (Start-->Programs-->Folder-->JarFile--> Right Click-->properties) then it run OK.
    Problem is that, i have to set that property manually..
    If you people having any solution of this, then please let me know.
    Thankx in advance...

    Hi
    see http://forum.java.sun.com/thread.jspa?forumID=256&threadID=501000
    Hope that help,
    Jack

  • Problem accessing class in jar file

    Hello. I am trying to create a jar file from my already compiled classes. I have around 5 packages, and my programs' entry point is in one of the packages, we'll call package A. Each package has its own purpose and package A calls any needed package to perform their task. This works well when I compile, run and all. However, when I create a jar file, it only works with the local package and any calls to another package do not work. How can I get around this? any help will be appreciated

    This is the output..
    05/05/2010  10:19 AM        10,946,787 MYJAR.jar
                   1 File(s)     10,946,787 bytes
                   0 Dir(s)   1,434,251,264 bytes freeMy manifest file contains
    Manifest-Version: 1.0
    Class-Path: .
    Main-Class: Login.loginMain
    AndrewThompson64 wrote:Is the code [swallowing exceptions|http://pscode.org/javafaq.html#stacktrace] at any point?
    Nope..
    AndrewThompson64 wrote:
    How do you know that if there is absolutely no error output?The when I ran the code from my compiler, it has no errors, and it works smoothly. I have used a JAR for a single package program before and it worked well but this multiple package program is giving me the problem and I don't want to put all the files in a single package

  • Problem accessing sounds in jar file

    Hi,
    I have made a program and packed it to a jar file.
    Everything works fine in the IDE, so this is purely a matter of jar access.
    The jar has 6 folders.
    framework (which is one of my packages)
    META-INF
    sound (also my package)
    sounds (my wav files for the program)
    sprite (another package)
    sprites (my graphics for the program).
    I access the graphics in sprites, from a class in sprite and have no problem with it.
    try {               
                   URL url = this.getClass().getClassLoader().getResource(ref);               
                   if (url == null) {
                        fail("Kan ikke finde ref: "+ref);
                   sourceImage = ImageIO.read(url);
              } catch (IOException e) {
                   fail("fejl ved load: "+ref);
              }The problem is accessing the wav file in the sounds folder from a class in the sound folder.
    try{
                   AudioInputStream stream = AudioSystem.getAudioInputStream(new File("Sounds/1999.wav"));
                   AudioFormat format = stream.getFormat();
                   DataLine.Info info = new DataLine.Info(Clip.class, stream.getFormat(),
                             ((int)stream.getFrameLength()*format.getFrameSize()));
                   clip = (Clip) AudioSystem.getLine(info);
                   clip.open(stream);
              }I have tried to use the class loader like this (instead of AudioSystem.getAudioInputStream) :
    AudioInputStream stream = (AudioInputStream) this.getClass().getClassLoader().getResourceAsStream("sounds/1999.wav");          
    but it didnt help.
    Does anyone have any suggestione?
    Please, if all you can do, is paste a link to the java API, save your energy. I have already looked and it was no help, as im still only a student of java.
    I would like an actual suggestion, so i can see it work, then i can make work my way through the API from there.
    Edited by: Mondariz on May 7, 2008 8:26 AM

    Don't try to use a File object to access resources from the jar. You have a working process for accessing the sprites, just use the same process to access the sounds. Only not quite the same method, there's one method which returns a URL and a very similar method which returns an InputStream. I would post the link to the documentation but you asked for us to not do that. Anyway you seem to know where it is.

  • In Oracle 10g for XML  parsing what jar files have to be loaded?

    I am trying to parse the sample xml file. I want to know what are the jar files which needs to be loaded in Oracle 10g. In Oracle 9i I have files which have been asked to load in to the database.
    1) xmlparserv2.jar and
    2) xmlplsql.jar
    But in Oracle 10g under lib I could see only xmlparserv2.jar.What are the jar files which have to be loaded using loadjava in this case?

    Something like this ?
    SELECT REGEXP_REPLACE('TABLE_COLUMN_1_ID,TABLE_COLUMN_2_VALUE,TABLE_COLUMN_3_DESC',
                          '([^,]+)', ' \1 = \1') x
    FROM DUAL;
    X
    TABLE_COLUMN_1_ID = TABLE_COLUMN_1_ID, TABLE_COLUMN_2_VALUE = TABLE_COLUMN_2_VALUE, TABLE_COLUMN_3_DESC = TABLE_COLUMN_3_DESC

  • Problem loading image from jar file referenced by jar file

    First, I searched this one and no, I didn't find an answer. Loading images from jar files has been pretty much done to death but my problem is different. Please read on.
    I have my application, a straight up executable running from Eclipse. It uses a jar file, call it JarA. JarA launches a GUI that is located in another jar file. Call it JarB. To recap:
    My application calls JarA -> JarA loads classes from JarB -> JarB looks for images to place in a GUI it wants to show on the screen
    When JarB goes to load an image the following happens:
    java.lang.NullPointerException
         at sun.misc.URLClassPath$3.run(URLClassPath.java:316)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.misc.URLClassPath.getLoader(URLClassPath.java:313)
         at sun.misc.URLClassPath.getLoader(URLClassPath.java:290)
         at sun.misc.URLClassPath.findResource(URLClassPath.java:141)
         at java.net.URLClassLoader$2.run(URLClassLoader.java:362)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findResource(URLClassLoader.java:359)
         at java.lang.ClassLoader.getResource(ClassLoader.java:977)
         at org.cubrc.gmshell.gui.MainWin.preInit(MainWin.java:152)
         at org.cubrc.gmshell.gui.MainWin.<init>(MainWin.java:135)
    The code from JarB that loads the image looks like this:
              URL[] oSearch = {Main.class.getResource("images/")};
              URLClassLoader oLoader = new URLClassLoader(oSearch);
              imgIcon = new ImageIcon(oLoader.getResource("icon.gif"));
              imgMatchRunning = new ImageIcon(oLoader.getResource("gears.gif"));
              imgMatchStill = new ImageIcon(oLoader.getResource("gears-still.gif"));
              imgMagnify = new ImageIcon(oLoader.getResource("magnify.gif"));This looks right to me and JarB certainly has an images directory with those files. But I'm in hell right now because I don't know where to place the images to make this work or if you can even attempt to load images with a dependency chain like this.
    Any help very appreciated!

    Have you tried to move your image-files out of the jar file and place them in the sam folder as the jar-file? I think that would help.
    When you try to load the image-file you get the NullPointerException because the program tries to read a file it can't find. Remember that a jar file IS a file and not a directory.
    If you want to read somthing inside the jar-file you need to encode it first.
    Have you tried to read the jar-file with winRar. It makes it easy to add and remove files in your jar-file.

  • Problem w/ Netbeans genereted jar file

    Hi,
    My java application runs fine in the netbeans IDE. I had problems with the jar file it created a while back which turned out to be that i had an older version of JRE still installed. Anyway they worked fine until recently, when i started geting the same message from the virtual machine : "Could not find main class" (I know there's other threads in this forum on this but they didn't solve my problem). The manifest file looks like this:
    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.6.2
    Created-By: 1.5.0_01-b08 (Sun Microsystems Inc.)
    Main-Class: BattleRoyal
    X-COMMENT: Main-Class will be added automatically by build
    Which is EXACTLY the same as the manifest file in the old jar file that does work.
    What other problems could have occured? (I don't need any third party jar files or anything)
    Thanks

    Hello
    I have dealt with similar issues in the past.
    The first thing you should check is that the name of the class in the "Main-Class" parameter of the manifest id the full name of the class including the package. For example:
    Main-Class: com.acme.MyMainClass
    Second, are you sure your packaged application does not need external libraries? this could be the source of the problem.
    Last, I would not trust my IDE to make the Jar for me. (Men can open , and close their own Jars!!!, just kidding) I use an ANT task to do the packaging.
    <target name="jarFiles" depends="init">          
    <jar jarfile="${jarname}" basedir="${buildDir}">
         <manifest>
              <attribute name="Main-Class" value="com.acme.MyClass"/>
         </manifest>
    </jar>
    </target>
    I hope this helps and reaches you in time.

  • Problem loading URL from .jar file

    I encounter problems while loading a MsAccess DB contains within a .jar file. This is the following codes I used,
    try
        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
        java.net.URL url=getClass().getResource("MSAccessDB\\SavingApp DB.mdb");
        DBURL+=url.getFile();
    catch(Exception e)
    { System.err.println(e.toString()); }

    Could I ask that, if I stored the MsAccess or any other DBs, will the DB able to do basic operations (Create Update Retrieve Display)?
    As the DB is not like a normal Text file.
    What I did is that, I didn't include the MsAccess into the .jar file. I just put it beside. The disadvantage is that user ables to open the DB and might do some changes. ;-(

  • Problems accessing class in JAR file [err = -4000]

    Hi, my setup is as follows ....
    I have a seq file that is accessing a Java class file, TestStandClient.java. something like
    public class TestStandClient
       public String test (String arg)
          String returnVal = "";
          try
             TestClass testClass = new TestClass ();
             returnVal = testClass .test (arg);
          catch (Exception e)
             returnVal = e .toString();
          return returnVal;
    TestClass.java is
    public class TestClass
       public String test (String arg)
          return arg + " : [Jar object has modified string]";
    Now. TestClass is in a seperate jar. When TestStandClient :: test  is called i get a -4000 error. From the readme in the Java example file it is described as ....
    Error
    reading returned string
    The
    string returned from Java was corrupt. Verify that the return type of the Java
    method is a string value.
    I have noticed if I take out the call to the object in the jar file then everything works ok.
    Could it be a classpath problem? the StartJVM has its classpath
    pointing at the folder where the jar is and also at where the
    TestStandClient class file is. I also set the classpath for the Java
    step to be the same (location of jar and class file)
    So, can someone inform me of what support TestStand has for java? Does it support communicating with a class file that itself depends on other JAR files? This is surely the case?
    thanks in advance

    Dear PCR Barry,
    I am afraid that I must agree with my colleague Kostas, who replied to your first teststand post. These are very tricky, indepth issues, and will require quite significant investigation. Furthermore, it will be very difficult for us to answer via the forums as we will likely need more input from yourself. As previously suggested, if you have a Standard Service Program (SSP), you can generate a Service Request by calling or e-mailing your local branch.
    Thank you for your time, and I am sorry that I have been unable to help you further,
    Best wishes,
    Rich R
    Applications Engineer
    National Instruments UK & Ireland

Maybe you are looking for

  • 0_FI_AR_4 Modeling question

    Hi , How does one model a solution in BW for getting a correct  historical update of open and closed items from 0fi_ar_4. Imagine that the data is staged upward from write optimized dso to a std. dso and going up the cube. Now at the datamart level,

  • The mara table in join statement takes 6 min...

    hi all, i want to reduce the runtime for this statement... it is taking nearly 6 min in the mara table itself... plz help... SELECT mara~matnr mara~mfrpn mara~prdha mchb~werks mchb~charg            mchb~lgort mchb~ersda mchb~clabs mchb~ceinm mchb~csp

  • Transaction to see the Open stock transfer order for the plant

    HI , i need to develop one report in that client to make the report for the all open stock transfer order & the cost of the open stock transfer order for the plant . I need how to cretae the stock transfer order for the material , whci material maste

  • Creation of Sequences in Oracle

    Hi If i want to create large number of sequences around 30 to 35 sequences in a single database,Is there any performance down in oracle server or any limitation? Please explain if so ! As in next project we are going to create around 30 to 35 sequenc

  • How to restore site in iWeb?

    Hello. My name is ALeks. I have an issue with my site and I need an advice how to minimise my recovery job. I reinstalled Mac OS X and did not save my site. I want my system to be virgin. I saved all my work (files) of course for future, except files