Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Weblogic datasource how to config?

 
Johan Blo
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to connect to my datasource which I've configured in weblogic, but something goes wrong, any help out there? Im i doing the jndi-name/res-ref-name right??
Name: fiskDS
JNDI Name: jdbc/fisk
Type: Gridlink

Am i using them wrong?
In Oracle documentation it says:
<res-ref-name> Specifies the name of a resource reference.
<jndi-name> Specifies a JNDI name for the resource.

Should the <jndi-name> be jdbc/fisk?



Also tried this, only trying to connect to the weblogic datasource, but didn't work?


weblogic.xml


web.xml
 
Akhilesh Trivedi
Ranch Hand
Posts: 1603
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you setting JNDI name based on application or changing the application based on jndi name. I think the later part is more easy. Which weblogic version are you on? You can check the JNDI name through Admin Console?

 
Johan Blo
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Akhilesh Trivedi wrote:Are you setting JNDI name based on application or changing the application based on jndi name. I think the later part is more easy.


Im supposed to do a resource lookup, the JNDI name is already set in weblogic? (feels confused)
 
Akhilesh Trivedi
Ranch Hand
Posts: 1603
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Johan Blo wrote:
Should the <jndi-name> be jdbc/fisk?


Why not give a try?
 
Johan Blo
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Akhilesh Trivedi wrote:
Johan Blo wrote:
Should the <jndi-name> be jdbc/fisk?


Why not give a try?

Feels like I've tried everything but the only solution which should work...
 
Akhilesh Trivedi
Ranch Hand
Posts: 1603
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did it work?
 
Johan Blo
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Akhilesh Trivedi wrote:Did it work?

No, i meant I've already tried it before making this thread, but it didnt work, but maybe it is right, but the configuration of the rest of the settings are wrong... Therefor I'm asking here
 
Akhilesh Trivedi
Ranch Hand
Posts: 1603
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How did you configure datasource name in weblogic?
 
Johan Blo
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Akhilesh Trivedi wrote:How did you configure datasource name in weblogic?


What else than Name and JNDI name are you thinking about? The datasource name is fiskDS and the JNDI-name in it is jdbc/fisk, it's a datasource connected to several databases
 
Akhilesh Trivedi
Ranch Hand
Posts: 1603
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would try two options.




 
Johan Blo
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Akhilesh Trivedi wrote:I would try two options.






Yeah i've tried jdbc/fisk (removed the .xml files) and java:comp/env/jdbc/fisk, didnt work.. I'll try the fiskDS but that one is just the name of the datasource, not the lookup name
 
Akhilesh Trivedi
Ranch Hand
Posts: 1603
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure why are you needing those XML files after setting up the data-source. Why not you write a simple client and see if you are able to get the connection from the pool? I strongly believe you would need a weblogic.jar.
 
Johan Blo
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Akhilesh Trivedi wrote:I am not sure why are you needing those XML files after setting up the data-source. Why not you write a simple client and see if you are able to get the connection from the pool? I strongly believe you would need a weblogic.jar.


That was what I meant in my last post, I realised I might not need them unless i want to rename the datasource. But it still doesnt work. Haven't found any information about any weblogic.jar?

What I'm not using is the INITIAL_CONTEXT_FACTORY, there are plenty of examples not using this one?
And another thing, i get the error:
namingexception String index out of range: -1
 
Akhilesh Trivedi
Ranch Hand
Posts: 1603
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You would need weblogic.jar if you have been using INITIAL_CONTEXT_FACTORY



Can you post your code?
 
Akhilesh Trivedi
Ranch Hand
Posts: 1603
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Johan Blo wrote:Im supposed to do a resource lookup, the JNDI name is already set in weblogic? (feels confused)


Yes it is already set in weblogic at the time when you create the pool/data-source. It is after you creating the data-source you go on with a client to get a connection from the pool and further on the way.
 
Johan Blo
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Akhilesh Trivedi wrote:You would need weblogic.jar if you have been using INITIAL_CONTEXT_FACTORY


Can you post your code?


Thanks a lot for the help so far!



I will however need to wait until tomorrow to be able to generate the wlfullclient.jar (wls 10.3.x)

But let say i would use JPA/hibernate instead, I wouldn't need to use wlfullclient.jar i guess...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic