如何修复 MZNG 存储库迁移到 MS SQL?
How to fix a MZNG repository migration to MS SQL?
我正在尝试将 MashZone NG (v. 10.1) 存储库从 Derby DB 更改为 Azure 中的 MSSQL。数据库已启动且 运行,SQL 脚本已执行并提交。
我的驱动是JTDS 1.3.1(推荐),我的配置如下:
/opt/softwareag/MashZoneNG/apache-tomcat/conf/context.xml
<Resource name="MashzoneNextGenRepository" auth="Container"
type="javax.sql.DataSource" maxTotal="200" maxIdle="30"
maxWaitMillis="10000" username="USER"
password="PASSWORD"
driverClassName="net.sourceforge.jtds.jdbc.Driver"
url="jdbc:jtds:sqlserver://SERVER.database.windows.net:1433/DATABASENAME"
JtaManaged = "false"/></Context>
/opt/softwareag/MashZoneNG/apache-tomcat/webapps/mashzone/WEB-INF/classes/rdJDBC.属性
#MSSQL
jdbc.driverClassName=net.sourceforge.jtds.jdbc.Driver
jdbc.url=jdbc:sqlserver://SERVER.database.windows.net:1433/DATABASENAME
jdbc.username=USER
jdbc.password=PASSWORD
jdbc.schema.name=dbo
jdbc.identifierCase=UpperCase
pool.validationQuery=select 1
尽管我按照文档进行了配置,还是出现了错误(见下文)。我预计驱动程序有问题,但昨天我创建了一个可以访问数据库的简单 java 程序。防火墙也不是此失败的原因。该错误可能来自 Spring 默认情况下随安装提供的 jars。
你能给我一个如何处理这个问题的建议吗?
2018-07-26 06:13:43,225 INFO [com.jackbe.jbp.sas.rds.impl.jdo.PersistenceManagerFactoryBean] - Closing JDO PersistenceManagerFactory
2018-07-26 06:13:43,259 ERROR [org.springframework.web.context.ContextLoader] - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.authenticationManager': Cannot resolve reference to bean 'defaultAuthenticationProvider' while setting constructor argument with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultAuthenticationProvider' defined in ServletContext resource [/WEB-INF/classes/userRepositoryApplicationContext-jdbc.xml]: Cannot resolve reference to bean 'userRepositoryAccessAdapter' while setting bean property 'userDetailsService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userRepositoryAccessAdapter' defined in ServletContext resource [/WEB-INF/classes/userRepositoryApplicationContext-jdbc.xml]: Cannot create inner bean 'com.jackbe.jbp.sas.security.usermgt.impl.DefaultUserRepository#6427e8b1' of type [com.jackbe.jbp.sas.security.usermgt.impl.DefaultUserRepository] while setting bean property 'target'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.jackbe.jbp.sas.security.usermgt.impl.DefaultUserRepository#6427e8b1' defined in ServletContext resource [/WEB-INF/classes/userRepositoryApplicationContext-jdbc.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'userAttributeProvider' threw exception; nested exception is org.springframework.transaction.CannotCreateTransactionException: Could not open JDO PersistenceManager for transaction; nested exception is java.lang.AbstractMethodError
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:359)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:382)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:157)
at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:634)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:145)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1193)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1095)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
at org.springframework.beans.factory.support.AbstractBeanFactory.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:443)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:325)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4745)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5207)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:752)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:630)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1842)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
提前致谢
需要 2 项更改才能使其正常工作:
在context.xml中添加(感谢Yogesh):validationQuery="select 1"
在 jdbc url 添加:“;ssl=require”
我正在尝试将 MashZone NG (v. 10.1) 存储库从 Derby DB 更改为 Azure 中的 MSSQL。数据库已启动且 运行,SQL 脚本已执行并提交。 我的驱动是JTDS 1.3.1(推荐),我的配置如下:
/opt/softwareag/MashZoneNG/apache-tomcat/conf/context.xml
<Resource name="MashzoneNextGenRepository" auth="Container"
type="javax.sql.DataSource" maxTotal="200" maxIdle="30"
maxWaitMillis="10000" username="USER"
password="PASSWORD"
driverClassName="net.sourceforge.jtds.jdbc.Driver"
url="jdbc:jtds:sqlserver://SERVER.database.windows.net:1433/DATABASENAME"
JtaManaged = "false"/></Context>
/opt/softwareag/MashZoneNG/apache-tomcat/webapps/mashzone/WEB-INF/classes/rdJDBC.属性
#MSSQL
jdbc.driverClassName=net.sourceforge.jtds.jdbc.Driver
jdbc.url=jdbc:sqlserver://SERVER.database.windows.net:1433/DATABASENAME
jdbc.username=USER
jdbc.password=PASSWORD
jdbc.schema.name=dbo
jdbc.identifierCase=UpperCase
pool.validationQuery=select 1
尽管我按照文档进行了配置,还是出现了错误(见下文)。我预计驱动程序有问题,但昨天我创建了一个可以访问数据库的简单 java 程序。防火墙也不是此失败的原因。该错误可能来自 Spring 默认情况下随安装提供的 jars。
你能给我一个如何处理这个问题的建议吗?
2018-07-26 06:13:43,225 INFO [com.jackbe.jbp.sas.rds.impl.jdo.PersistenceManagerFactoryBean] - Closing JDO PersistenceManagerFactory
2018-07-26 06:13:43,259 ERROR [org.springframework.web.context.ContextLoader] - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.authenticationManager': Cannot resolve reference to bean 'defaultAuthenticationProvider' while setting constructor argument with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultAuthenticationProvider' defined in ServletContext resource [/WEB-INF/classes/userRepositoryApplicationContext-jdbc.xml]: Cannot resolve reference to bean 'userRepositoryAccessAdapter' while setting bean property 'userDetailsService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userRepositoryAccessAdapter' defined in ServletContext resource [/WEB-INF/classes/userRepositoryApplicationContext-jdbc.xml]: Cannot create inner bean 'com.jackbe.jbp.sas.security.usermgt.impl.DefaultUserRepository#6427e8b1' of type [com.jackbe.jbp.sas.security.usermgt.impl.DefaultUserRepository] while setting bean property 'target'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.jackbe.jbp.sas.security.usermgt.impl.DefaultUserRepository#6427e8b1' defined in ServletContext resource [/WEB-INF/classes/userRepositoryApplicationContext-jdbc.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'userAttributeProvider' threw exception; nested exception is org.springframework.transaction.CannotCreateTransactionException: Could not open JDO PersistenceManager for transaction; nested exception is java.lang.AbstractMethodError
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:359)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:382)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:157)
at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:634)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:145)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1193)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1095)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
at org.springframework.beans.factory.support.AbstractBeanFactory.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:443)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:325)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4745)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5207)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:752)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:728)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:630)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1842)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
提前致谢
需要 2 项更改才能使其正常工作:
在context.xml中添加(感谢Yogesh):validationQuery="select 1"
在 jdbc url 添加:“;ssl=require”