Notice: In order to edit this ticket you need to be either: a Product Owner, The owner or the reporter of the ticket, or, in case of a Task not yet assigned, a team_member"

User Story #138 (closed)

Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

Improper setting of database URI

Reported by: anonymous Owned by: jamoore
Priority: minor Milestone: 3.0-M2
Component: Deployment Keywords: iteration2
Cc: Story Points: n.a.
Sprint: n.a. Importance: n.a.
Total Remaining Time: n.a. Estimated Remaining Time: n.a.

Description

Currently the "java omero setup" Ant task does not properly set the hibernate.connection.url. It appears to use the application server host instead of the database host.

Change History (7)

comment:1 Changed 13 years ago by cxallan

Further, I'm having issues running itests now:

org.springframework.beans.factory.access.BootstrapException: Unable to return specified BeanFactory instance: factory key [ome.server], from group with resource name [classpath*:beanRefContext.xml]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ome.server' defined in URL [file:/Users/callan/cvs/OMERO3/components/server/target/classes/beanRefContext.xml]: Cannot resolve reference to bean 'ome.internal' while setting constructor argument with index 2; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ome.internal' defined in URL [file:/Users/callan/cvs/OMERO3/components/server/target/classes/beanRefContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.FatalBeanException: Could not instantiate class [ome.system.OmeroContext]; constructor threw exception; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Error registering bean with name 'dataSource' defined in class path resource [ome/services/dbcp.xml]: Could not resolve placeholder 'config_hibernate.connection.password'
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ome.server' defined in URL [file:/Users/callan/cvs/OMERO3/components/server/target/classes/beanRefContext.xml]: Cannot resolve reference to bean 'ome.internal' while setting constructor argument with index 2; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ome.internal' defined in URL [file:/Users/callan/cvs/OMERO3/components/server/target/classes/beanRefContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.FatalBeanException: Could not instantiate class [ome.system.OmeroContext]; constructor threw exception; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Error registering bean with name 'dataSource' defined in class path resource [ome/services/dbcp.xml]: Could not resolve placeholder 'config_hibernate.connection.password'
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ome.internal' defined in URL [file:/Users/callan/cvs/OMERO3/components/server/target/classes/beanRefContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.FatalBeanException: Could not instantiate class [ome.system.OmeroContext]; constructor threw exception; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Error registering bean with name 'dataSource' defined in class path resource [ome/services/dbcp.xml]: Could not resolve placeholder 'config_hibernate.connection.password'
org.springframework.beans.FatalBeanException: Could not instantiate class [ome.system.OmeroContext]; constructor threw exception; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Error registering bean with name 'dataSource' defined in class path resource [ome/services/dbcp.xml]: Could not resolve placeholder 'config_hibernate.connection.password'
org.springframework.beans.factory.BeanDefinitionStoreException: Error registering bean with name 'dataSource' defined in class path resource [ome/services/dbcp.xml]: Could not resolve placeholder 'config_hibernate.connection.password'
	at org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.processProperties(PropertyPlaceholderConfigurer.java:244)
	at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:75)
	at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:400)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:313)
	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:87)
	at ome.system.OmeroContext.<init>(OmeroContext.java:76)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:174)
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:78)
	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:156)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:538)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:377)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:241)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:152)
	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:186)
	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
	at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:324)
	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:97)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:538)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:377)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:241)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:152)
	at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:606)
	at org.springframework.beans.factory.access.SingletonBeanFactoryLocator.useBeanFactory(SingletonBeanFactoryLocator.java:399)
	at ome.system.OmeroContext.getInstance(OmeroContext.java:131)
	at ome.system.OmeroContext.getManagedServerContext(OmeroContext.java:122)
	at ome.server.itests.AbstractManagedContextTest.getContext(AbstractManagedContextTest.java:62)
	at org.springframework.test.AbstractDependencyInjectionSpringContextTests.setUp(AbstractDependencyInjectionSpringContextTests.java:192)
	at ome.io.nio.itests.PixbufCreationUnitTest.adaptSetUp(PixbufCreationUnitTest.java:58)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:552)
	at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:318)
	at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:152)
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:361)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:778)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:105)
	at org.testng.TestRunner.privateRun(TestRunner.java:682)
	at org.testng.TestRunner.run(TestRunner.java:566)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:220)
	at org.testng.SuiteRunner.run(SuiteRunner.java:146)
	at org.testng.eclipse.runner.RemoteTestNG.run(RemoteTestNG.java:98)
	at org.testng.eclipse.runner.RemoteTestNG.main(RemoteTestNG.java:138)

Am I just doing something wrong here? Missing some config?

comment:2 Changed 13 years ago by cxallan

etc/local.properties file:

#
# This file was generated by the configure task at 20060530 1303
#
server.host=localhost
server.port=1099
omero.user=callan
omero.pass=${config_omero.pass}
hibernate.connection.username=callan
hibernate.connection.password=secret
database.host=warlock
database.name=omero3
#
# postgres profile
#
hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
hibernate.connection.driver_class=org.postgresql.Driver
hibernate.connection.url=jdbc\:postgresql\://warlock/omero3

Replaced the ${config_hibernate.connection.password} in the hibernate.connection.password property with "secret" and things appear to work.

What's the story with this whole thing?

comment:3 Changed 13 years ago by jmoore

This is actually a bigger Java PITA. The comments in setup.xml give the fuller story. See:

http://issues.apache.org/bugzilla/show_bug.cgi?id=33354

Basically, you have to manually set the user passwords because there's no way to turn off character echoing.

Perhaps we should change that default value to: CHANGE_ME. Agree?

comment:4 Changed 13 years ago by jmoore

r694 adds CHANGE_ME. Closeable, or is it still tricky on new/old checkouts?

comment:5 Changed 13 years ago by cxallan

What about the original issue? (The improper setting of hibernate.connection.url)

comment:6 Changed 13 years ago by anonymous

  • Resolution set to fixed
  • Status changed from new to closed

Tricky but closed by r696.

Scopes are a known issue in ant. (1.7 might bring some new hope.) What was happening is that setup.xml was essentially trying to redefine a property value through a couple layers of re(mis-)direction. This un-redefined value was then being passed along.

comment:7 Changed 13 years ago by jmoore

  • Keywords iteration2 added
  • Milestone changed from Unscheduled to cycle1
  • Version changed from 3.0-M2 to 3.0-M1
Note: See TracTickets for help on using tickets. You may also have a look at Agilo extensions to the ticket.

1.3.13-PRO © 2008-2011 Agilo Software all rights reserved (this page was served in: 0.75866 sec.)

We're Hiring!