简体   繁体   English

在Websphere Liberty中启用jpa和jdbc的问题

[英]Issue enabling jpa and jdbc in Websphere Liberty

I am following these exercises for learning Liberty. 我正在按照这些练习来学习自由。

I am having an issue in he Lab 3 - Module 2.2 Liberty and JPA (DB2) . 我在Lab 3-Module 2.2 Liberty和JPA(DB2)中遇到问题。 After setting all the JDBC and Data Source details, i restart the server and i do not see the two lines that mention the dataSource and jdbd driver. 设置完所有JDBC和数据源详细信息之后,我重新启动服务器,并且看不到提到dataSource和jdbd驱动程序的两行。

[AUDIT] J2CA8004I : The dataSource DB2Connection is avilable as jdbc/DB2Connection. [AUDIT] J2CA8004I:数据源DB2Connection可作为jdbc / DB2Connection使用。 [AUDIT] J2CA8000I : The jdbcDriver my JDBCDriver is available. [AUDIT] J2CA8000I:JDBCDriver的jdbcDriver可用。

How can i know if the jpa and jdb features ae correctly set? 我怎么知道jpa和jdb功能是否正确设置?

This is the server.xml 这是server.xml

<!-- Enable features -->
<featureManager onError="WARN">
    <feature>jsp-2.2</feature>
    <feature>jpa-2.0</feature>
    <feature>jdbc-4.0</feature>
</featureManager>

<!-- To access this server from a remote client add a host attribute to the following element, e.g. host="*" -->
<httpEndpoint id="defaultHttpEndpoint"
              httpPort="9080"
              httpsPort="9443" />


<jdbcDriver id="myJDBCDriver">
    <library name="DB2Lib">
        <fileset dir="C:\wlp\db2jdbc" includes="db2jcc4.jar, db2jcc_license_cu.jar"></fileset>
    </library>
</jdbcDriver>
<dataSource jndiName="jdbc/DB2Connection" id="DB2Connection"
    jdbcDriverRef="myJDBCDriver">
    <properties.db2.jcc databaseName="SAMPLE" serverName="igacloud" password="{xor}FhgeOz1tPj08" user="db2admin"></properties.db2.jcc>
</dataSource>

Unlike Classic WebSphere, which has a "test connection" capability in its admin console (datasource panel), there is no equivalent means with WebSphere Liberty yet. 与Classic WebSphere在其管理控制台(数据源面板)中具有“测试连接”功能不同,WebSphere Liberty尚无等效方法。 Have you tried testing the connection with a simple "Hello World" JPA application? 您是否尝试过使用简单的“ Hello World” JPA应用程序测试连接?

The CWWKF0012I message is simply confirming what features have been enabled - some features depend on other features and automatically enables them, which is why you see more features than defined in your server.xml. CWWKF0012I消息只是在确认已启用了哪些功能-某些功能依赖于其他功能并自动启用它们,这就是为什么您看到的功能比server.xml中定义的功能还要多的原因。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM