白玉兰到SQL Server 2014连接

问题描述:

我是新来的玉兰世界,并试图存储数据库而不是本地文件系统的JCR。白玉兰到SQL Server 2014连接

我使用的是Magnolia 5.4,SQLJDB42.jar和SQL Server 2014服务器相同。 我按照所有指令出席https://wiki.magnolia-cms.com/display/WIKI/Database-Only+Repositories+with+JNDI+Datasources,它的工作与MySQL服务器,但是当我试图与SQL服务器2014它给我follwoing错误是一样的:

INFO info.magnolia.cms.beans.config.ConfigLoader 26.12.2016 17:28:29 -- Initializing content repositories INFO info.magnolia.repository.DefaultRepositoryManager 26.12.2016 17:28:29 -- Loading JCR INFO info.magnolia.repository.DefaultRepositoryManager 26.12.2016 17:28:29 -- Loading JCR magnolia INFO info.magnolia.jackrabbit.ProviderImpl 26.12.2016 17:28:29 -- Loading repository at C:\Users\665564\MagnoliaRepositories\author\repositories\magnolia (config file: C:\Users\665564\magnolia-5.5\apache-tomcat-8.5.5\webapps\magnoliaAuthor\WEB-INF\config\repo-conf\jackrabbit-bundle-mssql-search-pm.xml) - cluster id: "<unset>" DEBUG info.magnolia.jackrabbit.ProviderImpl 26.12.2016 17:28:29 -- No JNDI bound Repository found with name magnoliaAuthor, trying to initialize a new Repository ERROR org.apache.jackrabbit.core.util.db.ConnectionHelper 26.12.2016 17:28:31 -- Failed to execute SQL (stacktrace on DEBUG log level): com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near '$'

然后,我也做了硬编码

