Issue with unbinding of configurations from old jars

Hi,
We have a setup where we deploy some of the business services and configurations (Java code) into CQ5 so that they can be managed through Apache console.
We are facing a problem where if we deploy a new version of the jar, the configurations still continue to get binded with the old version of the jar and we need manually unbind and bind the configurations.
We have tried the following but in vain:
Deleting the old jars from /apps/<application name>/install folder.
Deleting the bundles from the Apache console and deploying the new jars
Please note that we do not have any custom activators for the bundles, but rather rely on OSGi dependency management to start up the services and configurations.
What I wanted to check with the group is if someone has faced a similar issue and if you are aware of the resolution for the same.
Ashish

Hello Ashish,
Ideally you should not require to do that. But some points as suggestion
1. When you build the bundle does it says your deployment is successful because it may happen that it built but not deployed, for that just check your error.log also for each deployment console update corresponding log information in error.log only.
2. also check the last modification time for your bundle deployed in felix console under "bundles" tab.
As yogesh suggested managing service configuration through osgiConfig is better approach as it give you flexibility (no hot deployment for each changes) and helps you to manage services better.
Thanks,
Pawan

Similar Messages

  • Issue with Executing OS commands from Stored Procedure

    I am trying to execute the scripts provided at :
    http://github.com/xtender/XT_SHELL
    provided by xtender user.
    As required, I have asked my DBAs to grant privileges by executing the following scripts:
    Begin
      --change to needed permissions and execute
      dbms_java.grant_permission( 'ODS', 'SYS:java.io.FilePermission', '/var/factiva/ODS/bin/CVIM_Rpt_ExportCSVFile’, 'read,write,execute' );
    end;
    /where CVIM_Rpt_ExportCSVFile is my script residing in the Unix server where my Oracle is installed.
    The error I am facing when I try to execute the following command is:
    select * from table(xt_shell.shell_exec('/var/scripts/CVIM_Rpt_ExportCSVFile',100))
    Exception:the Permission (java.io.FilePermission /var/scripts/CVIM_Rpt_ExportCSVFile execute) has not been granted to ODS. The PL/SQL to grant this is dbms_java.grant_permission( 'ODS', 'SYS:java.io.FilePermission', '/var/scripts/CVIM_Rpt_ExportCSVFile', 'execute' )I have asked my DBA to also execute the following scripts: - But I still see the same error as above. I am not able to figure out whats going on. Can anyone pls help me out??
    EXEC Dbms_Java.Grant_Permission('ODS', 'SYS:java.lang.RuntimePermission', 'writeFileDescriptor', '');
    EXEC Dbms_Java.Grant_Permission(ODS', 'SYS:java.lang.RuntimePermission', 'readFileDescriptor', '');
    dbms_java.grant_permission( 'ODS', 'SYS:java.io.FilePermission', '/var/scripts/CVIM_Rpt_ExportCSVFile', 'execute' )

    DUPLICATE
    ===============================================================
    Issue with Executing OS commands from Stored Procedure
    ==============================================================

  • Is there an issue with streaming videos direct from itunes? I

    Is there an issue with streaming videos direct from itunes? I have good wifi but films just buffer , doesn't happen on flixster on netflix , wonder if there is any tweak to watch a film uninterrupted , because it is very frustrating? Thanks

    Apple appears to be having trouble with the iTunes Store servers right now.
    (81070)

  • Issue with opening pdf file from web browser

    I have Acrobat Pro ver 6 and Adobe Reader 9.1 on a computer.  when my user tries to open up a pdf from the web he is getting the following error message:
    "The Adobe Acrobat/Reader that is running can not be used to view PDF files in a WEb Browser.  Adbe Acrobat/Reader version 8 or 9 is required.  Please exit and try again."
    What also happens is that Acrobat Pro ver 6 opens up and nothing is there.
    I am not sure why he is getting that message since Reader 9.1 is installed.
    Can any one shed some light on this for me.
    This user needs to have Acrobat and Reader on his system.  I understand that there are issues with having both.
    Also he has it set up so that any PDF is opening using the Reader 9.1.
    Thanks,

    Your PC's default reader configuration for embedded PDFs has become confused, due to multiple Adobe PDF document solutions installed on one PC.
    Solution 1:
    Go to Start > Run
    Type regedit and click OK.
    Browse to the following key: HKEY_CLASSES_ROOT\Software\Adobe\Acrobat\Exe
    Make sure that the correct Default data value is set for the path where Adobe Reader or Acrobat are installed.
    The default installation values are:
    "C:\Program Files\Adobe\Reader 9.0\Reader\AcroRd32.exe"
    or
    "C:\Program Files\adobe\acrobat 6.0\acrobat\Acrobat.exe" (not sure about this path.  Check on your PC to be sure)
    depending on whether Adobe Reader or Adobe Acrobat is installed.
    Solution 2:
    Configure the browser to use Acrobat or Adobe Reader as a helper application.
    If you are using Firefox to browse the web, you can change this setting in Firefox by going to:
    Tools > Options
    Click on the "Applications" Tab.
    The first item in the list should be "Adobe Acrobat Document".  Under the Action list, click the drop down arrow and select the application you want to read PDFs within the web browser.  Click OK, and you should be done.
    If you're using Internet Explorer to view PDFs, try the below steps.
    After you configure Acrobat or Adobe Reader as a helper application, the browser starts the helper application in a separate window and displays PDF files within that window. Acrobat and Adobe Reader both include a preference that lets you specify Acrobat or Adobe Reader as the helper application.
    To configure Acrobat or Adobe Reader as a helper application:
    Start Acrobat or Adobe Reader.
    Choose Edit > Preferences.
    Select Internet on the left.
    Deselect Display PDF In Browser Using [Acrobat application], and then click OK.
    Quit Acrobat or Adobe Reader.
    The next time you select a link to a PDF file in the browser, a dialog box asks what you would like to do with the file. If you select Open It, the browser opens the PDF file in Acrobat or Adobe Reader (the helper application); if you select Save It To Disk, the browser saves the PDF file to your hard drive.

  • Issue with opening PDF files from the web Acrobat 8.1.4

    Hello everyone
    I just found out about this problem today, and it manifests in such a manner that when you try to open a PDF document on the web, it hangs for a while, and then the standard message about Adobe Acrobat not being able to open the document comes up, and after you OK away that you get the message that the program shuts down.
    If I download the PDF itself and open it locally it works. Is there any known issue with updates recently that creates this problem?
    The system is running on Windows 7 32-bits, and Adobe Acrobat is a part of the CS3 Master Collection.
    Greetings from Alexander

    Not supported file type can (but not always) mean the PDF was created with an old enough version of Acrobat, that it isn't comaptible with reader X or XI.
    Might have been damaged is pretty cut and dried in its meaning and interpretation.
    There's a known issue with Mac OS and Safari Browser "breaking" PDFs as they download, but it's not so common for Windows. Since these are files you already had, it would be even less applicable.
    You can try downloading an older version of Reader to check if it's a compatibility issue, but you'd have to uninstall the latest to do it and it'd be a lot of bother if they still don't open. It would also mean they are "broken" and cannot be repaired, that I know of.

  • Issues with upgrading Hyperion HFM from 11.1.2 to 11.1.2.1

    Hi,
    After the recent release of Hyperion 11.1.2.1, we upgraded our development environment to 11.1.2.1 from 11.1.2.
    Installation and configuration was smooth straight forward [ We used the Maintenance upgrade while installing 11.1.2.1 ].
    We migrated the application created from 11.1.2 to 11.1.2.1 using copy App. We saw following issues.
    1. We are unable to run consolidation and we get following Error: “An unknown error has occurred in the HsvData2 object”
    2. Every time when we login to HFM workspace and run reports we see database authentication window, we have to enter admin credentials for first time.
    3. We are unable to load a Rule File in 11.1.2.1, which was loaded successfully in 11.1.2.
    Any details on the above issues or on the upgrade from 11.1.2 to 11.1.2.1 would be of great help.
    Thanks and Regards,
    Bhargav

    I am going to throw out the most unexciting reply ever, but .... the answer probably lies in the 11.1.2.1 readme.
    V25453-01 From : https://edelivery.oracle.com/EPD/Download/get_form?egroup_aru_number=13638318
    Consolidation
    When running a consolidation, the following error may occur: “An unknown error has occurred in the HsvData2 object” with a description of: “Value violated the integrity constraints for a column or table” and the following problem: “Cannot insert duplicate key in object”. To resolve this error, delete invalid records.
    I didn't look at the other issues; however, once again, I think the answers are most likely contained in the readmes.
    Charles

  • Issue with getting sequance number from db in EO for a primary key column

    Hello Experts,
    we are working on ADf 11.1.1.2.
    we are facing issue with sequence number in our UAT instance.
    dev instance and sit instances did not gave any issues.
    We have one EO in that for one attribute we have given the value as
    new oracle.jbo.server.SequenceImpl("XXOZF_QA_CODE_S", object.getDBTransaction())).getSequenceNumber()
    in order to get the primary key column value from db sequance .
    <TransientExpression><![CDATA[(
    new oracle.jbo.server.SequenceImpl("XXOZF_QA_CODE_S", object.getDBTransaction())).getSequenceNumber()
    ]]></TransientExpression>
    now the issue is "I have incremented the sequence number through SQL plus from 10 to 20. And created a record on a VO which is based on above EO.
    But the sequence iam getting is 11 instead of 21."
    This is happening only in our uat instance all other instances are working fine.
    Can any one tell us how this frame work is still pointing tho the old sequnce number.
    regards
    Gayaz

    Also make sure that your sequence has NOCYCLE option.
    some thing like this:
    CREATE SEQUENCE test_seq
    START WITH 1
    INCREMENT BY 1
    NOCACHE
    NOCYCLE;

  • Move configure from old ASA to new ASA 5515x?

    Dear All,
    Could you let me know how can i move my configuration from ASA 5510 v.8.0 to the new ASA 5515-x V9.1.1?
    i used copy running to TFTP and apply to the new ASA but it has some error like nat and Certificate.
    could i export my certificate the old ASA and import to the new ASA, that are different version. Does has any solution without donwtime ?
    Best Regards,
    Rechard

    Rechard
    I do not believe that there is a way to do the transition from old ASA running 8.0 to new ASA running 9.1 without some downtime. But is is possible to minimize the downtime. I have recently done a transition like that and it was not an easy one. As you have discovered if you attempt to copy the old config to the new ASA it will reject as invalid syntax much of the access lists and all of the nat.
    The easier way to do the transition is to have an ASA running the old code with the old config and to upgrade that ASA to 9.1. In this process the 9.1 code should read the config from startup and will do a conversion to the new syntax. I have done this going from 8.0 to 8.4 and see no reason why 9.1 would be different. You then only need to check the accuracy of the conversion. And then you can take the converted config and load it on the new ASA. In my recent conversion we did not have an extra ASA with old code, the new ASA does not support the old version, and the downtime to do this on the existing ASA was not acceptable. So I took the access lists and nat and did a manual translation from old to new. I loaded the modified config on the new ASA and did some checking. We then just switched connections from old ASA to new ASA and the downtime was minimal.
    HTH
    Rick

  • Syncing issues with a new computer, while old computer is dead

    Ok, So when I first purchased the iPod Nano 3rd generation, I still lived at my parents and set everything up through their computer. I bought music, and imported music to it from CD's on this computer and everything synced correctly and nicely.
    Now, I have sinced moved out and have a new computer which I have authorized, but cannot import any of the music I imported from my CD's a few years back. On top of it, I have purchased music from my new computer, but cannot sync it directly to my iPod to actually listen too for whatever reason. The final issue is that my parent's computer is completely dead, so I cannot even go on that one to deauthorize.
    Is there any way that I can get the music I have purchased recently to transfer over to my iPod? And, is there a way I can get the music I copied from old CD's into my new library on the new computer?

    Try this:
    Error: Activation Server Unavailable | CS2, Acrobat 7, Audition 3
    Just be aware that CS2 is very old software and will NOT work on current versions of either Macintosh or Windows computers. For example, it's incompatible with Mavericks on a Mac and Windows 8.

  • Issues with Indirect xml configuration using environment variable

    My package is not retrieving the the connection strings from the xml file setup through indirect configuration. It is using the connection string directly from the connection manager in the package. Steps below,
    Package-1 has Connection Manager with server : dev, database: Test
    Setup indirect xml configuration : XML file contains the connection string. Environment variable contains the path to the xml.
    Build and deploy on different server (prod).
    Create the same environment variable in prod server.
    Change conenction string in xml file.
    Run the package: package tries to connect to dev instead of prod.
    Change the connection string in the connection manager directly in the package. Build and deploy. Works now - connects to prod as expected.
    For some reason my package is not reading from the xml file.
    Anonymous

    You posted on this issue before and now again, why?
    The "It is using the connection string directly from the connection manager in the package" means the package fails to configure from the conn string in the env. variable.
    You may see it as a warning in the log if you have one enabled.
    The env variable should have the path to the config file, the config file should be parametrized to get the connection to it via the variable, this is the proper scenario.
    Arthur My Blog

  • Issues with Synchronize to and from DB (version 3.3.0.747)

    Having an issue with syncing the model and the data dictionary is a very specific case:
    1. Reverse engineer an existing table (T1)
    2. Copy the table (in data modeler) - T2
    3. Rename the table, make changes (add columns and keys)
    4. Forward engineer the new table (i.e., export and run DD for T2L)
    5. Make additional changes to new table (T2) in data model.
    6. Run sync db with model - the sync routine compares my new table (t2) to the original table (T1) in the database! It cannot "find" my new table (T2) in the database to compare to.
    7. Alternatively try to sync the model with the db - this time it wants to sync the original table (T1) to itself (which has no change) and DROP my new table (T2) from the model.
    It appears that sync is looking at meta data one my new table (T2) that contains the original copied table's name (T1). And in fact if I look at the table Summary properties - the source db object property does list the original table name (T1).
    I also tried to reverse engineer the new table (T2) to the merge with the model, that has the same behavior as the sync.
    Is there a way to fix this short of dropping T1 from the schema?
    Edited by: Kent Graziano on May 20, 2013 2:37 PM

    Hi Kent,
    thanks for reporting the problem. I logged a bug and ER for that.
    Is there a way to fix this short of dropping T1 from the schema?Unnecessary information about source need to be cleared. Here is a script that will help on that:
    //array with 2 elements to illustrate different use cases - the first is used to have exact match on table name
    // the second one ("REGIO") can be used with following check in inList function
    //if(table.getName().startsWith(list)){
    var list = ["Regionsv1","REGIO"];
    function isInList(table){
         for(var i=0;i<list.length;i++){
              // different approaches to match table name can be used
              // be aware of letter case
              //if(table.getName().startsWith(list[i])){
              if(table.getName().equalsIgnoreCase(list[i])){
                   return true;
         return false;
    function clearSourceStampforTable(table){
         clearSourceStamp(table);
         cols = table.getElements();
         for(var i=0;i<cols.length;i++){
              clearSourceStamp(cols[i]);
         keys = table.getKeySet().toArray();
         for(var i=0;i<keys.length;i++){
              clearSourceStamp(keys[i]);
              if(keys[i].isFK()){
                   clearSourceStamp(keys[i].getFKIndexAssociation());
    function clearSourceStamp(object){
         object.setSourceConnName("");
         object.setSourceObjSchema("");
         object.setSourceObjName("");
         object.setSourceDDLFile("");
         object.setDirty(true);
    tables = model.getTableSet().toArray();
    for(var i=0;i<tables.length;i++){
         table = tables[i];
         if(isInList(table)){
              clearSourceStampforTable(table);

  • PHP email form - issue with who it's from

    Hi,
    I've got a referral page on my site where the user puts in their details and a friends details and the form fires off a email to the friend. The form is in HTML and posts it to a PHP file. The problem is I get in the email for who it's from:
    from
    "Scott Bradshaw"@server74.ukservers.net
    I don't want the
    @server74.ukservers.net
    in their.
    Is this an issue with PHP files and forms or is their a way round it? I know I could do a mailto: form but don't want to. What are my options?
    Thanks, Scott

    I'm making the website for someone and they had the hosting set up already but thanks for telling me. I think this is right what I've done:
    function detectSuspect($val, &$ok) {
      if (preg_match('/Content-Type:|Cc:|Bcc:/i', $val)) {
        $ok = false;
    $YourName = Trim(stripslashes($_POST['YourName']));
    $YourEmail = Trim(stripslashes($_POST['YourEmail']));
    $RefName = Trim(stripslashes($_POST['RefName']));
    $RefEmail = Trim(stripslashes($_POST['RefEmail']));
    $EmailFrom = $YourEmail;
    $Subject = $RefName;
    $EmailTo = $RefEmail;
    // validation
    $validationOK=true;
    detectSuspect($YourName, $validationOK);
    detectSuspect($YourEmail, $validationOK);
    detectSuspect($RefName, $validationOK);
    detectSuspect($RefEmail, $validationOK);
    if (!$validationOK) {
      print "<meta http-equiv=\"refresh\" content=\"0;URL=error.html\">";
      exit;
    // prepare email body text
    $Body = "Hi $RefName,
    $YourName thought you would be interested in viewing this online video called A
    tale of 2 customers (< 3 mins).
    www.easybench.org/ataleof2customers3";
    $Body2 = "";
    $Body2 .= "User Name: ";
    $Body2 .= $YourName;
    $Body2 .= "\n";
    $Body2 .= "User Email: ";
    $Body2 .= $YourEmail;
    $Body2 .= "\n";
    $Body2 .= "Referral Name: ";
    $Body2 .= $RefName;
    $Body2 .= "\n";
    $Body2 .= "Referral Email: ";
    $Body2 .= $RefEmail;
    $Body2 .= "\n";
    // send email
    $success = mail($EmailTo, $Subject, $Body, "From: $EmailFrom<$EmailFrom>");
    mail("[email protected]", "Referral details", $Body2, "From: [email protected]");
    // redirect to success page
    if ($success){
      print "<meta http-equiv=\"refresh\" content=\"0;URL=thankyou2.html\">";
    else{
      print "<meta http-equiv=\"refresh\" content=\"0;URL=error.html\">";
    ?>
    I've also got a feedback form thing too, the script above wouldn't work for it I guess as it's protecting against different thing but what's the best way to protect the feedback form? I've heard of a honeypot thing where create hidden form field.
    Thanks, Scott

  • Issue with MSSQL server connectivity from ODI 10.1.3

    Hi,
    In one of the interface we are populating data to target table in MSSQL server version 2005.
    The physical topology connection results successful.
    Since so long there is no problem and it is running successful. But suddenly I'm facing issues with this.
    I cannot see teh datastores under the model created for this table. When expanding the model, when trying to reverse the model or when I am trying to save any changes in the package I am getting the below error.
    java.lang.UnsupportedClassVersionError: com/microsoft/sqlserver/jdbc/SQLServerDriver (Unsupported major.minor version 49.0)
         at java.lang.ClassLoader.defineClass0(Native Method)
         at java.lang.ClassLoader.defineClass(Unknown Source)
         at java.security.SecureClassLoader.defineClass(Unknown Source)
         at java.net.URLClassLoader.defineClass(Unknown Source)
         at java.net.URLClassLoader.access$100(Unknown Source)
         at java.net.URLClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClassInternal(Unknown Source)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Unknown Source)
         at com.sunopsis.sql.SnpsConnection.a(SnpsConnection.java)
         at com.sunopsis.sql.SnpsConnection.u(SnpsConnection.java)
         at com.sunopsis.sql.SnpsConnection.connect(SnpsConnection.java)
         at com.sunopsis.dwg.reverse.Reverse.a(Reverse.java)
         at com.sunopsis.graphical.component.b.a.g.a(g.java)
         at com.sunopsis.graphical.component.b.a.g.a(g.java)
         at com.sunopsis.graphical.component.b.a.d.a(d.java)
         at com.sunopsis.graphical.component.b.h.e(h.java)
         at com.sunopsis.graphical.component.b.h.b(h.java)
         at com.sunopsis.graphical.component.b.h.b(h.java)
         at com.sunopsis.graphical.component.b.h.b(h.java)
         at com.sunopsis.graphical.component.b.h.a(h.java)
         at com.sunopsis.graphical.frame.module.SnpsSplitFrame.refreshSplitFrame(SnpsSplitFrame.java)
         at com.sunopsis.graphical.frame.module.SnpsSplitFrame.refreshNode(SnpsSplitFrame.java)
         at com.sunopsis.graphical.frame.bp.bN(bp.java)
         at com.sunopsis.graphical.frame.bp.bL(bp.java)
         at com.sunopsis.graphical.frame.a.is.bH(is.java)
         at com.sunopsis.graphical.frame.bo.r(bo.java)
         at com.sunopsis.graphical.frame.bo.bv(bo.java)
         at com.sunopsis.graphical.frame.bo.z(bo.java)
         at com.sunopsis.graphical.frame.bo.b(bo.java)
         at com.sunopsis.graphical.frame.w.actionPerformed(w.java)
         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
         at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
         at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
         at java.awt.Component.processMouseEvent(Unknown Source)
         at java.awt.Component.processEvent(Unknown Source)
         at java.awt.Container.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Window.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    I have verified below:
    The SQL server version is: MSSQL server 2005
    the "sqljdbc.jar" file is there in place "<ORACLE_HOME>/oracledi/drivers"
    Java version: jdk1.5.0
    There is no change in source or target db. Please help me to fix this issue

    Hi,
    Thanks for the reply. The link is helpful and its the same what is there in the environment.
    "The JDK version is 1.5 and JRE version is 1.4.2."
    But, this was working fine till last week. I am worried, if the issue is due to version compatability why we were not facing this issue before. There is no changes in the environment since go live of this interface.
    Thanks,

  • Issue with sent items disappearing from Outlook

    We are having an issue with many of our users who have had their sent items disappear from Outlook. We are running Exchange 2010 SP2 with Rollup 8. All users on Windows 7 appear to be working fine, it is just users on XP that are having the issue. All
    PCs are SP3 with updates applied. The messages were there previously, but the Sent folder shows empty as of Monday. They show correctly in OWA, it is just in Outlook itself that is the problem. If we enable cached mode the items populate, but our standard
    policy is to run online with no local PST. We have tried running Outlook with /clearviews and in Safe Mode, but this does not resolve the issue.

    Hi,
    From your description, all the sent items are correct in OWA. So the Exchange Server is ok.
    About this issue, I recommend you install all the latest Windows updates and check the result.
    Hope it helps.
    If there are any problems, please feel free to let me know.
    Best regards,
    Amy
    Amy Wang
    TechNet Community Support

  • 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.

Maybe you are looking for