Can't start JNLP app over https - https

During deployment our JavaFX-based app using JNLP I discovered very strange thing.
I can't launch it when server are running over SSL(web server certificate are valid, all jars are signed)
Java permissions was changed to accept jars from this host
In same time, plain http working perfectly. After realizing this strange behaviour, I enabled verbose logging in java console and found 2 much different approaches which I can't explain.
For https version javaws translated URI from jnlp into local bounded links with file:// prefix
<jnlp spec="6.0+" codebase="file:/var/tmp/" href="file:/var/tmp/sniper-client.jnlp">
<information>
<title>MyApp</title>
<vendor>MyCompany</vendor>
<homepage href="null"/>
<description>MyApp</description>
<offline-allowed/>
</information>
<security>
<all-permissions/>
</security>
<update check="background" policy="always"/>
<resources>
<javafx-runtime version="2.2+" href="http://javadl.sun.com/webapps/download/GetFile/javafx-latest/windows-i586/javafx2.jnlp"/>
<java java-vm-args="-Djava.net.preferIPv4Stack=true" href="http://java.sun.com/products/autodl/j2se" version="1.6.0+"/>
<jar href="file:/var/tmp/myapp.jar" download="eager" main="false"/>
<jar href="file:/var/tmp/lib/afterburner.fx-1.5.1.jar" download="eager" main="false"/>
<jar href="file:/var/tmp/lib/commons-math3-3.3.jar" download="eager" main="false"/>
<jar href="file:/var/tmp/lib/gson-2.2.4.jar" download="eager" main="false"/>
<jar href="file:/var/tmp/lib/joda-time-2.3.jar" download="eager" main="false"/>
<jar href="file:/var/tmp/lib/logback-classic-1.1.0.jar" download="eager" main="false"/>
<jar href="file:/var/tmp/lib/logback-core-1.1.0.jar" download="eager" main="false"/>
but for plain http all links was correctly transformed into http bound URLs:
<jnlp spec="6.0+" codebase="http://server:9800/client/" href="http://server:9800/client/myapp.jnlp">
<information>
<title>MyApp</title>
<vendor>MyCompany</vendor>
<homepage href="null"/>
<description>MyApp</description>
<offline-allowed/>
</information>
<security>
<all-permissions/>
</security>
<update check="background" policy="always"/>
<resources>
<javafx-runtime version="2.2+" href="http://javadl.sun.com/webapps/download/GetFile/javafx-latest/windows-i586/javafx2.jnlp"/>
<java java-vm-args="-Djava.net.preferIPv4Stack=true" href="http://java.sun.com/products/autodl/j2se" version="1.6.0+"/>
<jar href="http://server:9800/client/myapp.jar" download="eager" main="false"/>
<jar href="http://server:9800/client/lib/afterburner.fx-1.5.1.jar" download="eager" main="false"/>
<jar href="http://server:9800/client/lib/commons-math3-3.3.jar" download="eager" main="false"/>
<jar href="http://server:9800/client/lib/gson-2.2.4.jar" download="eager" main="false"/>
SO question is what is going on and how make this app works over https?

Related

Can we change the <soap:address location> dynamically - with JAX-WS

I am new to soap web services,wanted to know can we change the location of soap:address according to the environment it is deployed. I am using jaxws-spring
<binding name="HelloWorldWSPortBinding" type="tns:HelloWorldWS">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
<operation name="getHelloWorld"></binding>
<service name="HelloWorldWSService">
<port name="HelloWorldWSPort" binding="tns:HelloWorldWSPortBinding">
<soap:address location="http://localhost:8095/WebServicesExample/hello" />
</port>
</service>
</definitions>

Jboss error New missing/unsatisfied dependencies jboss.naming.context.java.jboss.datasources

I have the following datasource, we are using oracle jdbc driver, ojdbc6.jar :
<?xml version="1.0" encoding="UTF-8"?>
<datasources xmlns="http://www.jboss.org/ironjacamar/schema">
<datasource jndi-name="java:jboss/datasources/hubAdminDS" enabled="true"
use-java-context="true" pool-name="hubAdmin" jta="false">
<connection-url>jdbc:oracle:thin:#10.0.153.177:1521:XE</connection-url>
<driver>ojdbc6.jar</driver>
<pool>
<min-pool-size>5</min-pool-size>
<max-pool-size>10</max-pool-size>
<prefill>true</prefill>
</pool>
<security>
<user-name>HUBDBLOCAL</user-name>
<password>HUBDBLOCAL</password>
</security>
</datasource>
<datasource jndi-name="java:jboss/datasources/TASK_DB" enabled="true"
use-java-context="true" pool-name="TASK_DB" spy="true" use-ccm="true">
<connection-url>jdbc:oracle:thin:#10.0.153.177:1521:XE</connection-url>
<driver>ojdbc6.jar</driver>
<pool>
<min-pool-size>10</min-pool-size>
<max-pool-size>20</max-pool-size>
<prefill>true</prefill>
</pool>
<security>
<user-name>HUBDBLOCAL</user-name>
<password>HUBDBLOCAL</password>
</security>
</datasource>
<datasource jndi-name="java:jboss/datasources/SAFE" enabled="true"
use-java-context="true" pool-name="SAFE" jta="false">
<connection-url>jdbc:oracle:thin:#10.0.153.177:1521:XE</connection-url>
<driver>ojdbc6.jar</driver>
<pool>
<min-pool-size>3</min-pool-size>
<max-pool-size>4</max-pool-size>
<prefill>true</prefill>
</pool>
<security>
<user-name>HUBDBLOCAL</user-name>
<password>HUBDBLOCAL</password>
</security>
</datasource>
<datasource jndi-name="java:jboss/datasources/JDBC_DB" enabled="true"
use-java-context="false" pool-name="JDBC_DB" jta="false">
<connection-url>jdbc:oracle:thin:#10.0.153.177:1521:XE</connection-url>
<driver>ojdbc6.jar</driver>
<pool>
<min-pool-size>5</min-pool-size>
<max-pool-size>10</max-pool-size>
<prefill>true</prefill>
</pool>
<security>
<user-name>HUBDBLOCAL</user-name>
<password>HUBDBLOCAL</password>
</security>
</datasource>
<datasource jndi-name="java:jboss/datasources/MAIL_SENDER_DB"
enabled="true" use-java-context="true" pool-name="MAIL_SENDER_DB"
jta="false">
<connection-url>jdbc:oracle:thin:#10.0.153.177:1521:XE</connection-url>
<driver>ojdbc6.jar</driver>
<pool>
<min-pool-size>3</min-pool-size>
<max-pool-size>4</max-pool-size>
<prefill>true</prefill>
</pool>
<security>
<user-name>HUBDBLOCAL</user-name>
<password>HUBDBLOCAL</password>
</security>
</datasource>
<datasource jndi-name="java:jboss/datasources/HELPDESK" enabled="true"
use-java-context="true" pool-name="HELPDESK" jta="false">
<connection-url>jdbc:oracle:thin:#10.0.153.177:1521:XE</connection-url>
<driver>ojdbc6.jar</driver>
<pool>
<min-pool-size>10</min-pool-size>
<max-pool-size>20</max-pool-size>
<prefill>true</prefill>
</pool>
<security>
<user-name>HUBDBLOCAL</user-name>
<password>HUBDBLOCAL</password>
</security>
</datasource>
</datasources>
when I deploy the application, I got the following error :
15:44:40,915 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 2)
JBAS014774: Service status report
JBAS014775: New missing/unsatisfied dependencies:
service jboss.naming.context.java.jboss.datasources.JDBC_DB (missing) dependents: [service jboss.naming.context.java.module.bpm.bpm.env."com.hds.hub.api.processes.impl.UserServicesEJB".dataSource, service jboss.naming.context.java.module.bpm.bpm.env."com.hds.hub.iArchive.impl.FileArchiveServiceEJB".dataSource]
service jboss.naming.context.java.jboss.datasources.MAIL_SENDER_DB (missing) dependents: [service jboss.naming.context.java.module.bpm.bpm.env.jdbc.MAIL_SENDER_DB]
service jboss.naming.context.java.jboss.datasources.TASK_DB (missing) dependents: [service jboss.naming.context.java.module.bpm.bpm.env.jdbc.TASK_DB, service jboss.persistenceunit."bpm.war#org.jbpm.persistence.jpa"]
service jboss.naming.context.java.jboss.datasources.hubAdminDS (missing) dependents: [service jboss.naming.context.java.module.bpm.bpm.env.jdbc.HUB_ADMIN_DB]
15:44:40,921 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.naming.context.java.module.bpm.bpm.env.\"com.hds.hub.iArchive.impl.FileArchiveServiceEJB\".dataSourcejboss.naming.context.java.jboss.datasources.JDBC_DBMissing[jboss.naming.context.java.module.bpm.bpm.env.\"com.hds.hub.iArchive.impl.FileArchiveServiceEJB\".dataSourcejboss.naming.context.java.jboss.datasources.JDBC_DB]","jboss.naming.context.java.module.bpm.bpm.env.jdbc.HUB_ADMIN_DBjboss.naming.context.java.jboss.datasources.hubAdminDSMissing[jboss.naming.context.java.module.bpm.bpm.env.jdbc.HUB_ADMIN_DBjboss.naming.context.java.jboss.datasources.hubAdminDS]","jboss.naming.context.java.module.bpm.bpm.env.jdbc.TASK_DBjboss.naming.context.java.jboss.datasources.TASK_DBMissing[jboss.naming.context.java.module.bpm.bpm.env.jdbc.TASK_DBjboss.naming.context.java.jboss.datasources.TASK_DB]","jboss.naming.context.java.module.bpm.bpm.env.\"com.hds.hub.api.processes.impl.UserServicesEJB\".dataSourcejboss.naming.context.java.jboss.datasources.JDBC_DBMissing[jboss.naming.context.java.module.bpm.bpm.env.\"com.hds.hub.api.processes.impl.UserServicesEJB\".dataSourcejboss.naming.context.java.jboss.datasources.JDBC_DB]","jboss.naming.context.java.module.bpm.bpm.env.jdbc.MAIL_SENDER_DBjboss.naming.context.java.jboss.datasources.MAIL_SENDER_DBMissing[jboss.naming.context.java.module.bpm.bpm.env.jdbc.MAIL_SENDER_DBjboss.naming.context.java.jboss.datasources.MAIL_SENDER_DB]","jboss.persistenceunit.\"bpm.war#org.jbpm.persistence.jpa\"jboss.naming.context.java.jboss.datasources.TASK_DBMissing[jboss.persistenceunit.\"bpm.war#org.jbpm.persistence.jpa\"jboss.naming.context.java.jboss.datasources.TASK_DB]"]}}}
JDBC_DB, MAIL_SENDER, TASK_DB and hubAdminDS are defined in the datasource
When I connect to the remote server there is no error but when I connect to the local server I have the above errors.
Anyone can explain, why I have thoses errors ? How I can correct it ?
It looks like your datasource ("java:jboss/datasources/JDBC_DB") is not properly deployed inside JBoss server, Follow the below steps to get this done:
Install a JDBC driver as a core module:
1.Create a directory under $JBOSS_HOME/modules. In this example: "$JBOSS_HOME/modules/com/oracle/jdbc/main".
2.Put the the JDBC driver jar (ojdbc6.jar) in this directory
3.Create a module configuration file module.xml:
<module xmlns="urn:jboss:module:1.1" name="com.oracle.jdbc">
<resources>
<resource-root path="ojdbc6.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
Note that the jdbc driver jar must contain a META-INF/services/java.sql.Driver text file that specifies the jdbc Driver, otherwise the Java service provider mechanism used to load the driver will not work. From the main/common vendors only Informix does not have this out of the box.
4.Configure a datasource setting in standalone.xml or domain.xml.
You can now edit your standalone(-).xml or domain(-).xml to configure a datasource that references this module:
<subsystem ...>
<datasources>
<datasource jndi-name="java:jboss/datasources/OracleDS" pool-name="OracleDS" enabled="true" use-java-context="true">
<connection-url>jdbc:oracle:thin:#myhostname:1521:oracle</connection-url>
<driver>oracle</driver>
<pool>
<min-pool-size>10</min-pool-size>
<max-pool-size>20</max-pool-size>
<prefill>true</prefill>
</pool>
<security>
<user-name>myuser</user-name>
<password>mypass</password>
</security>
<validation>
<validate-on-match>true</validate-on-match>
<valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker"></valid-connection-checker>
<stale-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleStaleConnectionChecker"></stale-connection-checker>
<exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleExceptionSorter"></exception-sorter>
</validation>
</datasource>
<drivers>
<driver name="oracle" module="com.oracle.jdbc">
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
</subsystem>
or for an xa-datasource:
<subsystem ...>
<datasources>
<xa-datasource jndi-name="java:/XAOracleDS" pool-name="XAOracleDS">
<driver>oracle</driver>
<xa-datasource-property name="URL">jdbc:oracle:thin:#myhostname:1521:oracle</xa-datasource-property>
<security>
<user-name>admin</user-name>
<password>admin</password>
</security>
<xa-pool>
<is-same-rm-override>false</is-same-rm-override>
<no-tx-separate-pools />
</xa-pool>
<validation>
<validate-on-match>true</validate-on-match>
<valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker"></valid-connection-checker>
<stale-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleStaleConnectionChecker"></stale-connection-checker>
<exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleExceptionSorter"></exception-sorter>
</validation>
</xa-datasource>
<drivers>
<driver name="oracle" module="com.oracle">
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
</subsystem>
Once DB-Driver is set up as a module and server log says below:
12:10:47,381 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) JBAS010400: Bound data source [java:jboss/datasources/OracleDS]
....
I needed to allow multiple connection to my database which was limited by the following command :
sqlplus / as sysdba
ALTER SYSTEM SET PROCESSES= 300 SCOPE=SPFILE;
SHUT IMMEDIATE;
STARTUP;

