Amol Bhonsle created OPENJPA-2804:
-------------------------------------

             Summary: Need To have correct OpenJPA options to upgrade JUDDI DB 
Schema
                 Key: OPENJPA-2804
                 URL: https://issues.apache.org/jira/browse/OPENJPA-2804
             Project: OpenJPA
          Issue Type: Bug
          Components: jpa
    Affects Versions: 2.3.0
            Reporter: Amol Bhonsle


This issue, I am logging as related issue for Apache JUDDI-3.3.7.
https://issues.apache.org/jira/browse/JUDDI-1005

We are trying to update JUDDI DB from JUDDI-3.0.4 to JUDDI-3.3.7. JUDDI DB is 
hosted on SQL Server. We use openjpa-2.3.0 which is provided by juddi-3.3.7 
distribution.

As per openjpa-2.3.0 documentation:

drop option of SchemaTool should do following:

drop: Drop all schema components in the schema XML. Tables will only be dropped 
if they would have 0 columns after dropping all columns listed in the XML.

and add option should do following:

add: This is the default action if you do not specify one. It brings the schema 
up-to-date with the given XML document by adding tables, columns, indexes, etc. 
This action never drops any schema components.

Also it is allowed in persistence.xml to use options as comma separated, so we 
tried following option in persistence.xml to drop old juddi tables and create 
new tables as per juddi-3.3.7 schema but it did not work:

our persistence.xml has following property :
<property name="openjpa.jdbc.SynchronizeMappings" 
value="buildSchema(SchemaAction='drop,add')"/>

 

This gives following Exception when JUDDI is deployed by tomcat :


{code:java}
SEVERE: Exception sending context initialized event to listener instance of 
class org.springframework.web.context.ContextLoaderListenerSEVERE: Exception 
sending context initialized event to listener instance of class 
org.springframework.web.context.ContextLoaderListenerorg.springframework.beans.factory.BeanCreationException:
 Error creating bean with name 'inquiry': Cannot create inner bean '(inner 
bean)#fa6535a' of type [org.apache.juddi.api.impl.UDDIInquiryImpl] while 
setting constructor argument; nested exception is 
org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name '(inner bean)#fa6535a': Instantiation of bean failed; nested 
exception is org.springframework.beans.BeanInstantiationException: Failed to 
instantiate [org.apache.juddi.api.impl.UDDIInquiryImpl]: Constructor threw 
exception; nested exception is <openjpa-2.3.0-r422266:1540826 nonfatal general 
error> org.apache.openjpa.persistence.PersistenceException: The object 
'PK_j3_clerk_5609ADDDCF01D08E' is dependent on column 'clerk_name'. {stmnt 
1807668378 ALTER TABLE j3_clerk DROP COLUMN clerk_name} [code=5074, 
state=S0001] at 
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:389)
 at 
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:134)
 at 
org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:691)
 at 
org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:196)
 at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1358)
 at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1204)
 at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:557)
 at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)
 at 
org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323)
 at 
org.springframework.beans.factory.support.AbstractBeanFactory$$Lambda$208/1654431226.getObject(Unknown
 Source) at 
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
 at 
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321)
 at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
 at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:879)
 at 
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:878)
 at 
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550)
 at 
org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:401)
 at 
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:292)
 at 
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:103)
 at 
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5118)
 at 
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5641)
 at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1015)
 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:991) at 
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652) at 
org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1296) at 
org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:2038)
 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:1142) 
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
at java.lang.Thread.run(Thread.java:745)
{code}
 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to