简体   繁体   中英

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

[AUDIT] J2CA8004I : The dataSource DB2Connection is avilable as jdbc/DB2Connection. [AUDIT] J2CA8000I : The jdbcDriver my JDBCDriver is available.

How can i know if the jpa and jdb features ae correctly set?

This is the 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. Have you tried testing the connection with a simple "Hello World" JPA application?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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