Maven Web应用程序 - 通过sysdeo插件运行Tomcat而不检索.properties

时间:2012-04-18 04:02:12

标签: java eclipse tomcat plugins

我正在使用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'

1 个答案:

答案 0 :(得分:0)

最后我的问题得到解决。

我用tomcat 6.x进行了日食。

我正在使用Sysdeo tomcatPluginV32.zip

现在我安装了最新的Sysdeo tomcatPluginV33.zip,现在工作正常。