IBM Worklight - 尝试部署应用程序/适配器时出错

时间:2013-09-12 10:02:38

标签: ibm-mobilefirst worklight-studio worklight-adapters

我使用Phpmyadmin(xampp服务器)创建了一个数据库。

  

数据库名称='数据库'
用户名='用户'

密码为空。当我尝试更改worklight.properties文件时,它说了一些 Poolable连接错误:

  

[ERROR] SRVE0315E:发生了一次执行:   com.ibm.ws.webcontainer.webapp.WebAppErrorReport:   javax.servlet.ServletException:未初始化的Worklight项目   com.worklight.core.auth.impl.AuthenticationFilter.doFilter(AuthenticationFilter.java:110)     在   com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:194)     at [internal classes]引起:javax.servlet.ServletException:   Worklight项目未初始化...另外4个

每当我调用适配器或部署应用程序时,它都会显示:

  

应用程序错误SRVE0777E:应用程序类抛出的异常   'com.worklight.core.auth.impl.AuthenticationFilter.doFilter:110'   javax.servlet.ServletException:未初始化Worklight项目

     

在   com.worklight.core.auth.impl.AuthenticationFilter.doFilter(AuthenticationFilter.java:110)   在   com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:194)   在[内部课程]

当我点击com.worklight.core.auth.impl.AuthenticationFilter.doFilter(AuthenticationFilter.java:110)行时,它显示缺少.jar文件。

it shows the some jar file missing.

worklight.properties

wl.db.type=MYSQL 
wl.db.url=jdbc:mysql://localhost:3306/database
wl.reports.db.username=root
wl.reports.db.password=

Adapter.xml

<connectivity>
        <connectionPolicy xsi:type="sql:SQLConnectionPolicy">
            <!-- Example for using a JNDI data source, replace with actual data source name -->
            <!-- <dataSourceJNDIName>java:/data-source-jndi-name</dataSourceJNDIName> -->

            <!-- Example for using MySQL connector, do not forget to put the MySQL connector library in the project's lib folder -->
            <dataSourceDefinition>
                <driverClass>com.mysql.jdbc.Driver</driverClass>
                <url>jdbc:mysql://localhost:3306/database</url>

                <user>root</user>
                <password></password> 

            </dataSourceDefinition>
        </connectionPolicy>

适配器-impl.js

var selectStatement = WL.Server.createSQLStatement("SELECT * FROM users;");

function getAuths() {

    return WL.Server.invokeSQLStoredProcedure({
        procedure : getAuths,
        parameters : []
    });
}
部署应用程序时

完成错误消息:

    Launching worklight (WebSphere Application Server 8.5.5.0/wlp-1.0.3.20130524-0951) on Java HotSpot(TM) 64-Bit Server VM, version 1.7.0_25-b17 (en_US)
    [AUDIT   ] CWWKE0001I: The server worklight has been launched.
    [AUDIT   ] CWWKZ0058I: Monitoring dropins for applications. 
    [AUDIT   ] CWWKT0016I: Web application available (default_host): http://lpch2-ee206922.sasken.com:10080/WorklightStarter_jQueryMobile/
    [err] 261  WorklightPU  WARN   [Scheduled Executor-thread-1] openjpa.Runtime - An error occurred while registering a ClassTransformer with PersistenceUnitInfo: name 'WorklightPU', root URL [file:/C:/Users/ee206922/Documents/WorklightServerConfig/shared/resources/worklight-jee-library-6.0.0.jar]. The error has been consumed. To see it, set your openjpa.Runtime log level to TRACE. Load-time class transformation will not be available.
    [WARNING ] Using empty value for configuration property 'ssl.keystore.path'
    [WARNING ] Using empty value for configuration property 'ssl.keystore.password'
    [err] 4055  WorklightPU  INFO   [Scheduled Executor-thread-1] openjpa.Runtime - Starting OpenJPA 1.2.2
    [err] 4579  WorklightPU  INFO   [Scheduled Executor-thread-1] openjpa.jdbc.JDBC - Using dictionary class "org.apache.openjpa.jdbc.sql.HSQLDictionary".
    [err] 1  WorklightReportsPU  WARN   [Scheduled Executor-thread-1] openjpa.Runtime - An error occurred while registering a ClassTransformer with PersistenceUnitInfo: name 'WorklightReportsPU', root URL [file:/C:/Users/ee206922/Documents/WorklightServerConfig/shared/resources/worklight-jee-library-6.0.0.jar]. The error has been consumed. To see it, set your openjpa.Runtime log level to TRACE. Load-time class transformation will not be available.
    [AUDIT   ] CWWKZ0001I: Application WorklightStarter_jQueryMobile started in 24.574 seconds.
    [AUDIT   ] CWWKT0016I: Web application available (default_host): http://proxy-22.eksi.com:10080/ProjectKen2/
    [ERROR   ] FWLSE0188E: Failed to connect to MYSQL database : Cannot create PoolableConnectionFactory (Access denied for user 'Worklight'@'localhost' (using password: YES)) [project ProjectKen2]
    [ERROR   ] FWLST0003E: ========= Failed starting project /ProjectKen2 [project ProjectKen2]
    Error creating bean with name 'txManager' defined in URL [wsjar:file:/C:/Users/ee206922/Documents/WorklightServerConfig/shared/resources/worklight-jee-library-6.0.0.jar!/conf/core.xml]: Cannot resolve reference to bean 'brokerSessionFactory' while setting bean property 'entityManagerFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'brokerSessionFactory' defined in URL [wsjar:file:/C:/Users/ee206922/Documents/WorklightServerConfig/shared/resources/worklight-jee-library-6.0.0.jar!/conf/spring-server-core.xml]: Cannot resolve reference to bean 'rssBrokerDS' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'rssBrokerDS' defined in URL [wsjar:file:/C:/Users/ee206922/Documents/WorklightServerConfig/shared/resources/worklight-jee-library-6.0.0.jar!/conf/spring-server-core.xml]: Cannot resolve reference to bean 'worklight-direct' while setting bean property 'targetDataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'worklight-direct' defined in URL [wsjar:file:/C:/Users/ee206922/Documents/WorklightServerConfig/shared/resources/worklight-jee-library-6.0.0.jar!/conf/spring-server-core.xml]: Invocation of init method failed; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Access denied for user 'Worklight'@'localhost' (using password: YES))
    [ERROR   ] SRVE0283E: Exception caught while initializing context: java.lang.RuntimeException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'txManager' defined in URL [wsjar:file:/C:/Users/ee206922/Documents/WorklightServerConfig/shared/resources/worklight-jee-library-6.0.0.jar!/conf/core.xml]: Cannot resolve reference to bean 'brokerSessionFactory' while setting bean property 'entityManagerFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'brokerSessionFactory' defined in URL [wsjar:file:/C:/Users/ee206922/Documents/WorklightServerConfig/shared/resources/worklight-jee-library-6.0.0.jar!/conf/spring-server-core.xml]: Cannot resolve reference to bean 'rssBrokerDS' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'rssBrokerDS' defined in URL [wsjar:file:/C:/Users/ee206922/Documents/WorklightServerConfig/shared/resources/worklight-jee-library-6.0.0.jar!/conf/spring-server-core.xml]: Cannot resolve reference to bean 'worklight-direct' while setting bean property 'targetDataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'worklight-direct' defined in URL [wsjar:file:/C:/Users/ee206922/Documents/WorklightServerConfig/shared/resources/worklight-jee-library-6.0.0.jar!/conf/spring-server-core.xml]: Invocation of init method failed; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Access denied for user 'Worklight'@'localhost' (using password: YES))
        at com.worklight.server.bundle.project.JeeProjectActivator.contextInitialized(JeeProjectActivator.java:146)
        at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:2220)
        at [internal classes]
    Caused by (repeated) ... : org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'txManager' defined in URL [wsjar:file:/C:/Users/ee206922/Documents/WorklightServerConfig/shared/resources/worklight-jee-library-6.0.0.jar!/conf/core.xml]: Cannot resolve reference to bean 'brokerSessionFactory' while setting bean property 'entityManagerFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'brokerSessionFactory' defined in URL [wsjar:file:/C:/Users/ee206922/Documents/WorklightServerConfig/shared/resources/worklight-jee-library-6.0.0.jar!/conf/spring-server-core.xml]: Cannot resolve reference to bean 'rssBrokerDS' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'rssBrokerDS' defined in URL [wsjar:file:/C:/Users/ee206922/Documents/WorklightServerConfig/shared/resources/worklight-jee-library-6.0.0.jar!/conf/spring-server-core.xml]: Cannot resolve reference to bean 'worklight-direct' while setting bean property 'targetDataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'worklight-direct' defined in URL [wsjar:file:/C:/Users/ee206922/Documents/WorklightServerConfig/shared/resources/worklight-jee-library-6.0.0.jar!/conf/spring-server-core.xml]: Invocation of init method failed; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Access denied for user 'Worklight'@'localhost' (using password: YES))
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
        at com.worklight.server.bundle.project.JeeProjectActivator.loadSpringConfiguration(JeeProjectActivator.java:273)
        at com.worklight.server.bundle.project.JeeProjectActivator.contextInitialized(JeeProjectActivator.java:134)
        ... 2 more
    Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Access denied for user 'Worklight'@'localhost' (using password: YES))
        at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)
        at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
        at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
        at com.worklight.server.database.api.WorklightDataSource.getConnection(WorklightDataSource.java:234)
        at com.worklight.server.database.api.WorklightDataSource.afterPropertiesSet(WorklightDataSource.java:110)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
        ... 55 more
    Caused by: java.sql.SQLException: Access denied for user 'Worklight'@'localhost' (using password: YES)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1078)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4120)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4052)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:925)
        at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1704)
        at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1250)
        at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2483)
        at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2516)
        at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2301)
        at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:834)
        at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
        at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:416)
        at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:317)
        at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
        at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
        at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556)
        at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545)
        ... 61 more

    [AUDIT   ] CWWKZ0001I: Application ProjectKen2 started in 1.638 seconds.

