JBoss上的Oracle ADF:包装的Jdbc连接问题 [英] Oracle ADF on JBoss: Wrapped Jdbc Connection problem

查看:97
本文介绍了JBoss上的Oracle ADF:包装的Jdbc连接问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在JBoss服务器上使用Oracle ADF业务组件来运行应用程序.我已经进行了部署,但是当我尝试加载页面时,出现以下异常:

I'm trying to run an application using Oracle ADF Business Components on a JBoss Server. I've maneged to deploy it, but when I try to load the page I get below exception:

 java.lang.ClassCastException: org.jboss.resource.adapter.jdbc.jdk6.WrappedConnectionJDK6 cannot be cast to oracle.jdbc.OracleConnection

有没有办法解决这个问题?也许将JBoss配置为不使用此包装的连接,或者将ADF框架配置为不包装它?

Is there a way solve this? Maybe configure JBoss to not use this wrapped connection or configure the ADF framework to unwrap it?

推荐答案

这已经有一段时间了,但是我将继续回答我自己的问题.

This is a while back, but I'll just follow up on my own question.

Oracle Metalink a>(需要登录)这说明了如何在JBoss上部署ADF/BC.我很确定这是为我解决了这个问题(前一阵子.)

There is a guide on Oracle Metalink (Needs login) wich explains how to deploy ADF/BC on JBoss. I'm pretty sure this is what solved this for me (it's a while ago..)

这里是它的副本:

摘要
本说明的目的是说明如何创建ADF BC应用程序模块以及如何在JBoss Application Server上部署它.它还将向您显示在JBoss端需要执行哪些配置才能使应用程序模块正常工作.

Abstract
The purpose of this note is to show how you create an ADF BC Application Module and how you deploy it on a JBoss Application Server. It will also show you what configurations you need to perform on the JBoss side in order for the Application Module to work correctly.

范围&申请
本说明适用于将ADF BC模块部署到JBoss Application Server的任何人.

Scope & Application
This note is intended for anyone who is about to deploy an ADF BC Module to a JBoss Application Server.

如何将ADF BC模块部署到JBoss应用服务器
将ADF BC模块部署到JBoss Application Server的必要步骤如下:

How To Deploy an ADF BC Module to a JBoss Application Server
The steps necessary for deploying an ADF BC Module to a JBoss Application Server are the following:

  1. 在JBoss服务器上设置ADF运行时库
  2. 在JBoss服务器上设置数据源
  3. 配置ADF BC模块
  4. 部署ADF BC模块

我将详细介绍每个步骤.此处还附有完整示例供下载. 在JBoss服务器上设置ADF运行时库

I will go through each of these steps more detailed. There is also a complete example attached for download here. Setup the ADF Runtime Libraries on the JBoss Server

  1. 关闭应用程序服务器.
  2. 调用ADF运行时安装程序向导.选择工具| ADF运行时安装程序,然后从子菜单中选择服务器类型.
  3. 继续执行向导的页面.有关该向导任何页面的详细说明,请单击帮助".
  4. 在位置"页面上,选择要在其上安装库的服务器的主目录(或根目录).
  5. 在安装选项"页面上,您可以选择要执行的操作. *从JDeveloper安装中安装ADF运行时库. *卸载以前安装的ADF运行时库. *将ADF运行时库的存档版本恢复为活动版本.
  6. 如果要准备部署任何现有的UIX JSP项目,请在摘要"页面上单击迁移".
  7. 在摘要"页面上,确认安装的详细信息,然后单击完成".
  8. 重新启动应用程序服务器.
  1. Shutdown the Application Server.
  2. Invoke the ADF Runtime Installer wizard. Choose Tools | ADF Runtime Installer, and choose a server type from the submenu.
  3. Proceed through the pages of the wizard. For detailed instructions for any page of the wizard, click Help.
  4. On the Location page, select the home (or root) directory of the server on which the libraries are to be installed.
  5. On the Installation Options page, you may choose the operation that you wish to perform. * Install the ADF runtime libraries from your JDeveloper installation. * Uninstall previously installed ADF runtime libraries. * Restore an archived version of the ADF runtime libraries as the active version.
  6. On the Summary page, click Migrate if you wish to prepare any existing UIX JSP projects for deployment.
  7. On the Summary page, confirm the details of the installation, and click Finish.
  8. Restart the application server.

在JBoss服务器上设置数据源
要在JBoss服务器中创建Oracle数据源,您需要执行以下步骤:

Setup data source(s) on the JBoss Server
To create an Oracle data source in the JBoss server, you need to take the following steps:

  1. 创建一个名为oracle-ds.xml的文件.该文件将包含您的数据源配置.下面是一个有关此类文件外观的示例.

  1. Create a file called oracle-ds.xml. This file will contain your data source configuration. Below is an example on how such a file can look like.

