You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何配置JBoss EAP 7.0 XA-Datasources?启动报错排查

Troubleshooting JBoss EAP 7 XA-Datasource Errors with Oracle in Eclipse Oxygen

Let’s break down your two key errors and walk through actionable fixes to get your XA datasources working:

1. Fixing ORA-12514: TNS Listener Doesn’t Recognize the Requested Service

This error almost always boils down to a mismatch between your connection string’s service identifier and what Oracle’s listener actually exposes—even if you think your connection string is correct. Here’s what to check:

  • Verify the Oracle service name (not SID)
    Many developers mix up SID and service names. Run these commands on your Oracle server to confirm the correct service name:

    • In the Oracle command line: SELECT value FROM v$parameter WHERE name='service_names';
    • Check the listener status: lsnrctl status (look under "Services Summary" for the valid service names)
      Ensure your XA datasource URL uses this exact service name. For example:
    <xa-datasource-property name="URL">
      jdbc:oracle:thin:@//your-oracle-host:1521/ORCLPDB1  <!-- ORCLPDB1 is the service name here -->
    </xa-datasource-property>
    

    Avoid using SID format (:@host:port:SID) unless you explicitly need it—XA connections often work better with service names.

  • Confirm network reachability
    Even if your connection string is right, a firewall might block port 1521 between JBoss and Oracle, or the Oracle listener might only be listening on localhost (not the external IP JBoss uses). Test connectivity with telnet your-oracle-host 1521 from the JBoss server to rule this out.

2. Resolving IJ031084: Unable to Create Connection During Crash Recovery

This error ties to JBoss’s XA transaction recovery process. The most common fixes are:

  • Grant necessary XA permissions to your database user
    Oracle requires specific privileges for users handling XA transactions to query pending transactions during recovery. Run these SQL commands as a privileged user:

    GRANT SELECT ON sys.dba_pending_transactions TO your_db_username;
    GRANT SELECT ON sys.pending_trans$ TO your_db_username;
    GRANT SELECT ON sys.dba_2pc_pending TO your_db_username;
    GRANT EXECUTE ON sys.dbms_xa TO your_db_username;
    
  • Validate JBoss transaction recovery configuration
    In your standalone.xml, check the transactions subsystem to ensure recovery is enabled properly:

    <subsystem xmlns="urn:jboss:domain:transactions:4.0">
      <recovery-environment socket-binding="txn-recovery-environment" status-socket-binding="txn-status-manager"/>
      <coordinator-environment default-timeout="300"/>
    </subsystem>
    

    Also, make sure your XA datasource’s recovery settings (if configured) use a user with the permissions above—avoid using a restricted user for recovery.

Additional Troubleshooting Steps

  • Test a non-XA datasource first
    Set up a basic non-XA datasource with the same connection details. If it fails, you know the issue is with core connectivity (not XA-specific). If it works, focus back on XA permissions and configuration.
  • Enable debug logging
    Boost logging for JBoss’s JCA and Oracle JDBC modules to get granular error details. Add this to your standalone.xml logging subsystem:
    <logger category="org.jboss.jca">
      <level name="DEBUG"/>
    </logger>
    <logger category="oracle.jdbc">
      <level name="DEBUG"/>
    </logger>
    
    The debug logs will show exactly where the connection or recovery process is failing.

内容的提问来源于stack exchange,提问作者annie

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 04:27:59