Launching worklight (WebSphere Application Server 8.5.5.0/wlp-1.0.3.20130524-0951) on Java HotSpot(TM) 64-Bit Server VM, version 1.7.0_25-b17 (en_US)
[AUDIT   ] CWWKE0001I: The server worklight has been launched.
[AUDIT   ] CWWKZ0058I: Monitoring dropins for applications. 
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://lpch2-ee206922.sasken.com:10080/WorklightStarter_jQueryMobile/
[err] 261  WorklightPU  WARN   [Scheduled Executor-thread-1] openjpa.Runtime - An error occurred while registering a ClassTransformer with PersistenceUnitInfo: name 'WorklightPU', root URL [file:/C:/Users/ee206922/Documents/WorklightServerConfig/shared/resources/worklight-jee-library-6.0.0.jar]. The error has been consumed. To see it, set your openjpa.Runtime log level to TRACE. Load-time class transformation will not be available.
[WARNING ] Using empty value for configuration property 'ssl.keystore.path'
[WARNING ] Using empty value for configuration property 'ssl.keystore.password'
[err] 4055  WorklightPU  INFO   [Scheduled Executor-thread-1] openjpa.Runtime - Starting OpenJPA 1.2.2
[err] 4579  WorklightPU  INFO   [Scheduled Executor-thread-1] openjpa.jdbc.JDBC - Using dictionary class "org.apache.openjpa.jdbc.sql.HSQLDictionary".
[err] 1  WorklightReportsPU  WARN   [Scheduled Executor-thread-1] openjpa.Runtime - An error occurred while registering a ClassTransformer with PersistenceUnitInfo: name 'WorklightReportsPU', root URL [file:/C:/Users/ee206922/Documents/WorklightServerConfig/shared/resources/worklight-jee-library-6.0.0.jar]. The error has been consumed. To see it, set your openjpa.Runtime log level to TRACE. Load-time class transformation will not be available.
[AUDIT   ] CWWKZ0001I: Application WorklightStarter_jQueryMobile started in 24.574 seconds.
[AUDIT   ] CWWKT0016I: Web application available (default_host): http://proxy-22.eksi.com:10080/ProjectKen2/
[ERROR   ] FWLSE0188E: Failed to connect to MYSQL database : Cannot create PoolableConnectionFactory (Access denied for user 'Worklight'@'localhost' (using password: YES)) [project ProjectKen2]
[ERROR   ] FWLST0003E: ========= Failed starting project /ProjectKen2 [project ProjectKen2]
Error creating bean with name 'txManager' defined in URL [wsjar:file:/C:/Users/ee206922/Documents/WorklightServerConfig/shared/resources/worklight-jee-library-6.0.0.jar!/conf/core.xml]: Cannot resolve reference to bean 'brokerSessionFactory' while setting bean property 'entityManagerFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'brokerSessionFactory' defined in URL [wsjar:file:/C:/Users/ee206922/Documents/WorklightServerConfig/shared/resources/worklight-jee-library-6.0.0.jar!/conf/spring-server-core.xml]: Cannot resolve reference to bean 'rssBrokerDS' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'rssBrokerDS' defined in URL [wsjar:file:/C:/Users/ee206922/Documents/WorklightServerConfig/shared/resources/worklight-jee-library-6.0.0.jar!/conf/spring-server-core.xml]: Cannot resolve reference to bean 'worklight-direct' while setting bean property 'targetDataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'worklight-direct' defined in URL [wsjar:file:/C:/Users/ee206922/Documents/WorklightServerConfig/shared/resources/worklight-jee-library-6.0.0.jar!/conf/spring-server-core.xml]: Invocation of init method failed; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Access denied for user 'Worklight'@'localhost' (using password: YES))
[ERROR   ] SRVE0283E: Exception caught while initializing context: java.lang.RuntimeException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'txManager' defined in URL [wsjar:file:/C:/Users/ee206922/Documents/WorklightServerConfig/shared/resources/worklight-jee-library-6.0.0.jar!/conf/core.xml]: Cannot resolve reference to bean 'brokerSessionFactory' while setting bean property 'entityManagerFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'brokerSessionFactory' defined in URL [wsjar:file:/C:/Users/ee206922/Documents/WorklightServerConfig/shared/resources/worklight-jee-library-6.0.0.jar!/conf/spring-server-core.xml]: Cannot resolve reference to bean 'rssBrokerDS' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'rssBrokerDS' defined in URL [wsjar:file:/C:/Users/ee206922/Documents/WorklightServerConfig/shared/resources/worklight-jee-library-6.0.0.jar!/conf/spring-server-core.xml]: Cannot resolve reference to bean 'worklight-direct' while setting bean property 'targetDataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'worklight-direct' defined in URL [wsjar:file:/C:/Users/ee206922/Documents/WorklightServerConfig/shared/resources/worklight-jee-library-6.0.0.jar!/conf/spring-server-core.xml]: Invocation of init method failed; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Access denied for user 'Worklight'@'localhost' (using password: YES))
    at com.worklight.server.bundle.project.JeeProjectActivator.contextInitialized(JeeProjectActivator.java:146)
    at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:2220)
    at [internal classes]
