Return-Path: Delivered-To: apmail-chemistry-dev-archive@www.apache.org Received: (qmail 46431 invoked from network); 22 Mar 2011 23:56:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 22 Mar 2011 23:56:47 -0000 Received: (qmail 59604 invoked by uid 500); 22 Mar 2011 23:56:47 -0000 Delivered-To: apmail-chemistry-dev-archive@chemistry.apache.org Received: (qmail 59574 invoked by uid 500); 22 Mar 2011 23:56:47 -0000 Mailing-List: contact dev-help@chemistry.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@chemistry.apache.org Delivered-To: mailing list dev@chemistry.apache.org Received: (qmail 59566 invoked by uid 99); 22 Mar 2011 23:56:47 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Mar 2011 23:56:47 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Mar 2011 23:56:42 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id E362C42DB9 for ; Tue, 22 Mar 2011 23:56:05 +0000 (UTC) Date: Tue, 22 Mar 2011 23:56:05 +0000 (UTC) From: "Joseph Vychtrle (JIRA)" To: dev@chemistry.apache.org Message-ID: <2060122210.4971.1300838165928.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1939728332.4846.1300833605931.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Reopened] (CMIS-336) Local binding with JcrServiceFactory MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CMIS-336?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Joseph Vychtrle reopened CMIS-336: ---------------------------------- Reopening, I deleted the original issue and created new one instead :-) > Local binding with JcrServiceFactory > ------------------------------------ > > Key: CMIS-336 > URL: https://issues.apache.org/jira/browse/CMIS-336 > Project: Chemistry > Issue Type: Bug > Components: opencmis-server-jcr > Affects Versions: OpenCMIS 0.3.0 > Reporter: Joseph Vychtrle > Labels: ClassNotFoundException > > Hey, there is something wrong, because the loop in JcrServiceFactory is searching for properties starting with jcr.*, but right after in RepositoryFactoryImpl it is searched for "org.apache.jackrabbit.repository.home" in the same collection of properties, that doesn't make sense. even if org.apache.jackrabbit.repository.home is there, it doesn't start with PREFIX_JCR_CONFIG so it is put into jcrConfig collection that goes to RepositoryFactoryImpl.getRepository() > {code:title=JcrServiceFactory.java|borderStyle=solid} > private void readConfiguration(Map parameters) { > Map map = new HashMap(); > List keys = new ArrayList(parameters.keySet()); > Collections.sort(keys); > /* the loop is searching for properties starting with jcr.* */ > > for (String key : keys) { > if (key.startsWith(PREFIX_JCR_CONFIG)) { > String jcrKey = key.substring(PREFIX_JCR_CONFIG.length()); > String jcrValue = replaceSystemProperties(parameters.get(key)); > map.put(jcrKey, jcrValue); > } > else if (MOUNT_PATH_CONFIG.equals(key)) { > mountPath = parameters.get(key); > log.debug("Configuration: " + MOUNT_PATH_CONFIG + '=' + mountPath); > } > else { > log.warn("Configuration: unrecognized key: " + key); > } > } > jcrConfig = Collections.unmodifiableMap(map); > log.debug("Configuration: jcr=" + jcrConfig); > } > {code} > But here the parameter Map is empty {} and it returns null; because it is searching for RepositoryFactoryImpl.REPOSITORY_HOME, which is org.apache.jackrabbit.repository.home > {code:title=RepositoryFactoryImpl.java|borderStyle=solid} > /* parameters = jcrConfig */ > public Repository getRepository(Map parameters) throws RepositoryException { > if (parameters == null) { > return getRepository(null, Collections.emptyMap()); > } else if (parameters.containsKey(REPOSITORY_HOME)) { > String home = parameters.get(REPOSITORY_HOME).toString(); > return getRepository(home, parameters); > } else if (parameters.containsKey(JcrUtils.REPOSITORY_URI)) { > Object parameter = parameters.get(JcrUtils.REPOSITORY_URI); > try { > URI uri = new URI(parameter.toString().trim()); > String scheme = uri.getScheme(); > if (("file".equalsIgnoreCase(scheme) > || "jcr-jackrabbit".equalsIgnoreCase(scheme)) > && uri.getAuthority() == null) { > File file = new File(uri.getPath()); > if (file.isFile()) { > return null; // Not a (possibly missing) directory > } else { > return getRepository(file.getPath(), parameters); > } > } else { > return null; // not a file: or jcr-jackrabbit: URI > } > } catch (URISyntaxException e) { > return null; // not a valid URI > } > } else { > return null; // unknown or insufficient parameters > } > } > {code} > {code:xml} > > > javax.jcr > jcr > 2.0 > compile > > > org.apache.jackrabbit > jackrabbit-core > 2.2.4 > compile > > > org.apache.jackrabbit > jackrabbit-api > 2.2.4 > compile > > > org.slf4j > slf4j-log4j12 > 1.5.11 > compile > > > org.testng > testng > 5.14 > jar > compile > > > > org.apache.chemistry.opencmis > chemistry-opencmis-server-jcr > 0.3.0-incubating-SNAPSHOT > classes > > > org.apache.chemistry.opencmis > chemistry-opencmis-client-bindings > 0.3.0-incubating-SNAPSHOT > > > org.apache.chemistry.opencmis > chemistry-opencmis-client-api > 0.3.0-incubating-SNAPSHOT > > > org.apache.chemistry.opencmis > chemistry-opencmis-client-impl > 0.3.0-incubating-SNAPSHOT > > > > {code} -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira