I am developing a Web Application in java, deployed in a WebLogic server. I have the server created with the datasource to an oracle database that works fine.
In the other side, I have the WebApplication that I can´t deploy in the server. When I clic in the button "Deploy", the following message appear in the "server log".
Exception Description: Cannot acquire data source [jdbc/siam].
Internal Exception: javax.naming.NameNotFoundException: While trying
to lookup 'jdbc.siam' didn't find subcontext 'jdbc'. Resolved '';
remaining name 'jdbc/siam'
"jdbc/siam" -> is the name of the datasource that I want to use in my webapplication.
I hope you can help me.
Sorry for my English.
Thank you.
/UPDATE/
I have the connection to the database defined in the server side.
I can´t include images, but I can view the database connection in the netbeans and the name for jndi is "jdni/siam".
And in the administration console of the weblogic, I can view it as datasource with the same name.
It appears you are using JNDI to configure your Datasource.
Is jdbc/siam already configured as a JNDI resource at the server side? Here is a good start:
Configuring and Managing WebLogic JDBC
Hope it helps.
Related
I am trying to do JNDI lookup using JMS and JBoss for my practice application.
But I am not able to figure out why it is not able to lookup.
I added entries into destination-service.xml for JBoss.
But as you can see my code in the images, its still giving me an error.
Is there any code part that I am missing or do I have to add some jar file to path or some other problem do you see after looking at my stacktrace for the error.
My Class
destination-service.xml
Error
It looks like you can't connect to the JNDI server at all.
Check host/port of the jndi server that you supply in the client code
As a 'self-check' I would also try to connect to any other object that resides in the JNDI tree, I think the exception will be the same :)
Hope this helps
When you start jboss, use "run.sh -b 0.0.0.0". By default, jboss is secure and bound to localhost only.
Maybe this will help you.
I am working in a typical Dev->QA->Production environment, and it appears that our Dev environment is configured differently than our QA environment, but I'm not sure where to look for the problem, as I'm not very familiar with WebLogic's core configuration.
I've developed a web service that uses the Spring framework's distributed transaction support, and all of our JNDI connection entries on the Weblogic server are configured to use the Oracle XA driver. While everything works just fine in our development environment, I am getting the following error on QA:
org.springframework.jdbc.CannotGetJdbcConnectionException:
Could not get JDBC Connection;
nested exception is java.sql.SQLException: Pool connect failed :
java.lang.Exception: WebLogic Pool Driver doesn't support XA driver,
Please change your config to use a Non-XA driver
From what I can gather, this is a configuration issue with Weblogic itself, not the individual JNDI data sources.
I know it's not a lot to go on, but if someone could give me some idea where to start looking, I would appreciate the help.
Turns out our WebLogic Admin had not restarted the connection pool as he said he did. Sorry for posting the question. Everything is working as expected now.
I am trying to point a Tomcat webapp from one Oracle database to another. To do so, I navigated to the webapps/[my web app]/WEB-INF/classes folder, and I edited the jdbc.properties file so as to change the connection URL, user, and password.
As soon as I did this, the webapp failed to work (it was working before). I end up getting Apache Tomcat error 404 - "The requested resource [my web app] is not available".
I know that the connection URL along with the user/password combo work perfectly fine, as I have tested it in SQL clients. Does anyone know why my webapp failed to work after my modifications? Are there any other modifications that I have to make?
I've tried researching how to use the DataSource method of connecting to a database but never could find out how. I know that a DataSource is first configured and registered to JNDI in an application that is separate from the user application, and all the user application will do is retrieve it using JNDI. What I don't understand is where the DataSource is configured. Is it automatically registered when I turn on MySQL, do I need to download another application to register it, or do I make a new class that will do that for me?
You usually have a Java EE app server like Glassfish, WebLogic, JBOSS, Tomcat, or Jetty have a JNDI provider that you should be using for the lookup.
Here's how you do it with Oracle.
Here's how you do it with MySQL.
The JDK 6 javadocs say that a basic DataSource can supply a connection if your driver has such an implementation. I would recommend looking at the Connector-J docs to see if you can do it without JNDI lookup services.
I just installed Windows 7 with NetBeans 6.5.1 and JDK 6u16. I've checked out the Web application project with SVN, which is working with Spring security. Libraries are imported, no reference problems, the same configuration worked with XP.
Here's the beginning of the exception:
WebModule[/db3]PWC1275: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
Full version Here.
Please if you have any suggestions, write below!
Thanks in advance!
It looks like the issue is that Spring can't find a DataSource resource named "db3" that is supposed to be defined in JNDI. Are the necessary JNDI resources configured in the application server you're using?
If you just installed your operating system, chances are you also just installed your application server. Your web application depends on a database definition in the application server (JNDI). I may be wrong, but it looks like you are using GlassFish as the application server, if that is the case, you can setup a JNDI datasource from the admin console.