Caused by (repeated) ... : org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'txManager' defined in URL [wsjar:file:/C:/Users/ee206922/Documents/WorklightServerConfig/shared/resources/worklight-jee-library-6.0.0.jar!/conf/core.xml]: Cannot resolve reference to bean 'brokerSessionFactory' while setting bean property 'entityManagerFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'brokerSessionFactory' defined in URL [wsjar:file:/C:/Users/ee206922/Documents/WorklightServerConfig/shared/resources/worklight-jee-library-6.0.0.jar!/conf/spring-server-core.xml]: Cannot resolve reference to bean 'rssBrokerDS' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'rssBrokerDS' defined in URL [wsjar:file:/C:/Users/ee206922/Documents/WorklightServerConfig/shared/resources/worklight-jee-library-6.0.0.jar!/conf/spring-server-core.xml]: Cannot resolve reference to bean 'worklight-direct' while setting bean property 'targetDataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'worklight-direct' defined in URL [wsjar:file:/C:/Users/ee206922/Documents/WorklightServerConfig/shared/resources/worklight-jee-library-6.0.0.jar!/conf/spring-server-core.xml]: Invocation of init method failed; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Access denied for user 'Worklight'@'localhost' (using password: YES))
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
    at com.worklight.server.bundle.project.JeeProjectActivator.loadSpringConfiguration(JeeProjectActivator.java:273)
    at com.worklight.server.bundle.project.JeeProjectActivator.contextInitialized(JeeProjectActivator.java:134)
    ... 2 more
Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Access denied for user 'Worklight'@'localhost' (using password: YES))
    at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549)
    at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
    at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
    at com.worklight.server.database.api.WorklightDataSource.getConnection(WorklightDataSource.java:234)
    at com.worklight.server.database.api.WorklightDataSource.afterPropertiesSet(WorklightDataSource.java:110)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
    ... 55 more
