Problem parsing XML with schema when extracted from a jar file

I am having a problem parsing XML with a schema, both of which are extracted from a jar file. I am using using ZipFile to get InputStream objects for the appropriate ZipEntry objects in the jar file. My XML is encrypted so I decrypt it to a temporary file. I am then attempting to parse the temporary file with the schema using DocumentBuilder.parse.
I get the following exception:
org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element '<root element name>'
This was all working OK before I jarred everything (i.e. when I was using standalone files, rather than InputStreams retrieved from a jar).
I have output the retrieved XML to a file and compared it with my original source and they are identical.
I am baffled because the nature of the exception suggests that the schema has been read and parsed correctly but the XML file is not parsing against the schema.
Any suggestions?
The code is as follows:
  public void open(File input) throws IOException, CSLXMLException {
    InputStream schema = ZipFileHandler.getResourceAsStream("<jar file name>", "<schema resource name>");
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = null;
    try {
      factory.setNamespaceAware(true);
      factory.setValidating(true);
      factory.setAttribute(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
      factory.setAttribute(JAXP_SCHEMA_SOURCE, schema);
      builder = factory.newDocumentBuilder();
      builder.setErrorHandler(new CSLXMLParseHandler());
    } catch (Exception builderException) {
      throw new CSLXMLException("Error setting up SAX: " + builderException.toString());
    Document document = null;
    try {
      document = builder.parse(input);
    } catch (SAXException parseException) {
      throw new CSLXMLException(parseException.toString());
    }

I was originally using getSystemResource, which worked fine until I jarred the application. The problem appears to be that resources returned from a jar file cannot be used in the same way as resources returned directly from the file system. You have to use the ZipFile class (or its JarFile subclass) to locate the ZipEntry in the jar file and then use ZipFile.getInputStream(ZipEntry) to convert this to an InputStream. I have seen example code where an InputStream is used for the JAXP_SCHEMA_SOURCE attribute but, for some reason, this did not work with the InputStream returned by ZipFile.getInputStream. Like you, I have also seen examples that use a URL but they appear to be URL's that point to a file not URL's that point to an entry in a jar file.
Maybe there is another way around this but writing to a file works and I set use File.deleteOnExit() to ensure things are tidied afterwards.

Similar Messages

  • Persisting unexplained errors when parsing XML with schema validation

    Hi,
    I am trying to parse an XML file including XML schema validation. When I validate my .xml and .xsd in NetBeans 5.5 beta, I get not error. When I parse my XML in Java, I systematically get the following errors no matter what I try:
    i) Document root element "SQL_STATEMENT_LIST", must match DOCTYPE root "null".
    ii) Document is invalid: no grammar found.
    The code I use is the following:
    try {
    Document document;
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    factory.setValidating(true);
    factory.setNamespaceAware(true);
    DocumentBuilder builder = factory.newDocumentBuilder();
    document = builder.parse( new File(PathToXml) );
    My XML is:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <!-- Defining the SQL_STATEMENT_LIST element -->
    <xs:element name="SQL_STATEMENT_LIST" type= "SQL_STATEMENT_ITEM"/>
    <xs:complexType name="SQL_STATEMENT_ITEM">
    <xs:sequence>
    <xs:element name="SQL_SCRIPT" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    <!-- Defining simple type ApplicationType with 3 possible values -->
    <xs:simpleType name="ApplicationType">
    <xs:restriction base="xs:string">
    <xs:enumeration value="DawningStreams"/>
    <xs:enumeration value="BaseResilience"/>
    <xs:enumeration value="BackBone"/>
    </xs:restriction>
    </xs:simpleType>
    <!-- Defining the SQL_SCRIPT element -->
    <xs:element name="SQL_SCRIPT" type= "SQL_STATEMENT"/>
    <xs:complexType name="SQL_STATEMENT">
    <xs:sequence>
    <xs:element name="NAME" type="xs:string"/>
    <xs:element name="TYPE" type="xs:string"/>
    <xs:element name="APPLICATION" type="ApplicationType"/>
    <xs:element name="SCRIPT" type="xs:string"/>
    <!-- Making sure the following element can occurs any number of times -->
    <xs:element name="FOLLOWS" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    </xs:schema>
    and my XML is:
    <?xml version="1.0" encoding="UTF-8"?>
    <!--
    Document : SQLStatements.xml
    Created on : 1 juillet 2006, 15:08
    Author : J�r�me Verstrynge
    Description:
    Purpose of the document follows.
    -->
    <SQL_STATEMENT_LIST xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://www.dawningstreams.com/XML-Schemas/SQLStatements.xsd">
    <SQL_SCRIPT>
    <NAME>CREATE_PEERS_TABLE</NAME>
    <TYPE>CREATION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    CREATE CACHED TABLE PEERS (
    PEER_ID           VARCHAR(20) NOT NULL,
    PEER_KNOWN_AS      VARCHAR(30) DEFAULT ' ' ,
    PRIMARY KEY ( PEER_ID )
    </SCRIPT>
    </SQL_SCRIPT>
    <SQL_SCRIPT>
    <NAME>CREATE_COMMUNITIES_TABLE</NAME>
    <TYPE>CREATION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    CREATE CACHED TABLE COMMUNITIES (
    COMMUNITY_ID VARCHAR(20) NOT NULL,
    COMMUNITY_KNOWN_AS VARCHAR(25) DEFAULT ' ',
    PRIMARY KEY ( COMMUNITY_ID )
    </SCRIPT>
    </SQL_SCRIPT>
    <SQL_SCRIPT>
    <NAME>CREATE_COMMUNITY_MEMBERS_TABLE</NAME>
    <TYPE>CREATION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    CREATE CACHED TABLE COMMUNITY_MEMBERS (
    COMMUNITY_ID VARCHAR(20) NOT NULL,
    PEER_ID VARCHAR(20) NOT NULL,
    PRIMARY KEY ( COMMUNITY_ID, PEER_ID )
    </SCRIPT>
    </SQL_SCRIPT>
    <SQL_SCRIPT>
    <NAME>DROP_PEER_TABLE</NAME>
    <TYPE>DELETION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    DROP TABLE PEERS IF EXISTS
    </SCRIPT>
    </SQL_SCRIPT>
    <SQL_SCRIPT>
    <NAME>DROP_COMMUNITIES_TABLE</NAME>
    <TYPE>DELETION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    DROP TABLE COMMUNITIES IF EXISTS
    </SCRIPT>
    </SQL_SCRIPT>
    <SQL_SCRIPT>
    <NAME>DROP_COMMUNITY_MEMBERS_TABLE</NAME>
    <TYPE>DELETION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    DROP TABLE COMMUNITY_MEMBERS IF EXISTS
    </SCRIPT>
    </SQL_SCRIPT>
    <SQL_SCRIPT>
    <NAME>CREATE_COMMUNITY_MEMBERS_VIEW</NAME>
    <TYPE>CREATION</TYPE>
    <APPLICATION>DawningStreams</APPLICATION>
    <SCRIPT>
    CREATE VIEW COMMUNITY_MEMBERS_VW AS
    SELECT P.PEER_ID, P.PEER_KNOWN_AS, C.COMMUNITY_ID, C.COMMUNITY_KNOWN_AS
    FROM PEERS P, COMMUNITIES C, COMMUNITY_MEMBERS CM
    WHERE P.PEER_ID = CM.PEER_ID
    AND C.COMMUNITY_ID = CM.COMMUNITY_ID
    </SCRIPT>
    <FOLLOWS>CREATE_PEERS_TABLE</FOLLOWS>
    <FOLLOWS>CREATE_COMMUNITIES_TABLE</FOLLOWS>
    </SQL_SCRIPT>
    </SQL_STATEMENT_LIST>
    Any ideas? Thanks !!!
    J�r�me Verstrynge

    Hi,
    I found the solution in the following post:
    Validate xml with DOM - no grammar found
    Sep 17, 2003 10:58 AM
    The solution is to add a line of code when parsing:
    try {
    Document document;
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    factory.setValidating(true);
    factory.setNamespaceAware(true);
    factory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema");
    DocumentBuilder builder = factory.newDocumentBuilder();
    document = builder.parse( new File(PathToXml) );
    The errors are gone !!!
    J�r�me Verstrynge

  • Java.lang.UnsatisfiedLinkError: when called from a jar file

    I have a class that calls a custom dll file. If I dont package the class files and set my system PATH to the location of the DLL then the VM is able to find the dll and load it successfully.
    However, when I package the class files into a jar file, I get "java.lang.UnsatisfiedLinkError: NetworkAdapters" eventhough the system PATH is set to the correct location.
    I have also tried to packaging the dll with the class files but this has not made any difference.
    Library is called from Java as follows:
    static {
    System.loadLibrary("NetworkAdapters");
    When packaged the classes files exist in the following sub directories com\instem\hci\adapters
    Any help appreciated.

    Is it an executable Jar file?
    The the DLL needs to sit in the same folders as the Jar itself.
    (works for us).

  • Short dump error when extracting from one of the datasource in R/3 to BW

    When extracting from one of the datasource I am getting the short dump. below is the source code of the same.
    Source code extract
    Get boundaries of next TID block
    L_FROM_INDEX = L_TO_INDEX + 1.
    IF L_FROM_INDEX GT NFILL.  EXIT.  ENDIF.
    L_TO_INDEX   = L_TO_INDEX + L_BLOCK_SIZE.
    IF L_TO_INDEX GT NFILL.
      L_TO_INDEX = NFILL.
      L_BLOCK_SIZE = L_TO_INDEX - L_FROM_INDEX + 1.
    ENDIF.
    Create hashed index on TID of TID table
    CLEAR L_TH_TID_IDX.
    LOOP AT TIDTAB FROM L_FROM_INDEX TO L_TO_INDEX.
      L_S_TID_IDX-TIDIX = SY-TABIX.
      L_S_TID_IDX-TID   = TIDTAB-TID.
      COLLECT L_S_TID_IDX INTO L_TH_TID_IDX.
    ENDLOOP.
    Select TID block from STATE table
    SELECT * INTO TABLE L_T_STATE
           FROM ARFCSSTATE FOR ALL ENTRIES IN L_TH_TID_IDX
           WHERE ARFCIPID   EQ L_TH_TID_IDX-TID-ARFCIPID
             AND ARFCPID    EQ L_TH_TID_IDX-TID-ARFCPID
             AND ARFCTIME   EQ L_TH_TID_IDX-TID-ARFCTIME
             AND ARFCTIDCNT EQ L_TH_TID_IDX-TID-ARFCTIDCNT
           ORDER BY PRIMARY KEY.
    Consistence check
    DESCRIBE TABLE L_T_STATE LINES L_LINES.
    IF L_LINES NE L_BLOCK_SIZE OR
       L_LINES EQ 0.
      MESSAGE X097(SY).
    ENDIF.
    PERFORM DELETE_BATCH_JOB
            USING    L_T_STATE
            CHANGING L_S_TID1.
    Update LUW-Status und Zeit
    CLEAR L_T_STATE_IDX.
    CLEAR L_TH_TID2_IDX.
    CLEAR L_T_TID.
    LOOP AT L_T_STATE INTO L_S_STATE.
      L_S_STATE_IDX-TABIX = SY-TABIX.

    Hi Pavan,
                     This is a table space error.
    Regards,
    rahul

  • Reading an xml file from a jar file

    Short question:
    Is it possible to read an xml file from a jar file when the dtd is
    placed inside the jar file? I am using jdom (SAXBuilder) and the default
    sax parser which comes with it.
    Long Question:
    I am trying to create an enterprise archive file on Weblogic 6.1. We
    have a framework that is similar to the struts framework which uses it's
    own configuration files
    I could place the dtd files outside the jar ear file and specify the
    absolute path in an environment variable in web.xml which is
    configurable through the admin console.
    But I want to avoid this step and specify a relative path within the jar
    file.
    I have tried to use a class which implements the entityresolver as well
    as try to extend the saxparser and set the entity resolver within this
    class explicitly, but I always seem to sun into problems like:
    The setEntityresolver method does not get called or there is a
    classloader problem. i.e. JDOM complains that it cannot load My custom
    parser which is part of the application
    Vijay

    Please contact the main BEA Support team [email protected]
    They will need to check with product support to determine
    the interoperatablity of Weblogic Server with these other
    products.

  • Urgent help for processing XML stream read from a JAR file

    Hi, everyone,
         Urgently need your help!
         I am reading an XML config file from a jar file. It can print out the result well when I use the following code:
    ===============================================
    InputStream is = getClass().getResourceAsStream("conf/config.xml");
    BufferedReader br = new BufferedReader(new InputStreamReader(is));
    String line;
    while ((line = br.readLine()) != null) {
    System.out.println(line); // It works fine here, which means that the inputstream is correct
    // process the XML stream I read from above
    NodeIterator ni = processXPath("//grid/gridinfo", is);
    Below is the processXPath() function I have written:
    public static NodeIterator processXPath(String xpath, InputStream byteStream) throws Exception {
    // Set up a DOM tree to query.
    InputSource in = new InputSource(byteStream);
    DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
    dfactory.setNamespaceAware(true);
    Document doc = dfactory.newDocumentBuilder().parse(in);
    // Use the simple XPath API to select a nodeIterator.
    System.out.println("Querying DOM using " + xpath);
    NodeIterator ni = XPathAPI.selectNodeIterator(doc, xpath);
    return ni;
    It gives me so much errors:
    org.xml.sax.SAXParseException: The root element is required in a well-formed doc
    ument.
    at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1213
    at org.apache.xerces.framework.XMLDocumentScanner.reportFatalXMLError(XM
    LDocumentScanner.java:570)
    at org.apache.xerces.framework.XMLDocumentScanner$XMLDeclDispatcher.endO
    fInput(XMLDocumentScanner.java:790)
    at org.apache.xerces.framework.XMLDocumentScanner.endOfInput(XMLDocument
    Scanner.java:418)
    at org.apache.xerces.validators.common.XMLValidator.sendEndOfInputNotifi
    cations(XMLValidator.java:712)
    at org.apache.xerces.readers.DefaultEntityHandler.changeReaders(DefaultE
    ntityHandler.java:1031)
    at org.apache.xerces.readers.XMLEntityReader.changeReaders(XMLEntityRead
    er.java:168)
    at org.apache.xerces.readers.UTF8Reader.changeReaders(UTF8Reader.java:18
    2)
    at org.apache.xerces.readers.UTF8Reader.lookingAtChar(UTF8Reader.java:19
    7)
    at org.apache.xerces.framework.XMLDocumentScanner$XMLDeclDispatcher.disp
    atch(XMLDocumentScanner.java:686)
    at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentS
    canner.java:381)
    at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1098)
    at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.
    java:195)
    at processXPath(Unknown Source)
    Thank you very much!
    Sincerely Yours
    David

    org.xml.sax.SAXParseException: The root element is required in a well-formed document.This often means that the parser can't find the document. You think it should be able to find the document because your test code could. However if your test code was not in the same package as your real (failing) code, your test is no good because getResourceAsStream("conf/config.xml") is looking for that file name relative to the package of the class that contains that line of code.
    If your test code wasn't in any package, put a slash before the filename and see if that works.

  • Issues with Loading Images from a Jar File

    This code snippet basically loops through a jar of gifs and loads them into a hashmap to be used later. The images all load into the HashMap just fine, I tested and made sure their widths and heights were changing as well as the buffer size from gif to gif. The problem comes in when some of the images are loaded to be painted they are incomplete it looks as though part of the image came through but not all of it, while other images look just fine. The old way in which we loaded the graphics didn't involve getting them from a jar file. My question is, is this a common problem with loading images from a jar from an applet? For a while I had tried to approach the problem by getting the URL of the image in a jar and passing that into the toolkit and creating the image that way, I was unsuccessful in getting that to work.
    //app is the Japplet
    MediaTracker tracker = new MediaTracker(app);
    //jf represents the jar file obj, enum for looping through jar entries
    Enumeration e = jf.entries();
    Toolkit toolkit = Toolkit.getDefaultToolkit();
    //buffer for reading image stream
    byte buffer [];
    while(e.hasMoreElements())
    fileName = e.nextElement().toString();
    InputStream inputstream = jf.getInputStream(jf.getEntry(fileName));
    buffer = new byte[inputstream.available()];
    inputstream.read(buffer);
    currentIm = toolkit.createImage(buffer);
    tracker.addImage(currentIm, 0);
    tracker.waitForAll();
    images.put(fileName.substring(0, fileName.indexOf(".")), currentIm);
    } //while
    }//try
    catch(Exception e)
    e.printStackTrace();
    }

    compressed files are not the problem. It is just the problem of the read not returning all the bytes. Here is a working implementation:
    InputStream is = jar.getInputStream(entry);
    ByteArrayOutputStream os = new ByteArrayOutputStream(1024);
    try{
    byte[] buf = new byte[1024];
    int read;
    while((read = is.read(buf)) > 0) {
    os.write(buf, 0, read);
    catch(Exception e){
         e.printStackTrace();
         return null;
    image = Toolkit.getDefaultToolkit().createImage(os.toByteArray());
    This works but I think you end up opening the jar a second time and downloading it from the server again. Another way of getting the images is using the class loader:
    InputStream is = MyApplet.class.getResourceAsStream(strImageName);
    In this case, the image file needs to be at the same level than MyApplet.class but you don't get the benefit of enumerating of the images available in the jar.

  • Problem is when iam exporting the jar file the manifest file  chaning

    LogWriter.java
    MiniBrowser.java
    SendMail.java
    TestMiniBrowser.java
    iam running the site scope program ,program is running fine
    i add the mail.jar and activation.jar
    when iam Exporting the JAR file ,the Manifest files is changing with out classpath
    only showing the like this
    Manifest-Version: 1.0
    Sealed: true
    Main-Class: p1.TestMiniBrowser
    Actually i created the manifest files like this ..
    Manifest-Version: 1.0
    Sealed: true
    Class-Path: mail.jar activation.jar icsops.jar
    Main-Class: p1.TestMiniBrowser
    problem is when iam exporting the jar file the manifest file is changing then iam not able the run the jar file ..

    iam Useing Eclipse sdk3.1
    after exporing the jar the manifewst is canging but iam updating mauvally but when iam runingg the jar file
    D:\pavansitescope>set calsspath=%classpath%C:\j2sdk1.4.1_03\bin;.;
    D:\pavansitescope>set calsspath=%classpath%D:\pavansitescope\mail.jar;.;
    D:\pavansitescope>set calsspath=%classpath%D:\pavansitescope\activation.jar;.;
    D:\pavansitescope>set calsspath=%classpath%D:\pavansitescope\mail-plugin.jar;.;
    D:\pavansitescope>java -jar icsops.jar
    Arguments Usage:
    1. URL link
    2. From Address
    3. To Addresses (seperated by comma)
    4. Mail Server Host Name
    D:\pavansitescope>java -jar icsops.jar [http://69.27.230.104/SiteScope/accounts/l]
    ogin5/htdocs/Progress.html [[email protected]|mailto:[email protected]] [[email protected]|mailto:[email protected]] HYDMA
    IL03
    Exception in thread "main" java.lang.NoClassDefFoundError: javax/mail/MessagingE
    xception
    at p1.TestMiniBrowser.start(TestMiniBrowser.java:42)
    at p1.TestMiniBrowser.main(TestMiniBrowser.java:156)
    D:\pavansitescope>

  • Classpath issues when executing from a jar

    I have a jar that I built for an RMI server that has a need to access another jar. (log4j). I run the jar from the command line using:
    java -jar -Djava.rmi.server.codebase=my.jar my.jar
    and the code runs fine but when I try to add in the log4j.jar I can't find it. I have placed it in my.jar in a lib directory within my.jar, I have placed it in the current directory, I have placed it in other directories I know are on the classpath, I have done all kinds of variations with the -classpath switch on the command line and nothing works.
    How do I package, configure and/or call such that the Logger class in log4j.jar can be found by my RMI server when I execute my.jar?
    Thanks

    Running from the jar-file ignores the CLASSPATH. See Bug #4459663
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4459663
    You have a few options:
    First, you can unjar all of the jars you depend on and rejar 'em up with your jar. This is the simplest solution.
    Second, you can skip running "from the jar" and just put that jar in your CLASSPATH.
    Third, you can put jars you depend on in the $JAVA_HOME/jre/lib/ext directory.
    Fourth, you can modify the manifest to specify a classpath, and then put the libraries you depend on at the places specified.
    And, if you think There Ought To Be A Better Way, vote for the RFE!

  • Hi everybody, I am trying to create a DVD pal without menu with the program iDVD from a .mov file. Any ideas? Thanks so much.

    Hi everybody, I am trying to create a DVD pal without menu with the program iDVD from a .mov file. Any ideas? Thanks so much.

    (From fellow poster Mishmumken: )
    How to create a DVD in iDVD without menu (there are several options):
    1. Easy: Drop your iMovie in the autoplay box in iDVD's Map View, then set your autoplay item (your movie) to loop continously. Disadvantage: The DVD plays until you hit stop on the remote
    2. Still easy: If you don't want your (autoplay) movie to loop, you can create a black theme by replacing the background of a static theme with a black background and no content in the dropzone (text needs to be black as well). Disadvantage: The menu is still there and will play after the movie. You don't see it, but your disc keeps spinning in the player.
    3. Still quite easy but takes more time: Export the iMovie to DV tape, and then re-import using One-Step DVD.
    Disadvantage: One-Step DVD creation has been known to be not 100% reliable.
    4. (My preferred method) Easy enough but needs 3rd party software: Roxio Toast lets you burn your iMovie to DVD without menu - just drag the iMovie project to the Toast Window and click burn. Disadvantage: you'll need to spend some extra $$ for the software. In Toast, you just drop the iMovie project on the Window and click Burn.
    5. The "hard way": Postproduction with myDVDedit (freeware)
    Tools necessary: myDVDedit ( http://www.mydvdedit.com )
    • create a disc image of your iDVD project, then double-click to mount it.
    • Extract the VIDEO_TS and AUDIO_TS folders to a location of your choice. select the VIDEO_TS folder and hit Cmd + I to open the Inspector window
    • Set permissions to "read & write" and include all enclosed items; Ignore the warning.
    • Open the VIDEO_TS folder with myDVDedit. You'll find all items enclosed in your DVD in the left hand panel.
    • Select the menu (usually named VTS Menu) and delete it
    • Choose from the menu File > Test with DVD Player to see if your DVD behaves as planned.If it works save and close myDVDedit.
    • Before burning the folders to Video DVD, set permissions back to "read only", then create a disc image burnable with Disc Utility from a VIDEO_TS folder using Laine D. Lee's DVD Imager:
    http://lonestar.utsa.edu/llee/applescript/dvdimager.html
    Our resident expert, Old Toad, also recommends this: there is a 3rd export/share option that give better results.  That's to use the Share ➙ Media Browser menu option.  Then in iDVD go to the Media Browser and drag the movie into iDVD where you want it.
    Hope this helps!

  • Trying to drag pdf files i have and combine them into one pdf file in the account i just purchased with Adobe. when i drag a pdf file over Adobe doesn't accept it. says it can not convert this type of file. but it is an Adobe file. Do I need to change it?

    Trying to drag pdf files i have and combine them into one pdf file in the account i just purchased with Adobe. when i drag a pdf file over Adobe doesn't accept it. says it can not convert this type of file. but it is an Adobe file. Do I need to change it in some other form befor dragging it?

    Hello djensen1x,
    Could you please let me know what version of Acrobat are you using.
    Also, tell me your workflow of combining those PDF files?
    Please share the screenshot of the error message that you get.
    Hope to get your response.
    Regards,
    Anubha

  • Is there a way to control the quality of my pdf file when exporting from a .pse file?

    Is there a way to control the quality of my pdf file when exporting from a .pse file?
    Hi,
    I have 2 pages in all in a .PSE file.
    When I try to export it as .PDF, the quality is very poor. I cannot change it to a better quality.
    Please advise how I can export the file so that i can have better quality.

    Rik Ramsay wrote:
    To expand a little on what Jongware said, normally choosing vector over bitmap will decrease the filesize. If the vector art is very complex though, this will not be true.
    Yup, a logo as bitmap takes up more space than the same as a vector -- unless the vector image is bitmap heavy (think Drop Shadow, Outline Glow; these are actually bitmap effects).
    Also, check your PDF version. "Older" versions do not support live transparency, the latest do. Then again, you cannot use live transparency if you suspect your viewers may be using Mac OS X, because Apple's own PDF viewer sucks big time.

  • Images are not coming out when application running through jar file.

    I have written an application program using j2sdk1.4.1 that needs your help.
    My application folder's contents.....................
         C:\Examination\Examination.class <-----This is the main class and application's entry point.
         C:\Examination\ExamBox.class
         C:\Examination\PaperSetterBox.class
         C:\Examination\pspBox.class
         C:\Examination\epBox.class
         C:\Examination\TimerBox.class
         C:\Examination\ReportCardBox.class
         C:\Examination\HelpBox.class
         C:\Examination\AboutBox.class
         C:\Examination\Images\(some jpg & gif files)
         C:\Examination\Sounds\(some au files)
    Compilation Report:     There was no error.
    Execution Report :     Was working properly using the command:- java Examination
    Now, I created a jar file for my application in the following steps.................................
              STEP-1:          Firstly, I created a text file(mainclassInfo.txt) that contains
              the line:--     Main-Class: Examination
              This line would be automatically added to the default manifest file when I would include the                name of that text file with the command to create the jar file.
              Location of the text file I created:     C:\mainClassInfo.txt
              STEP-2:          Then I went to C:\Examination and executed the following command(by using                'Command prompt'):--------------------------------------------------------------------
    jar cmf C:\mainClassInfo.txt Examination.jar Examination.class ExamBox.class PaperSetterBox.class pspBox.class epBox.class TimerBox.class ReportCardBox.class HelpBox.class AboutBox.class Images Sounds
    Finally, I got the jar file:-     Examination.jar
    Double clicking on it application ran as it was expected.
    Then, I thought, that as all the files & folders the application needed to run properly were packaged in the jar file; I should delete all the contents of the folder 'Examination', so that no one could see or use anything of the resources easily. I did that.
    So, then it became only:-- C:\Examination\Examination.jar
    Thereafter, I tried to run the application again and there a problem occurred! The application was running, but the images, those were to be used and shown by the application were missing somehow!!
    Moreover, when I kept a copy of those 2 folders('Images' and 'Sounds') into the C:\Examination and ran the application again all the images came out normally!
    I just can't understand why it's happening so mysterious?
    I don't want to leave anything of the resources in an open place; I mean, outside of the jar file. The images should be used and shown by the application.
    Help me please!

    double post http://forum.java.sun.com/thread.jspa?threadID=582311

  • How to add multiple images to a JLabel from the jar file

    I want to add multiple images in a JLabel but the icon property only allows me to add one. I thought I could use html rendering to add the images I need by using the <img> tab, but I need to use a URL that points to the image.
    How do I point to an image inside the jar file? If I can't, is there another way to show multiple images in a JLabel from the jar file?

    Thanks, it works perfectly. It's a really smart way of fixing the problem too :)
    I also found your toggle button icon classes which is something I've also had a problem with.
    Thanks.

  • Running scripts, bat files, etc from a jar file

    Hello,
    Does anyone know of a way, or even if it is possible to run a script or batch file from a jar file?
    For instance, lets say I have a batch file that I can run from the command prompt by typing :
    myBatchFile.bat
    and now I write a very simple java app that will do the same:
    public class Test {
    public static void main(String[] args) {
    try {
    Runtime rt = Runtime.getRuntime();
    Process p = rt.exec(�myBatchFile.bat�);
    } catch (Exception e) {
    e.getMessage();
    The above app will work as long as the batch file is in the current directory, but how or can I make it work if I stick the batch file in a jar file along with the app?
    I tried using the manifest file with no luck.
    I tried creating a URI to the jar file, wrapping it in a File and then passing that File to the exec method also with no luck.
    I searched all the forums on Sun but came up with nothing.
    I performed a google search also with no luck.
    Does anyone have the answer to this? Even if I can get a definitive �No it can�t be done� answer. Although I would think that it should be able to be done.
    Thanks

    Hi,
    you cannot execute anything being inside a jar-file. The OS doesn't know anythig about jar-files and cannot look inside one to find the program/script/batch you want to execute.
    You could do a workaround by extracting the file from the jar-file before calling exec(). But normally OS dependent files should not be inside a jar-file and remain in a own directiory.
    Andre

Maybe you are looking for

  • ITunes suddenly freezes when iPhone connected

    I'm running the latest MAC os X, iTunes on a power mac G5 and all of a sudden, whenever i connect the iPhone, i get the beachball and activity monitor tells me itunes is not responding. I disconnected phone and changed the setting in iTunes to NOT au

  • Mac101 (German?); Hands on Finder Intro;

    Hello, my mother in law (60+) plans for a computer her first at all. Is there a Mac101 out in German language? And if possible a printable version too? Good old dead old OS7 Mac was shipped with a nice intro for the very first steps to use the finder

  • HAP_DOCUMENT look and feel change

    Guys, We have designed a ZHAP_DOCUMENT which is running fine when we run from portal with user defined look and feel. However, when the Manager gets a notification in UWL and he uses the link to execute the application(i.e. a workflow getting trigger

  • 10G aggregation  rule confusion

    I am confusing aggregation rule in pivot table view. What dose it control? Grand total or all the columns value? For example: When I drag Year, Month, Sales columns into the criteria area and make use of pivot table to generate report , I use aggrega

  • How can I group By Card Code? I get an error so not sure how to Group by

    SELECT T0.[CardCode], T0.[CardName], T0.[CreateDate],T0.[Balance],T1.[Name],T1.[FirstName], T1.[LastName],  T1.[Position], T1.[E_MailL], T1.[U_TWBS_CWCnType], T1.[U_TWBS_CWRptDel] FROM OCRD T0  INNER JOIN OCPR T1 ON T0.CardCode = T1.CardCode WHERE T0