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

Posted

技术标签:

【中文标题】IBM Worklight - 尝试部署应用程序/适配器时出错【英文标题】:IBM Worklight - Error while trying to deploy application/adapter 【发布时间】:2013-09-12 10:02:37 【问题描述】:

我使用 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) 在 [内部类] 引起: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 文件。

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>

adapter-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.

【问题讨论】:

您在错误日志中看到“原因:... Worklight 项目未初始化”?如果您向上滚动一点点,则应该有一个较长的错误消息,也是红色的(您可能需要向右滚动很多才能获得整个消息)。你能粘贴那条消息的内容吗? 请检查更新的问题,杰里米。仍在为此苦苦挣扎..它基本上有三个“由”引起 1.由(重复)引起...:org.springframework.beans.factory.BeanCreationException:2.引起:org.apache.commons.dbcp.SQLNestedException:无法创建 PoolableConnectionFactory(用户 'Worklight'@'localhost' 的访问被拒绝(使用密码:YES)) 3. 原因:java.sql.SQLException:用户 'Worklight'@'localhost' 的访问被拒绝(使用密码:YES) 【参考方案1】:

明确一点:您创建的数据库,它的用途是什么?它是作为 Worklight Server 的数据库,还是作为适配器连接到的某些服务的后端?

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

还请参阅 IBM Worklight Getting Started 和 this training module (sample app),以熟悉 Worklight 中的各种概念和选项。

最后看看有没有以下帮助:

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

    您对 worklight.properties 的引用仅显示报告数据库用户名和密码,而不是 Worklight Server 的用户名和密码 - 这仅在我上面的问题之后 为什么要将用户名/密码添加到报告数据库?您是否为报告创建了数据库?我觉得您需要复习培训模块。

    确保 MySQL JDBC 连接器/J 驱动程序 .jar 文件位于 yourProject\server\lib

    在您的数据库中,确保用户 Worklight@% 和/或 Worklight@localhost 对您创建的数据库具有完全权限

验证这三个在您的项目和环境中都正常。

【讨论】:

非常感谢伊丹。我已经删除了我在 worklight.properties 文件中输入的所有内容并部署了适配器。仍然有一些 json 函数错误。然后将 WL.Server.invokeSQLStoredProcedure 更改为 WL.Server.invokeSQLStatement 它已经开始完美运行。我希望找到一些关于我们何时应该进入 worklight.properties 的文件。 从头到尾阅读所有入门资料;让自己了解 Worklight,这是唯一真正的方法。【参考方案2】:
 Caused by: java.sql.SQLException: Access denied for user 'Worklight'@'localhost' (using password: YES)

所以看起来 worklight 正在访问您的数据库,但您的用户名或密码不正确。

这是你的问题吗:

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

您似乎正在设置 wl.reports.db.username 和 wl.reports.db.password

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

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

【讨论】:

【参考方案3】:

我遇到了同样的错误。 当我创建数据库用户时,我使用通配符来授予权限,即任何主机的“%”和所有数据库的“*”。 后来我提供了非常具体的凭据,我再次创建了相同的用户,并在本地主机上为该用户授予了我希望连接到的特定数据库的所有权限。 我重新部署了适配器并再次成功调用它,没有任何错误

【讨论】:

以上是关于IBM Worklight - 尝试部署应用程序/适配器时出错的主要内容,如果未能解决你的问题,请参考以下文章

IBM Worklight 6.0.0.1 - 部署 .wlapp 时出错

IBM Worklight 6.0 - 如何将 Worklight 应用程序部署到 Worklight Server?

安装 IBM Worklight Server

IBM Worklight - Worklight 可以部署到现有的 WAS 服务器吗?

IBM Worklight 6.0.0.1 - 部署到生产服务器时无法初始化 Worklight Project

部署 IBM Worklight 企业服务器时出现 BeanCreationException