[ https://issues.apache.org/jira/browse/JUDDI-1005?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17038099#comment-17038099 ]
Amol Bhonsle commented on JUDDI-1005: ------------------------------------- Yes [~spyhunter99], that is correct. Everything is fine for JUDDI-3.0.4. upgrade attempt from 3.0.4 to 3.3.7 does not go through. We tried to follow steps as per documentation of Open JPA 2.3.0 but JUDDI DB schema does not update accordingly. As I mentioned in description, we tried following option in persistence.xml as per guidelines from OpenJPA <property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(SchemaAction='drop,add')"/> this drops tables of JUDDI-3.0.4 but does not recreate when tomcat comes up and deploy JUDDI with version 3.3.7. I have gone through documentation for uddi migration tool but did not get any way to get this done. Can you help me here if I missed any specific step which will update DB for JUDDI ? I know we can have a manual step to drop tables of JUDDI-3.0.4 and when tomcat will come up, as per schema definitions of 3.3.7, new tables will get created, but we cannot drop tables manually as we have multi-client and dynamic deployment kind of product. > Need To have correct options to upgrade JUDDI DB Schema > ------------------------------------------------------- > > Key: JUDDI-1005 > URL: https://issues.apache.org/jira/browse/JUDDI-1005 > Project: jUDDI > Issue Type: Bug > Components: juddi-tomcat > Affects Versions: 3.3.6, 3.3.7 > Reporter: Amol Bhonsle > Priority: Major > > 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 tables and create > new tables as per juddi-3.3.7 schema but it did not work: > <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)