Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » resource mapping in glassfish-ejb-jar.xml
resource mapping in glassfish-ejb-jar.xml [message #1829661] Wed, 08 July 2020 11:42 Go to next message
Alex Timin is currently offline Alex TiminFriend
Messages: 2
Registered: July 2020
Junior Member
Hi all.

Can not understand what is wrong with glassfish resource mapping.
I've created a simple java ee application (NetBeans + Glassfish 5-0).
In my session bean i've included a ref to a global DataSource (which is working well)

@Resource (name = "jdbc/HRData")
    DataSource ds;


Then i've added glassfish-ejb-jar.xml descriptor and put this inside

resource-ref>
        <res-ref-name>jdbc/HRData</res-ref-name>
        <jndi-name>jdbc/HRDataSource</jndi-name>
</resource-ref>


where jdbc/HRDataSource is my DataSource jndi name (which is working!)

When i try to deploy and test my client jsf i get

java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: java.net.ConnectException : Ошибка соединения с сервером localhost на порту 1 527 с сообщением Connection refused: connect.

But if do the resource mapping via mappedName in Resource annotation

@Resource (name = "jdbc/HRData", mappedName = "jdbc/HRDataSource")
    DataSource ds;


it works!!!


what is wrong with glassfish-ejb-jar.xml descriptor. The configuration folder where it is located seems to be included into the deployment profile...

Thanks in advance. Alex.

Re: resource mapping in glassfish-ejb-jar.xml [message #1829667 is a reply to message #1829661] Wed, 08 July 2020 12:47 Go to previous message
Manoj Palat is currently offline Manoj PalatFriend
Messages: 10
Registered: October 2014
Junior Member
Hi Alex,
You've reached the wrong forum; this forum is for Java Development Tools (JDT).

Regards,
Manoj.


Manoj N Palat
Eclipse Java Development Tools (JDT).
Previous Topic:Wild West Developer ("WWD") is a dubious upgrade
Next Topic:Garbled characters in Eclipse/Spring Tool Suite UI
Goto Forum:
  


Current Time: Wed Oct 28 14:33:42 GMT 2020

Powered by FUDForum. Page generated in 0.12683 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top