<?xml version="1.0" encoding="UTF-8"?>
  <datasources>
    <local-tx-datasource>
    <jndi-name>OracleDS</jndi-name>
    <use-java-context>false</use-java-context>
    <connection-url>jdbc:oracle:thin:@mydbhost.com:1521:mysid</connection-url>
    <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
    <user-name>hr</user-name>
    <password>******</password>
    <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
  </local-tx-datasource>
</datasources>

  • 将文件复制到/deploy.这会将它安装在JBoss服务器上.

  • Copy the file to the /deploy. This will install it on the JBoss server.

    配置ADF BC模块
    为了使它在JBoss服务器上运行,需要对ADF BC模块采取一些步骤.

    Configure the ADF BC Module
    There are a few steps that need to be taken upon the ADF BC Module in order for it to run on the JBoss server.

    创建要在JBoss应用程序服务器上使用的ADF BC模块时,需要将SQL Flavor设置为SQL92,将Type Map设置为Java.使用JBoss作为应用程序服务器时,需要进行此更改.

    When creating an ADF BC Module that will be used on a JBoss application server, one needs to set the SQL Flavor to SQL92 and the Type Map to Java. This change is required when using JBoss as the Application Server.

    ****将ADF业务组件项目打包为EJB会话bean.****

    ****Package the ADF Business Components project as an EJB session bean.****

    1. 右键单击应用程序模块",选择业务组件部署".
    2. 在配置文件对话框中,选择EJB会话Bean.
    3. 在"EJB会话Bean"对话框中,选择部署到:其他EJB容器"
    4. 在AppModules对话框中,如下图1所示配置应用程序模块.

    图1.应用程序模块的配置

    Figure 1. Configuration of the Application Module

    完成后,您的项目将类似于下图2所示.

    Once done, your Project will look similar to the one shown in the figure 2 below.

    图2. JDeveloper项目

    Figure 2. The JDeveloper Project

    最后一步是配置应用程序模块以使用我们在上一步中创建的数据源.这样做如下:

    The final step is to configure the Application Module to use the data source we created in the previous step. This is done as follows:

    1. 编辑应用程序模块.
    2. 在导航器中,右键单击业务组件"应用程序模块图标,然后选择配置".
    3. 选择适当的配置.
    4. 选择此配置,然后单击编辑".
    5. 在连接类型"列表中,选择"JDBC数据源".
    6. 输入数据源名称.例如:java:/OracleDS.

    部署ADF BC模块
    如果您的JBoss服务器位于本地或本地计算机上,则可以直接从JDeveloper内部进行部署.如果您的JBoss服务器是远程服务器,并且未映射到本地计算机,或者您有一个稍后将使用此模块的JSP应用程序,则不能直接在JDeveloper中部署它.两种方法都在下面介绍.

    Deploy the ADF BC Module
    If you have your JBoss server either locally or mapped on your local machine, you can deploy it directly from inside JDeveloper. If your JBoss server is remote, and not mapped to the local machine, or you have a JSP application that later will use this module, you cannot deploy it directly from within JDeveloper. Both methods are described below.

    从JDeveloper内部部署模块
    1.创建与目标应用程序服务器的连接. 2.如果要支持EJB的JBoss特定的配置选项,请添加jboss.xml部署描述符文件.有关此文件的更多信息,请参见
    http://www.jboss.org . 3.如果您的项目是Business Components UIX JSP项目,请向其中添加所需的Cabo资源. 4.在导航器中选择部署配置文件,单击鼠标右键,然后选择部署到|". <应用程序服务器连接>,将应用程序打包为存档文件,并通过选定的应用程序服务器连接进行部署.

    Deploying the Module from within JDeveloper
    1. Create a connection to the target application server. 2. If you want to support JBoss-specific configuration options for the EJB, add a jboss.xml deployment descriptor file. For more information on this file, see http://www.jboss.org. 3. If your project is a Business Components UIX JSP project, add required Cabo resources to it. 4. Select the deployment profile in the Navigator, right-click, and choose Deploy to | < application server connection> to package the application as an archive file and deploy it via the selected application server connection.

    在JDeveloper外部部署模块
    如果您的JBoss服务器是远程服务器,并且未映射到本地计算机,或者您有一个稍后将使用此模块的JSP应用程序,则必须执行以下操作:

    Deploying the Module outside of JDeveloper
    If your JBoss server is remote, and not mapped to the local machine, or you have a JSP application that later will use this module you will have to do as follows:

    1. 从上下文菜单中选择部署到EAR文件",以将其部署为EAR文件.您必须将此应用程序部署到EAR文件而不是WAR文件,因为JBoss不会在WAR文件的java:comp/env/JNDI命名空间下添加EJB引用.
    2. 将此文件手动复制到/deploy目录.

    这篇关于JBoss上的Oracle ADF:包装的Jdbc连接问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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