How to build libvirt box from scratch

I'm trying to build vagrant libvirt box from scratch.
I insttalled ubuntu 14.04 and used this tutorial to prepare machine for vagrant using and then I used command virsh domblklist test to find my image file, so i find it here /var/lib/libvirt/images/test.img and then copied to place where I'm going to package my vagrant box. Then I converted my raw image file to qcow2 format (beacause this page says that only qcow2 format supported) with sudo qemu-img convert -f raw -O qcow2 test.img test.qcow2 command. Finally to get things done I executed vagrant init test and created metadata.json file with this in it
{
"provider" : "libvirt",
"format" : "qcow2",
"virtual_size" : 8
}
And then I used command tar cvzf vltest.box ./metadata.json ./Vagrantfile ./box.img to get things together in one box. Then I added box to vagrant with vagrant box add test.img test.
Then I tried to run machine with
vagrant init test
vagrant up --provider=libvirt
But it stuck here:
...
==> default: -- Video VRAM: 9216
==> default: -- Keymap: en-us
==> default: -- INPUT: type=mouse, bus=ps2
==> default: -- Command line :
==> default: Creating shared folders metadata...
==> default: Starting domain.
==> default: Waiting for domain to get an IP address...
Then I decided to open machine and that was what I saw:
Here is origin machine configurations:
<domain type='kvm'>
<name>test</name>
<uuid>50c605f7-c06c-4288-bd03-f17575345171</uuid>
<memory unit='KiB'>1048576</memory>
<currentMemory unit='KiB'>1048576</currentMemory>
<vcpu placement='static'>1</vcpu>
<os>
<type arch='x86_64' machine='pc-i440fx-trusty'>hvm</type>
<boot dev='hd'/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<emulator>/usr/bin/kvm-spice</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='raw'/>
<source file='/var/lib/libvirt/images/test.img'/>
<target dev='vda' bus='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</disk>
<disk type='block' device='cdrom'>
<driver name='qemu' type='raw'/>
<target dev='hdc' bus='ide'/>
<readonly/>
<address type='drive' controller='0' bus='1' target='0' unit='0'/>
</disk>
<controller type='usb' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
</controller>
<controller type='pci' index='0' model='pci-root'/>
<controller type='ide' index='0'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
</controller>
<interface type='network'>
<mac address='52:54:00:6c:05:1b'/>
<source network='default'/>
<model type='virtio'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
<serial type='pty'>
<target port='0'/>
</serial>
<console type='pty'>
<target type='serial' port='0'/>
</console>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
<graphics type='vnc' port='-1' autoport='yes'/>
<sound model='ich6'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</sound>
<video>
<model type='cirrus' vram='9216' heads='1'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</video>
<memballoon model='virtio'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
</memballoon>
</devices>
</domain>
Here is configuration of newly generated vagrant box:
<domain type='kvm' id='8'>
<name>testLibvirt_default</name>
<uuid>00069068-f4bc-41fa-b316-870e78fbe393</uuid>
<memory unit='KiB'>524288</memory>
<currentMemory unit='KiB'>524288</currentMemory>
<vcpu placement='static'>1</vcpu>
<resource>
<partition>/machine</partition>
</resource>
<os>
<type arch='x86_64' machine='pc-i440fx-trusty'>hvm</type>
<boot dev='hd'/>
</os>
<features>
<acpi/>
<apic/>
<pae/>
</features>
<cpu mode='host-model'>
<model fallback='allow'/>
</cpu>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<emulator>/usr/bin/kvm-spice</emulator>
<disk type='file' device='disk'>
<driver name='qemu' type='qcow2'/>
<source file='/var/lib/libvirt/images/testLibvirt_default.img'/>
<target dev='vda' bus='virtio'/>
<alias name='virtio-disk0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</disk>
<controller type='usb' index='0'>
<alias name='usb0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
</controller>
<controller type='pci' index='0' model='pci-root'>
<alias name='pci.0'/>
</controller>
<interface type='network'>
<mac address='52:54:00:91:b2:63'/>
<source network='vagrant-libvirt'/>
<target dev='vnet0'/>
<model type='virtio'/>
<alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
</interface>
<serial type='pty'>
<source path='/dev/pts/8'/>
<target port='0'/>
<alias name='serial0'/>
</serial>
<console type='pty' tty='/dev/pts/8'>
<source path='/dev/pts/8'/>
<target type='serial' port='0'/>
<alias name='serial0'/>
</console>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
<graphics type='vnc' port='5900' autoport='yes' listen='127.0.0.1' keymap='en-us'>
<listen type='address' address='127.0.0.1'/>
</graphics>
<video>
<model type='cirrus' vram='9216' heads='1'/>
<alias name='video0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
</video>
<memballoon model='virtio'>
<alias name='balloon0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</memballoon>
</devices>
<seclabel type='dynamic' model='apparmor' relabel='yes'>
<label>libvirt-00069068-f4bc-41fa-b316-870e78fbe393</label>
<imagelabel>libvirt-00069068-f4bc-41fa-b316-870e78fbe393</imagelabel>
</seclabel>
</domain>
Update:
Also I tried packer but get the same error, when grub shows up.
Here is my template for packer:
{
"builders":
[
{
"type": "qemu",
"iso_url": "/home/galiaf95/Downloads/ubuntu-14.04.3-desktop-amd64.iso",
"iso_checksum": "cab6dd5ee6d649ed1b24e807c877c0ae",
"iso_checksum_type": "md5",
"output_directory": "output_centos_tdhtest",
"shutdown_command": "shutdown -P now",
"disk_size": 8000,
"format": "qcow2",
"headless": false,
"accelerator": "kvm",
"http_port_min": 10082,
"http_port_max": 10089,
"ssh_host_port_min": 2222,
"ssh_host_port_max": 2229,
"ssh_username": "vagrant",
"ssh_password": "vagrant",
"ssh_port": 22,
"ssh_wait_timeout": "7200s",
"vm_name": "tdhtest",
"net_device": "virtio-net",
"disk_interface": "virtio"
}
],
"post-processors": [
{
"keep_input_artifact": false,
"output": "box/ubuntu-1404-server.box",
"type": "vagrant"
}
]
}
ISO file of ubuntu 14.04 I downloaded from ubuntu site.
So my questions are:
What I did wrong and how to solve that
Is there more proper way of building vagrant libvirt boxes from scratch
What I did wrong and how to solve that
can't really help from my side
Is there more proper way of
building vagrant libvirt boxes from scratch
I would recommend using packer as from [v 0.7.2](
https://www.polibyte.com/blog/packer_supports_vagrant-libvirt) packer supports for vagrant-libvirt

wildfly: How to use encrypted password for a xa-datasource?

I have a wildfly 8.2.0.Final running. I use two oracle datasources, one <datasource> and one <xa-datasource>. I want to have my DB passwords encrypted and managed to do that for the datasource using a security-domain but not for the xa-datasource.
I haven't found documentation or other postings with a solution for this problem.
Here is what I've done:
<datasources>
<datasource jta="false" jndi-name="java:/myproject/jdbc/datasources/jdbc" pool-name="my_JDBC_DS" enabled="true" use-ccm="false">
<connection-url>jdbc:oracle:thin:#localhost:1521:DB</connection-url>
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<driver>oracle</driver>
<pool>
<min-pool-size>1</min-pool-size>
<max-pool-size>50</max-pool-size>
</pool>
<security>
<security-domain>databaseSecure</security-domain>
</security>
<validation>
<check-valid-connection-sql>select 1 from dual</check-valid-connection-sql>
<validate-on-match>true</validate-on-match>
<background-validation>false</background-validation>
</validation>
</datasource>
<xa-datasource jndi-name="java:/myproject/jdbc/datasources/db_tx" pool-name="MYTXDS" enabled="true" use-ccm="false">
<xa-datasource-property name="URL">
jdbc:oracle:thin:#localhost:1521:DB
</xa-datasource-property>
<xa-datasource-property name="User">
scott
</xa-datasource-property>
<xa-datasource-property name="Password">
tiger
</xa-datasource-property>
<driver>oracle</driver>
<security>
<user-name>scott</user-name>
<password>tiger</password>
</security>
<xa-pool>
<min-pool-size>1</min-pool-size>
<max-pool-size>50</max-pool-size>
<wrap-xa-resource>false</wrap-xa-resource>
</xa-pool>
<validation>
<check-valid-connection-sql>select 1 from dual</check-valid-connection-sql>
<validate-on-match>true</validate-on-match>
<background-validation>false</background-validation>
</validation>
<statement>
<prepared-statement-cache-size>32</prepared-statement-cache-size>
<share-prepared-statements>true</share-prepared-statements>
</statement>
</xa-datasource>
<drivers>
<driver name="oracle" module="oracle">
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
...
<security-domain name="databaseSecure" cache-type="default">
<authentication>
<login-module code="org.picketbox.datasource.security.SecureIdentityLoginModule" flag="required">
<module-option name="username" value="scott"/>
<module-option name="password" value="-170dd0fbd8c13748"/>
</login-module>
</authentication>
</security-domain>
I've tried removing the xa-datasource-property entries for user and password and referring to the security-domain both nested in the security-tag and on the same level as the properties. Both attempts did not work, with the latter the wildfly exits early because of problems parsing the standalone.xml, with the latter the deployment fails.
To show the most promising attempt, this is how I tried to refer to the security-domain:
<xa-datasource jndi-name="java:/myproject/jdbc/datasources/db_tx" pool-name="MYTXDS" enabled="true" use-ccm="false">
<xa-datasource-property name="URL">
jdbc:oracle:thin:#localhost:1521:DB
</xa-datasource-property>
<driver>oracle</driver>
<security>
<security-domain>databaseSecure</security-domain>
</security>
<xa-pool>
<min-pool-size>1</min-pool-size>
<max-pool-size>50</max-pool-size>
<wrap-xa-resource>false</wrap-xa-resource>
</xa-pool>
<validation>
<check-valid-connection-sql>select 1 from dual</check-valid-connection-sql>
<validate-on-match>true</validate-on-match>
<background-validation>false</background-validation>
</validation>
<statement>
<prepared-statement-cache-size>32</prepared-statement-cache-size>
<share-prepared-statements>true</share-prepared-statements>
</statement>
</xa-datasource>
Doing that the wildfly runs into a javax.resource.ResourceException: No matching credentials in Subject!
I've debugged into the code and although I'm missing the code for the last few classes in the call stack I see that the Subject actually has the credentials as properties but still the AccessController.doPrivilegedcall fails, leading to the above mentioned exception.
You see I'm kind of lost, any suggestions?
I figured it out what I did wrong (by debugging wildfly and staring hard at my working JBoss 4 config..).
In my security-domain configuration I had only set username and password. To make it work I needed to ad the "managedConnectionFactoryName" as well and declare a security-domain for each data source.
I now have the following configuration:
<datasources>
<datasource jta="false" jndi-name="java:/myproject/jdbc/datasources/jdbc" pool-name="my_JDBC_DS" enabled="true" use-ccm="false">
<connection-url>jdbc:oracle:thin:#localhost:1521:DB</connection-url>
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<driver>oracle</driver>
<pool>
<min-pool-size>1</min-pool-size>
<max-pool-size>50</max-pool-size>
</pool>
<security>
<security-domain>jdbcDatabaseSecure</security-domain>
</security>
<validation>
<check-valid-connection-sql>select 1 from dual</check-valid-connection-sql>
<validate-on-match>true</validate-on-match>
<background-validation>false</background-validation>
</validation>
</datasource>
<xa-datasource jndi-name="java:/myproject/jdbc/datasources/db_tx" pool-name="MYTXDS" enabled="true" use-ccm="false">
<xa-datasource-property name="URL">
jdbc:oracle:thin:#localhost:1521:DB
</xa-datasource-property>
<driver>oracle</driver>
<security>
<security-domain>txDatabaseSecure</security-domain>
</security>
<xa-pool>
<min-pool-size>1</min-pool-size>
<max-pool-size>50</max-pool-size>
<wrap-xa-resource>false</wrap-xa-resource>
</xa-pool>
<validation>
<check-valid-connection-sql>select 1 from dual</check-valid-connection-sql>
<validate-on-match>true</validate-on-match>
<background-validation>false</background-validation>
</validation>
<statement>
<prepared-statement-cache-size>32</prepared-statement-cache-size>
<share-prepared-statements>true</share-prepared-statements>
</statement>
</xa-datasource>
<drivers>
<driver name="oracle" module="oracle">
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
</driver>
</drivers>
</datasources>
...
<security-domain name="jdbcDatabaseSecure" cache-type="default">
<authentication>
<login-module code="org.picketbox.datasource.security.SecureIdentityLoginModule" flag="required">
<module-option name="username" value="scott"/>
<module-option name="password" value="-170dd0fbd8c13748"/>
<module-option name = "managedConnectionFactoryName" value="jdbcDatabaseSecure" />
</login-module>
</authentication>
</security-domain>
<security-domain name="txDatabaseSecure" cache-type="default">
<authentication>
<login-module code="org.picketbox.datasource.security.SecureIdentityLoginModule" flag="required">
<module-option name="username" value="scott"/>
<module-option name="password" value="-170dd0fbd8c13748"/>
<module-option name = "managedConnectionFactoryName" value="txDatabaseSecure" />
</login-module>
</authentication>
</security-domain>
And now it works.
I had the same issue when trying to configure xa-datasource with an encrypted security-domains. After struggling a while, I configured vault encryption as described in this guide https://developer.jboss.org/wiki/JBossAS7SecuringPasswords and it works sucessfully with both datasources and xa-datasources.
Hope this helps.
i disabled caching of security-domain by removing cache-type="default" from security-domain in standalone.xml and it works for me
This happens where multiple datasources are defined backed by the same security domain,
- Either make separte security-domain for each datasource or
- if a security domain is to be used with multiple datasources then no caching should be enabled for that domain, this means that each time the PasswordCredential is obtained from the security domain it will be a new instance and do do this remove cache-type="default" from security-domain in standalone.xml
References:
https://community.appian.com/support/w/kb/299/kb-1074-cannot-open-connection-caused-by-javax-resource-resourceexception-no-matching-credentials-in-subject-error-thrown-during-jboss-startup
https://bugzilla.redhat.com/show_bug.cgi?id=1103684

WSO2 EBS- WSDL Proxy- 2 Ports

We want to create a WSDL proxy on WSO2 ESB. The WSDL has 2 ports defined, each port defines its own
operations.
The problem is when I create the WSDL proxy and specify one of the port, the operation associated with that port is not exposed, rather the operation associated with port 2 is exposed... looks like no matter which port I point to, the operation exposed doesnt change..
My question is how can i make this work, or multiple ports in WSDL is not supported by WSO2 ESB ?
......
<wsdl:portType name="IxxxxService">
<wsdl:operation name="xxxRecordEntry">
<wsdl:input
wsaw:Action="http://tempuri.org/IxxxService/xxxRecordEntry"
message="tns:IxxxService_xxxRecordEntry_InputMessage" />
<wsdl:output
wsaw:Action="http://tempuri.org/IxxxService/xxxRecordEntryResponse"
message="tns:IxxxService_xxxRecordEntry_OutputMessage" />
</wsdl:operation>
<wsdl:operation name="xxxRecord">
<wsdl:input
wsaw:Action="http://tempuri.org/IxxxServiceMoniker/xxxRecord"
message="tns:IxxxServiceMoniker_xxxRecord_InputMessage" />
<wsdl:output
wsaw:Action="http://tempuri.org/IxxxServiceMoniker/xxxRecordResponse"
message="tns:IxxxServiceMoniker_xxxRecord_OutputMessage" />
</wsdl:operation>
</wsdl:portType>
<wsdl:portType name="IxxxServiceMoniker">
<wsdl:operation name="xxxRecord">
<wsdl:input
wsaw:Action="http://tempuri.org/IxxxMoniker/xxxRecord"
message="tns:IxxxServiceMoniker_xxxRecord_InputMessage" />
<wsdl:output
wsaw:Action="http://tempuri.org/IxxxServiceMoniker/xxxRecordResponse"
message="tns:IxxxServiceMoniker_xxxRecord_OutputMessage" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="BasicHttpBinding_IxxxService"
type="tns:IxxxService">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="xxxRecordEntry">
<soap:operation
soapAction="http://tempuri.org/IxxxService/xxxRecordEntry"
style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="BasicHttpBinding_IxxxMoniker"
type="tns:IxxxMoniker">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="xxxRecord">
<soap:operation
soapAction="http://tempuri.org/IxxxMoniker/xxxRecord"
style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="xxxService">
<wsdl:port name="BasicHttpBinding_IxxxService" binding="tns:BasicHttpBinding_IxxxService">
<soap:address location="http://aaaaa:pppp/xxxService.xxxService.svc"/>
</wsdl:port>
<wsdl:port name="BasicHttpBinding_IxxxServiceMoniker" binding="tns:BasicHttpBinding_IxxxServiceMoniker">
<soap:address location="http://aaaaa:pppp/xxxService.xxxService.svc/mo"/>
</wsdl:port>
</wsdl:service>
Proxy Configuration
<proxy xmlns="http://ws.apache.org/ns/synapse" name="testing20" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
<target>
<outSequence>
<send/>
</outSequence>
<endpoint>
<wsdl service="xxxService" port="BasicHttpBinding_IxxxService" uri="http://xxx:ppp/xxxLoggerService.xxxService.svc?wsdl"/>
</endpoint>
</target>
<publishWSDL uri="http://xxx:ppp/xxxLoggerService.xxxService.svc?wsdl"/>
<parameter name="useOriginalwsdl">true</parameter>
<parameter name="modifyUserWSDLPortAddress">true</parameter>
<description></description>
</proxy>
What is your proxy configuration? And which operations caused issue?
When you create proxy, you can disable unwanted bindings.That is, you can disable soap11 or soap12.
eg:<parameter name="disableSOAP12">true</parameter>

Resources