问题描述
当我尝试将.war文件部署到应用程序服务器时,我收到以下错误消息:
我已经在做一些研究,并询问IBM关于我们的问题,并回顾了以下类似的问题:
您是否在Websphere Application Server中创建了jdbc连接?
WAR文件中的应用程序将需要连接到数据库。
如果已经完成,可以在WAR文件和在WEB-INF /文件夹中查找web.xml文件。在我的情况下,我在文件中找到一个硬编码的jdbc,例如:
< resource-ref>
< description> Worklight服务器数据库< / description>
< res-ref-name> jdbc / WorklightDS< / res-ref-name>
< res-type> javax.sql.DataSource< / res-type>
< res-auth>容器< / res-auth>
< / resource-ref>
< resource-ref>
< description>报告数据库< / description>
< res-ref-name> jdbc / WorklightReportsDS< / res-ref-name>
< res-type> javax.sql.DataSource< / res-type>
< res-auth>容器< / res-auth>
< / resource-ref>
您可以将这些硬编码的文件重命名为与您在WAS中创建的jdbc相同的名称。 / p>
对于数据库问题,您可以按照此链接使用ant创建数据库。
如果您遵循第一个用于DB2创建的脚本,该脚本将具有两个不同的数据库,则需要创建新用户这条线,如果你还没有这样做。
由于您可以看到,在xml脚本中,将需要用户和密码来创建WRKLGHT数据库。例如:
< db2 database =WRKLGHTserver =proddb.example.com
user = wl6adminpassword =wl6pass>
如果对DB2连接使用非默认端口,则可以在端口号参数后添加服务器参数。
例如:
对于用户创建,您可以按照以下链接:
I got the following error message when I try to deploy my .war file to the application server:
I already doing some research and ask IBM's about our issue as wellas reviewed the following similar question: IBM Worklight 6.1 - Unable to initialize the project due to DB2 error
Have you create a jdbc connection in your Websphere Application Server?It will be needed by the application inside the WAR file to connect to the database.
If you have done it, you can check inside your WAR file and look for web.xml file in WEB-INF/ folder. In my case I found a jdbc hardcoded inside the file, for example:
<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>
<resource-ref>
<description>Reports Database</description>
<res-ref-name>jdbc/WorklightReportsDS</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
You can rename those hardcoded file into the same name of the jdbc that you created in you WAS.
For the database issue, you can follow this link to use ant for DB creation.
If you follow the 1st ant script for DB2 creation which will have two different databases, you need to create the new user for this line if you haven't done so.Because as you can see, in the xml script, user and password will be needed to create the WRKLGHT database. For example:
<db2 database="WRKLGHT" server="proddb.example.com"
user="wl6admin" password="wl6pass">
If you use non-default port for your DB2 connection, you can add on your port number parameter after the server parameter.For example:
For user creation, u can follow this link:
这篇关于IBM Worklight 6.1 - 项目无法初始化,因为项目数据库模式来自N / A版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!