attempting to combine Tuscany photo-gallery app and Jackrabbit FirstHops style 
app
----------------------------------------------------------------------------------

                 Key: JCR-1713
                 URL: https://issues.apache.org/jira/browse/JCR-1713
             Project: Jackrabbit
          Issue Type: Bug
          Components: jackrabbit-core
    Affects Versions: core 1.4.5
         Environment: Windows Vista
Eclipse 3.3.0
Java 1.6.0_03
            Reporter: Angela Cymbalak
            Priority: Minor


The Tuscany init method fires which is supposed to call the 
TransientRepository() constructor.  The repository is never created and the 
application never finishes the init method once the contrstuctor is called.  I 
put System.out statements throughout the TransientRepository(final String, 
final String) constructor to narrow down where the issue was.  In the FirstHops 
app, the strings printed as expected.  When run in the Tuscany app, none of the 
strings printed.

Code:

   public TransientRepository(final String config, final String home)
            throws IOException {
        this(new RepositoryFactory() {
            public RepositoryImpl getRepository() throws RepositoryException {
                try {
                    // Make sure that the repository configuration file exists
                        System.out.println("1");
                    File configFile = new File(config);
                    System.out.println("2");
                    if (!configFile.exists()) {
                        System.out.println("3");
                        logger.info("Copying default configuration to " + 
config);
                        System.out.println("4");
                        OutputStream output = new FileOutputStream(configFile);
                        try {
                            System.out.println("5");
                            InputStream input =
                                TransientRepository.class.getResourceAsStream(
                                        DEFAULT_REPOSITORY_XML);
                            System.out.println("6");
                            byte[] buffer = new byte[BUFFER_SIZE];
                            System.out.println("7");
                            try {
                                System.out.println("8");
                                int n = input.read(buffer);
                                System.out.println("9");
                                while (n != -1) {
                                    System.out.println("10");
                                    output.write(buffer, 0, n);
                                    System.out.println("11");
                                    n = input.read(buffer);
                                    System.out.println("12");
                                }
                                System.out.println("13");
                            } finally {
                                System.out.println("14");
                               input.close();
                            }
                        } finally {
                            System.out.println("15");
                            output.close();
                        }
                    }
                    // Make sure that the repository home directory exists
                    System.out.println("16");
                    File homeDir = new File(home);
                    System.out.println("17");
                    if (!homeDir.exists()) {
                        System.out.println("18");
                        logger.info("Creating repository home directory " + 
home);
                        System.out.println("19");
                        homeDir.mkdirs();
                    }
                    // Load the configuration and create the repository
                    System.out.println("20");
                    RepositoryConfig rc = RepositoryConfig.create(config, home);
                    System.out.println("21");
                    return RepositoryImpl.create(rc);
                } catch (IOException e) {
                    System.out.println("22");
                    throw new RepositoryException(
                            "Automatic repository configuration failed", e);
                } catch (ConfigurationException e) {
                    System.out.println("23");
                    throw new RepositoryException(
                            "Invalid repository configuration: " + config, e);
                }
            }
        });
    }

This is also listed as a Tuscany issue as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to