[英]How to edit the Oracle 11G settings for PostgreSQL
我有一個jar文件,可以在數據庫(即Oracle 11G)中上載資源文件。 我想創建一個Jar文件,該文件在PostgreSQL中上傳文件,但是出現以下錯誤。
這是我的上下文文件:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName"><value>org.postgresql.Driver</value></property>
<property name="url"><value>jdbc:postgresql://localhost:5432/DBNAME</value></property>
<property name="username"><value>NAEM</value></property>
<property name="password"><value>Ulol</value></property>
</bean>
<bean id="sessionFactoryExt" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="lobHandler" ref="defaultLobHandler"></property>
<property name="mappingResources">
<list>
<value>
file1.hbm.xml
</value>
<value>file2.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.PostgreSQLDialect
</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.connection.release_mode">
auto
</prop>
</props>
</property>
</bean>
<bean id="defaultLobHandler" class="org.springframework.jdbc.support.lob.DefaultLobHandler" />
<bean id="ResourceUploader" class="com.proj.ResourceUploader" scope="prototype">
<property name="locationFolder" value="my folder local"></property>
<!-- properties for module jars movement -->
<property name="modulesReleaseFolder" value="my folder local"></property>
<property name="jbossRootFolder" value="my folder local"></property>
<property name="sourceTargetFolder">
<map> <entry key="artifacts" value="com/proj/main"></entry>
<entry key="runtime" value="com/proj/main"></entry>
<entry key="lsb" value="com/proj/main"></entry>
<entry key="thirdparty-artifacts" value="com/proj/main"></entry>
</map> </property>
<property name="moduleBackUpRequired" value="true"></property>
<property name="excemptedResourceTypes">
<list>
<value>Cert</value>
</list>
</property>
<property name="sessionFactory" ref="sessionFactoryExt"></property>
<property name="resource">
<map>
<entry>*LOTS OF ENTRIES (RESOURCE FILEs)*</entry>
</map>
</property>
<property name="wflow">
<list>....</list>
</property>
</bean>
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory"><ref bean="sessionFactoryExt"/></property>
</bean>
<aop:config>
<aop:pointcut id="resourceUploader"
expression="execution(* com.ResourceUploader.*(..))" />
<aop:advisor pointcut-ref="resourceUploader"
advice-ref="defaultTxAdvice" />
</aop:config>
<tx:advice id="defaultTxAdvice">
<tx:attributes>
<tx:method name="*"/>
</tx:attributes>
</tx:advice>
</beans>
錯誤:
org.hibernate.exception.SQLGrammarException:無法在org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)的org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)處執行查詢在org.hibernate.loader.Loader.list的.loader.Loader.doList(Loader.java:2216)在org.org.hibernate.loader.Loader.list(Loader.java:2099)的IgnoreQueryCache(Loader.java:2104)。 org.hibernate.impl.SessionImpl.list(SessionImpl.java:1569)的org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283)的hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:94)在com.unisys.stealth.framework.services.resourceconfig.serviceobject.ResourceUploader.uploadWorkflowTemplate(ResourceUploader.java:183)在sun.reflect.NativeMethodAccessorImpl.invoke0(本機方法)在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java: 62)在java.lang.re的sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) org.springframework.aop.support.aopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)的org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)的flect.Method.invoke(Method.java:498)在org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)在org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)在org.springframework.aop.framework.ReflectiveMethodInvocation.proceed在org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)在org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)在org.springframework處(ReflectiveMethodInvocation.java:172)。位於com.sun.proxy。$ Proxy2.uploadWorkflowTemplate(未知源)的com.unisys.stealth.framework.services.resourc上的aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) econfig.serviceobject.StartUpload.main(StartUpload.java:86)原因:org.postgresql.util.PSQLException:錯誤:關系“ tbl_fr_workflow_config”不存在位置:349在org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse( org.postgresql.core.v3上的QueryExecutorImpl.java:2440)org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308)上的org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2183)在org.postgresql.jdbc org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)(位於org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:143)處的org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:143)處的。 org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186)的org.hibernate.loader.Loader.getResultSet(Loader.java:1787)的jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:106) org.hibernate.loader.Loader.doQueryAndInitializeNo上的.loader.Loader.doQuery(Loader.java:674) org.hibernate.loader.Loader.doList(Loader.java:2213)的nLazyCollections(Loader.java:236)...還有20個
PostgreSQL的Spring XML Datasourse配置
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context"
xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:task="http://www.springframework.org/schema/task"
xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.2.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.2.xsd">
<context:component-scan base-package="com.example.*" />
<tx:annotation-driven/>
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="org.postgresql.Driver" />
<property name="url" value="jdbc:postgresql://localhost:5432/dbname" />
<property name="username" value="postgres" />
<property name="password" value="" />
<property name="connectionProperties">
<props>
<prop key="socketTimeout">10</prop>
</props>
</property>
</bean>
<bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource"></property>
<property name="annotatedClasses">
<list>
<value>com.example.model.ExampleClass</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</prop>
<prop key="hibernate.show_sql">true</prop>
</props>
</property>
</bean>
<bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager"
p:sessionFactory-ref="sessionFactory">
</bean>
</beans>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.