0

I have a small issue in which my maven project does not have a Target Resource JNDI Name.

A brief overview of this project. I have three java projects: The Maven Ear, the back end (base livraries) project and the UI project. All of which are maven, have dependencies I need, compile and run with a main app which emulates the WAS.

So far the most relevant help I could find was to make sure I have a ibm-web-bnd.xml I do have this file as I converted an existing UI project to a maven project. The project looks like this.

enter image description here

In my web.xml I also have

<resource-ref>
    <description>
    </description>
    <res-ref-name>jdbc/DataSource</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    <res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>

In my ibm-web-bnd.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-bnd 
xmlns="http://websphere.ibm.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://websphere.ibm.com/xml/ns/javaee http://websphere.ibm.com/xml/ns/javaee/ibm-web-bnd_1_0.xsd"
version="1.0">

<virtual-host name="default_host" />
<resource-ref name="jdbc/DataSource" binding-name="jdbc/DataSource"/>

As it has been pointed out, I did not ask a question.

My question is how do I set a JNDI Resource Reference for my Maven UI project in WebSphere. I have all the required files and bindings for the project yet I can not run the maven EAR with the UI project in it. I always get the error:

A resource reference binding could not be found for the jdbc/DataSource resource reference, defined for the codecoverageUI component.
Michael Miner
  • 964
  • 2
  • 17
  • 39
  • And what is your question? As I'm completely lost reading your post ;-) – Gas Aug 19 '15 at 20:56
  • Can you add the content of the ibm-web-bnd.xml file to the question? – Alasdair Aug 19 '15 at 23:22
  • what exactly are you trying to accomplish? – Prerak Tiwari Aug 20 '15 at 00:33
  • I have an actual question now – Michael Miner Aug 20 '15 at 13:20
  • Is this previous answer of any use? [How do I connect to a Websphere Datasource with a given JNDI name?](http://stackoverflow.com/q/7167212/4070879) it appears to have a JNDI resource mapping that might help. – r1chjc Aug 20 '15 at 13:38
  • @r1chjc The issue is that my files look exactly like those, but the resource binding still is not found. I was wondering if there was a setting I need in my EAR or UI project pom.xml – Michael Miner Aug 20 '15 at 13:43
  • I've never set up anything JNDI related such as this in my pom file - (others with more knowledge may be able to suggest something of course). The only other thing I can think of for the moment (which might be a little on the wrong track) is, when you converted from an existing UI project to maven, did it work previously? And if so, are all the config files etc present in the new ear file? Any odd exclusions or alterations you can spot that may indicate a change needed to the packaging set up? – r1chjc Aug 20 '15 at 14:42
  • No when I did the conversion everything worked, there were no errors. Originally the project before conversion would work in a JSF ear. I now have my Maven ear which is not working – Michael Miner Aug 20 '15 at 15:26

0 Answers0