Caused by: java.sql.SQLException: Access denied for user 'Worklight'@'localhost' (using password: YES)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1078)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4120)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4052)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:925)
    at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1704)
    at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1250)
    at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2483)
    at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2516)
    at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2301)
    at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:834)
    at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
    at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:416)
    at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:317)
    at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
    at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
    at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556)
    at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545)
    ... 61 more

[AUDIT   ] CWWKZ0001I: Application ProjectKen2 started in 1.638 seconds.

3 个答案:

答案 0 :(得分:1)

要明确:您创建的数据库是什么意思?它是否适用于Worklight Server的数据库,或者它是否适合您的适配器连接的某些服务的后端?

  • 如果它不适用于Worklight Server,而是某些后端,请不要触摸worklight.properties。
  • 否则,请编辑问题并解释该部分。

请同时查看IBM Worklight Getting Startedthis training modulesample app),以熟悉Worklight中的各种概念和选项。

最后,看看以下帮助:

  1. 确保您在worklight.properties中输入的用户名和密码值正确

    • 您对worklight.properties的引用仅显示报告数据库的用户名和密码,而不是Worklight Server的引用 - 这只是在我上面的问题之后发生的<
      li
    • 为什么要在报告数据库中添加用户名/密码?您是否为报告创建了数据库?我觉得你需要修改训练模块。

  2. 确保MySQL JDBC Connector / J驱动程序.jar文件位于您的Project \ server \ lib中

  3. 在您的数据库中,确保用户Worklight @%和/或Worklight @ localhost对您创建的数据库拥有完全权限
  4. 确认项目和环境中的所有三个都正常。

答案 1 :(得分:1)

 Caused by: java.sql.SQLException: Access denied for user 'Worklight'@'localhost' (using password: YES)

因此看起来工作灯正在进入您的数据库,但您的用户名或密码不正确。

这可能是你的问题:

wl.db.type=MYSQL 
wl.db.url=jdbc:mysql://localhost:3306/database
wl.reports.db.username=root
wl.reports.db.password=

您似乎正在设置wl。报告 .db.username和wl。报告 .db.password

您使用的是报告数据库吗?您的意思是设置以下内容:

wl.db.username=user
wl.db.password=

答案 2 :(得分:0)

我得到了同样的错误。 当我创建数据库用户时,我使用通配符来授予权限,即&#34;%&#34;对于任何主持人和&#34; *&#34;适用于所有数据库。 后来我给出了非常具体的凭据,我再次创建了同一个用户,并在本地主机上为我希望连接的特定数据库授予了该用户的所有权限。 我重新部署了适配器并成功再次调用它,没有任何错误