Worklight 6.0不能在Liberty - HSQLDB上启动 [英] Worklight 6.0 does not start on Liberty - HSQLDB

查看:214
本文介绍了Worklight 6.0不能在Liberty - HSQLDB上启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经遵循信息中心文档在Windows 2008上设置自由和Oracle数据库的工作。
http://pic.dhe.ibm.com/infocenter/wrklight/v6r0m0/topic/com.ibm.worklight。 help.doc / devref / t_transporting_apps_and_adapters.html - 将IBM Worklight应用程序部署到测试和生产环境)

I have followed the infocenter docs to setup Worklight on Liberty and Oracle Database all on Windows 2008. (http://pic.dhe.ibm.com/infocenter/wrklight/v6r0m0/topic/com.ibm.worklight.help.doc/devref/t_transporting_apps_and_adapters.html - Deploying IBM Worklight applications to test and production environments)

当我启动自由服务器时,我收到此错误在浏览器上

When I start the liberty server, I get this error on the browser

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

Exception thrown by application class 'com.worklight.core.auth.impl.AuthenticationFilter.doFilter:110' javax.servlet.ServletException: Worklight Project not initialized

在com.worklight.core.auth.impl.AuthenticationFilter.doFilter(AuthenticationFilter.java:110)
在com.ibm.ws .webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:194)
在[internal classes]

at com.worklight.core.auth.impl.AuthenticationFilter.doFilter(AuthenticationFilter.java:110) at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:194) at [internal classes]

通过日志显示它没有启动,因为没有找到HSQLDB驱动程序。

Going thru the logs, it shows it did not start because the HSQLDB driver is not found.

server.xml具有以下内容:

The server.xml has the following:

<application id="finance" name="finance" location="finance.war" type="war">
 <classloader delegation="parentLast">
 <commonLibrary>
 <fileset dir="${shared.resource.dir}/worklight/lib" includes="worklight-jee-library.jar"/>
 </commonLibrary>
 </classloader>
</application>

<library id="worklight/OracleLib">
 <fileset dir="${shared.resource.dir}/worklight/oracle" includes="*.jar"/>
</library>

<!-- Declare the IBM Worklight Console database. -->
<dataSource jndiName="worklight/jdbc/WorklightDS" transactional="false">
  <jdbcDriver libraryRef="worklight/OracleLib"/>
  <properties.oracle driverType="thin" URL="jdbc:oracle:thin:@localhost:1521:ORCLWL" user="WORKLIGHTDIS" password="WORKLIGHTDIS"/>
</dataSource>

我进一步了解了WAR文件如何链接到数据库jndi条目。通过web.xml文件,我发现这一点:

I took a step further and checked how the WAR file links to database jndi entries. Going thru the web.xml file I found this:

<resource-ref>
<description>Worklight Server Database</description> 
<res-ref-name>jdbc/WorklightDS</res-ref-name> 
<res-type>javax.sql.DataSource</res-type> 
<res-auth>Container</res-auth> 
</resource-ref>

res-ref-name与server.xml中声明的略有不同。请记住,这些条目是由ant脚本创建的。这似乎与war文件包含(由WL Studio创建)不一致。

The res-ref-name is slightly different from what is declared in the server.xml. Bear in mind that these entries were created by the ant script. This seems to be inconsistent from what the war file contains (created by the WL Studio).

无论如何,我尝试将server.xml jndi条目更改为与web.xml条目(jdbc / WorklightDS)完全相同。当我重新启动自由服务器完全没有改变最终结果。错误信息和HSQL驱动程序在日志中保持显示。

Anyway I gave it a try and changed the server.xml jndi entry to be exactly the same as the web.xml entry (jdbc/WorklightDS). When I restarted the liberty server It did not change the final result at all. The error message and the HSQL driver thing kept showing in the log.

这是例外

nested exception is java.lang.RuntimeException: java.lang.ClassNotFoundException: Class                 org.hsqldb.jdbcDriver not found in Worklight platform or project /finance
at  org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)

稍后我发现如果我改变server.xml中的元素为所有属性的工作灯值可以工作。多么奇怪。

Later on I found out that if I change the element in the server.xml to be worklight value for all atributes it works. How odd it is.

<application id="worklight" name="worklight" location="finance.war" type="war">

请帮助我了解并解决问题。 $ b

Please, any help is much appreciated to help me understand and fix it.

推荐答案

错误消息 java.lang.RuntimeException:java.lang.ClassNotFoundException:在Worklight平台中找不到类org.hsqldb.jdbcDriver项目... 确实有误导性。它应该更好地阅读类似 Worklight服务器无法启动,因为没有数据源绑定到资源引用:'jdbc / WorklightDS'。重新配置服务器将解决这个问题。更多信息搜索创建和在IBM Worklight信息中心中配置数据库。

The error message "java.lang.RuntimeException: java.lang.ClassNotFoundException: Class org.hsqldb.jdbcDriver not found in Worklight platform or project ..." is indeed misleading. It should better read something like "Worklight server cannot be started because no data-source is bound to resource reference: 'jdbc/WorklightDS'. Re-configuring the server will solve this problem. for more information search for "Creating and configuring the databases" in IBM Worklight information center."

错误消息的解释是,通过编写< application id =financename =financelocation =finance.wartype =war> 您选择了一个上下文根 / finance ,根据WebSphere Liberty规则在将Web应用程序部署到Liberty配置文件。对于这个上下文根,您需要写入

The explanation for the error message is that by writing <application id="finance" name="finance" location="finance.war" type="war"> you selected a context root /finance, according to the WebSphere Liberty rules at Deploying a web application to the Liberty profile. For this context root, you need to write

< dataSource jndiName = finance / jdbc / WorklightDS事务=false>

<dataSource jndiName="finance/jdbc/WorklightDS" transactional="false">

这类似于JNDI环境条目需要为Worklight声明(参见在此生成的IBM Worklight项目>这里)。

This is similar to how JNDI environment entries need to be declared for Worklight (see here).

这篇关于Worklight 6.0不能在Liberty - HSQLDB上启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