私はMaven-spring-hibernateをモジュラーアプローチのWebアプリケーションに使用しており、さまざまなコンポーネントのJARファイルを用意し、最後にそれらをWebアプリケーションに構築しています。
次のJARには、プロパティファイル(database.properties
、ユーザー名/パスワード付き)を含むMETA-INFフォルダーが含まれています。
common-model-1.0.0.jar
他のコンポーネントJARもあり、これらもデータベース接続を使用しています。
common-service-1.0.0.jar
master-1.0.0.jar
master-model-1.0.0.jar
master-service-1.0.0.jar
コマンドライン(catalina start / stop)から開始したTomcatにデプロイすると、アプリケーションは完全に機能します。
しかし、Sysdeo Eclipse Tomcatプラグインを使用してEclipse内からTomcatを実行すると、次の例外がスローされます。
Could not obtain connection to query metadata java.sql.SQLException: ORA-01005: null password given; logon denied
見逃したかもしれない設定はありますか?
jpaログをデバッグすると次のようになります
09:27:47,765 DEBUG [org.springframework.jndi.JndiTemplate] - Looking up JNDI object with name [dev.username]
09:27:47,765 DEBUG [org.springframework.jndi.JndiPropertySource] - JNDI lookup for name [dev.username] threw NamingException with message: Name dev.username is not bound in this Context. Returning null.
09:27:47,765 DEBUG [org.springframework.core.env.PropertySourcesPropertyResolver] - Searching for key 'dev.username' in [systemProperties]
09:27:47,765 DEBUG [org.springframework.core.env.PropertySourcesPropertyResolver] - Searching for key 'dev.username' in [systemEnvironment]
09:27:47,765 DEBUG [org.springframework.core.env.PropertySourcesPropertyResolver] - Could not find key 'dev.username' in any property source. Returning [null]
09:27:47,765 DEBUG [org.springframework.core.env.PropertySourcesPropertyResolver] - Searching for key 'dev.username' in [localProperties]
09:27:47,766 DEBUG [org.springframework.core.env.PropertySourcesPropertyResolver] - Found key 'dev.username' in [localProperties] with type [String] and value 'cms_ownr'
09:27:47,766 DEBUG [org.springframework.core.env.PropertySourcesPropertyResolver] - Searching for key 'dev.password' in [environmentProperties]
09:27:47,766 DEBUG [org.springframework.core.env.PropertySourcesPropertyResolver] - Searching for key 'dev.password' in [servletConfigInitParams]
09:27:47,766 DEBUG [org.springframework.core.env.PropertySourcesPropertyResolver] - Searching for key 'dev.password' in [servletContextInitParams]
09:27:47,766 DEBUG [org.springframework.core.env.PropertySourcesPropertyResolver] - Searching for key 'dev.password' in [jndiProperties]
09:27:47,766 DEBUG [org.springframework.jndi.JndiTemplate] - Looking up JNDI object with name [java:comp/env/dev.password]
09:27:47,766 DEBUG [org.springframework.jndi.JndiLocatorDelegate] - Converted JNDI name [java:comp/env/dev.password] not found - trying original name [dev.password]. javax.naming.NameNotFoundException: Name dev.password is not bound in this Context
09:27:47,766 DEBUG [org.springframework.jndi.JndiTemplate] - Looking up JNDI object with name [dev.password]
09:27:47,766 DEBUG [org.springframework.jndi.JndiPropertySource] - JNDI lookup for name [dev.password] threw NamingException with message: Name dev.password is not bound in this Context. Returning null.
09:27:47,767 DEBUG [org.springframework.core.env.PropertySourcesPropertyResolver] - Searching for key 'dev.password' in [systemProperties]
09:27:47,767 DEBUG [org.springframework.core.env.PropertySourcesPropertyResolver] - Searching for key 'dev.password' in [systemEnvironment]
09:27:47,767 DEBUG [org.springframework.core.env.PropertySourcesPropertyResolver] - Could not find key 'dev.password' in any property source. Returning [null]
09:27:47,767 DEBUG [org.springframework.core.env.PropertySourcesPropertyResolver] - Searching for key 'dev.password' in [localProperties]
09:27:47,767 DEBUG [org.springframework.core.env.PropertySourcesPropertyResolver] - Found key 'dev.password' in [localProperties] with type [String] and value 'cms_ownr'