INFO info.magnolia.init.MagnoliaServletContextListener 27.12.2016 13:50:06 -- Property sources loaded [DefaultMagnoliaConfigurationProperties with sources: [SystemPropertySource][ServletContextPropertySource from WEB-INF/config/magnoliaAuthor/magnolia.properties [ServletContextPropertySource from WEB-INF/config/magnoliaAuthor/magnolia.properties [ServletContextPropertySource from WEB-INF/config/default/magnolia.properties][ModulePropertiesSource from modules [core, dam, freemarker-support, lang-el, activation, categorization-support, ce-product-descriptor, imaging-support, resource-loader, rest-client, rest-integration, cache, config, i18n, rest-services, dam-jcr, ehcache, rendering, ui-framework, appswitcher, imaging, resteasy-client, scheduler, templating, ui-mediaeditor, resources, task-management, templating-jsp, ui-admincentral, about-app, cache-app, groovy, inplace-templating, log-tools, mail, messages-app, pages, resources-app, sample-app, security-app, site, ui-contentapp, cache-browser-app, contacts, dam-app, dam-imaging, dam-templating, definitions-app, form, google-sitemap, jcr-browser-app, jcr-tools, mte-imaging, site-app, mte, public-user-registration, forum, mtk, rssaggregator, categorization, commenting, lang-da, lang-ar, lang-cs, lang-de, lang-es, lang-fi, lang-fr, lang-he, lang-hr, lang-hu, lang-id, lang-it, lang-ja, lang-nl, lang-no, lang-pl, lang-pt, lang-pt_BR, lang-ru, lang-sk, lang-sq, lang-sv, lang-tr, lang-zh_CN, lang-zh_TW, travel-demo, tours, lang-ko, webapp]][InitPathsPropertySource]] INFO info.magnolia.cms.beans.config.ConfigLoader 27.12.2016 13:50:06 -- Initializing content repositories INFO info.magnolia.repository.DefaultRepositoryManager 27.12.2016 13:50:06 -- Loading JCR INFO info.magnolia.repository.DefaultRepositoryManager 27.12.2016 13:50:06 -- Loading JCR magnolia INFO info.magnolia.jackrabbit.ProviderImpl 27.12.2016 13:50:06 -- Loading repository at C:\Users\665564\magnolia-5.5\apache-tomcat-8.5.5\webapps\magnoliaAuthor\repositories\magnolia (config file: C:\Users\665564\magnolia-5.5\apache-tomcat-8.5.5\webapps\magnoliaAuthor\WEB-INF\config\repo-conf\jackrabbit-bundle-mssql-search.xml) - cluster id: "<unset>" WARN org.apache.jackrabbit.core.config.ConfigurationErrorHandler 27.12.2016 13:50:06 -- Warning parsing the configuration at line 4 using system id file:/C:/Users/665564/magnolia-5.5/apache-tomcat-8.5.5/webapps/magnoliaAuthor/WEB-INF/config/repo-conf/jackrabbit-bundle-mssql-search.xml: org.xml.sax.SAXParseException; systemId: file:/C:/Users/665564/magnolia-5.5/apache-tomcat-8.5.5/webapps/magnoliaAuthor/WEB-INF/config/repo-conf/jackrabbit-bundle-mssql-search.xml; lineNumber: 4; columnNumber: 32; Attribute "name" must be declared for element type "DataSources". WARN org.apache.jackrabbit.core.config.ConfigurationErrorHandler 27.12.2016 13:50:06 -- Warning parsing the configuration at line 11 using system id file:/C:/Users/665564/magnolia-5.5/apache-tomcat-8.5.5/webapps/magnoliaAuthor/WEB-INF/config/repo-conf/jackrabbit-bundle-mssql-search.xml: org.xml.sax.SAXParseException; systemId: file:/C:/Users/665564/magnolia-5.5/apache-tomcat-8.5.5/webapps/magnoliaAuthor/WEB-INF/config/repo-conf/jackrabbit-bundle-mssql-search.xml; lineNumber: 11; columnNumber: 17; The content of element type "DataSources" must match "(DataSource)*". ERROR info.magnolia.jackrabbit.ProviderImpl 27.12.2016 13:50:07 -- Unable to initialize repository: Unable to create or lock file C:\Users\665564\magnolia-5.5\apache-tomcat-8.5.5\webapps\magnoliaAuthor\repositories\magnolia\.lock javax.jcr.RepositoryException: **Unable to create or lock file C:\Users\665564\magnolia-5.5\apache-tomcat-8.5.5\webapps\magnoliaAuthor\repositories\magnolia\.lock** at org.apache.jackrabbit.core.util.RepositoryLock.tryLock(RepositoryLock.java:155) at org.apache.jackrabbit.core.util.RepositoryLock.acquire(RepositoryLock.java:138).

PFB,我repository.xml文件的细节,这是一个默认的文件我没有CH:所有的路径变量(如${wsp.home}),现在我得到下面提到的错误安格东西在于:

​​

当我与bindName="magnoliaAuthor"和绝对路径试过configFile & magnolia.repositories.home,它给了我下面提到的错误:

INFO info.magnolia.cms.beans.config.ConfigLoader 28.12.2016 16:30:40 -- Initializing content repositories INFO info.magnolia.repository.DefaultRepositoryManager 28.12.2016 16:30:40 -- Loading JCR INFO info.magnolia.repository.DefaultRepositoryManager 28.12.2016 16:30:40 -- Loading JCR magnolia INFO info.magnolia.jackrabbit.ProviderImpl 28.12.2016 16:30:40 -- Loading repository at C:\Users\665564\magnolia-5.5\apache-tomcat-8.5.5\webapps\magnoliaAuthor\repositories\magnolia (config file: C:/Users/665564/magnolia-5.5/apache-tomcat-8.5.5/webapps/magnoliaAuthor/WEB-INF/config/repo-conf/jackrabbit-bundle-mssql-search.xml) - cluster id: "<unset>" DEBUG info.magnolia.jackrabbit.ProviderImpl 28.12.2016 16:30:40 -- No JNDI bound Repository found with name magnoliaAuthor, trying to initialize a new Repository ERROR org.apache.jackrabbit.core.util.db.ConnectionHelper 28.12.2016 16:30:42 -- Failed to execute SQL (stacktrace on DEBUG log level): com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near '$'. ERROR org.apache.jackrabbit.core.util.db.ConnectionHelper 28.12.2016 16:30:42 -- Failed to execute SQL (stacktrace on DEBUG log level): com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near '$'. ERROR org.apache.jackrabbit.core.fs.db.DatabaseFileSystem 28.12.2016 16:30:42 -- failed to initialize file system com.microsoft.sqlserver.jdbc.SQLServerException: **Incorrect syntax near '$**'.

请指教。

在此先感谢。

+0

你可以在这里粘贴你的'repository.xml'吗? – Ducaz035

+0

你好,我已经添加了repository.xml文件的问题本身,因为我无法在这里添加评论,请咨询 –

+0

嗨Ducaz035,请问你在哪里采取'$'的建议,因为我已经删除了所有'从repo-config.xml以及从repository.xml也可以找到'$'符号。 –

这里有很多错误。

首先,你

No JNDI bound Repository found with name magnoliaAuthor

让你的JNDI连接不能被发现。你在哪里配置它?在tomcat配置文件中?首先检查它是否已经配置并正确命名。我的猜测是,你要么在配置JNDI或jackrabbit-bundle-mssql-search

其次提到它时,删除所有的变量后作出的错误,你的错误是

jackrabbit-bundle-mssql-search.xml; lineNumber: 4; columnNumber: 32; Attribute "name" must be declared for element type "DataSources".

所以发生了什么事是,当错误地编辑了第4行的xml文件中删除了太多或插入错误的字符,并且文件现在具有无效的语法。

我注意到的另一件事是日志文件是指两个不同的文件 - jackrabbit-bundle-mssql-search-pm.xmljackrabbit-bundle-mssql-search.xml。除非你故意这样做,否则这又是一个错误?无论如何,如果上述两个提示无助于解决您的问题,则此文件的内容很可能至关重要。

+0

非常感谢Jan,我弄错了,在'jackrabbit-bundle-mssql-search.xml'文件中,我正在使用 for SQL服务器2014年,但我必须使用现在它工作正常。 –