I have this simple jsp page with a button. On clicking it passes to a servlet which calls a database function,retrieves value from db and returns the value back to the jsp and displays it. This project works fine in netbeans using glassfish. Now i have a server in OCI. downloaded apache tomcat 8 from the internet and unzipped it in the home folder of this oci server and deployed this project in webapps folder -the jsp retrieves and displays data fine. Everything is fine. Now in the same server i installed another tomcat using yum command and it got installed in the root. So here when i click on the button the data retrival doesnt work. As soon as i click on the button in the jsp it throws error "SEVERE: SQLException while connecting to dbjava.sql.SQLException: Io exception: The Network Adapter could not establish the connection". I have no idea why is this simple connection not being established only in this root installed tomcat. I am new to tomcat. I couldnt find an answer online. Found the path also weird as below.
log path:-/var/log/tomcat
webapps path:/var/lib/tomcat/webapps.
I am using jdbc thin connection.
jdbc:oracle:thin:#xxx.xx.xx.xx:1521:aaaaa
Judging fron the exception infomation,your app server is not connect to database server,so you should check the app server is connect to your database server。
Related
I'm using Eclipse Keplar and I've updated to the latest jboss oxygen tools. when i try to create a new connection via openshift explorer it's still showing me the old interface and not letting me select the server type as described here: https://blog.openshift.com/getting-started-eclipse-jboss-tools-openshift-online-3/
what am I missing? followed those steps exactly and still getting openshift 2 connection dialog.
UPDATE: Even when trying to force it to connect to server url: https://console.starter-ca-central-1.openshift.com it still is trying to connect to v2 and not v3.
So I just got internship at this company, and they would like me to complete a project(Web application) which someone else did but didn't finish two years ago. But the person didn't leave any documentation about this web app. Right now I would like to run and test this web app, but I couldn't get it started.
So it's running on WebSphere Application Server in IBM Rational Application Developer, the code is written in java and javascript. (I could start the server, but I don't know where to go and open up the web app)
Sorry I'm really new to this, questions might be stupid, appreciate any help:)
Do you know what port it's running on? You should be able to access it from a web browser on the host machine by going to
http://127.0.0.1:XX
where XX is the port in question. If you don't know, try 80 - that's the default HTTP port and it's worth a shot.
The default websphere web port is 9080, so try http://localhost:9080/
So it's running on WebSphere Application Server in IBM Rational Application Developer
and
I could start the server
Assuming you are able to start the server via RAD as I assume from the above and you are able to publish the app to WebSphere via RAD, you should then be able to right click on the project folder and choose "Run on Server." It will walk you through publishing the app to the server and will then launch a browser to the index page or URL via the context path and web project settings. You can have RAD use an embedded browser (default) or adjust it to launch an external browser via Preferences -> Web Browser.
To manually check where a webapp will be deployed you can either check application.xml (if you have one) OR you can right click on the project root folder in RAD, choose Properties, and Web Project Settings. The context path is in a field there.
Run-On-Server will show you both server/hostname (usually localhost), port, and application context path in one operation.
I am trying to deploy the example form based authentication application to my glassfish server, but everytime I launch the application, I am redirected to yahoo, saying that
The requested URL "http://localhost:8080/com-byteslounge-jaas/" cannot be found or is not available. Please check the spelling or try again later.
Anyone have any ideas? I downloaded the source straight from here:
http://www.byteslounge.com/tutorials/jaas-form-based-authentication-in-tomcat-example
You can also launch Server Domain Console (http://localhost:4848 by default) and there, in Applications section, You should have Your app listed. You can see the URL to Your app either by clicking it's name or by clicking Launch link on the right.
The example in your linked article describe the URL is http://localhost:8080/com-byteslounge-jaas-1.0-SNAPSHOT, have you ensured you deploy the app to the same context path you're requesting? Check glassfish log to see what context path your app is deployed as
I have the following problem with my javafx application:
I'm using RMI to connect client app to server, and everything goes fine, until I run application in web browser or standalone mode. In this case, RMI doesn't work properly, but don't throw any exceptions. I cant send any message to server. Problem disappears when I run program in IDE or by clicking on jar file.
I think, that it can be connected with some browser privileges, and application launched in that context probably doesn't have access to network adapter.
Any ideas how to fix that?
EDIT: There was an exception that was invisible for me: java.net.SocketPermission. So as I thought, access to socked is denied. What is the solution to this problem?
An unsigned applet can only connect to the host it was loaded from. So, either change your topology or sign the applet.
I developed an application with a java db database .I cannot access the database records when I close the netbeans IDE with the message "Error connecting to server Localhost on port..." My connection code to the Database is :
String host="jdbc:derby://localhost:1527/Employee;create=true";
String user="admin";
String pass="admin";
con=DriverManager.getConnection(host,user,pass);
How do I fix the problem?
Netbeans automatically starts the Derby server; you can see that in the "Services" tab (Ctrl-5).
You'll have to start the database server by hand if you don't use Netbeans; see the doc.
Presumably your Derby database is hosted in NetBeans? You'll need to create a standalone database.
You would have to probably start your database before connecting (you are using server mode). Have a look into Vogella tutorial on Derby db connection from java application: http://www.vogella.de/articles/ApacheDerby/article.html
I guess NetBeans has an embedded DB instance.
Try to use
jdbc:derby:/MyFolder/MyDatabase/Employee;create=true
or
jdbc:derby:C:\MyFolder\MyDatabase\Employee;create=true
if you do not need to access the DB from multiple applications.
You can use JavaDB (aka Derby) either by connecting to a JavaDB Network Server or by using it as an embedded DB when your application opens the DB files itself.
Currently, your application is connecting to a Network Server started by NetBeans, as your URL is telling to connect to port 1527 on localhost, i.e. your system.
What you need to do is tell your application to use JavaDB as an embedded database, i.e. it should manage the database itself instead of getting Netbeans to do it instead. You can do this just be changing the URL to something like:
jdbc:derby:Employee;create=true
You may need to tweak that URL depending on where the database files are stored relative to your application's working directory.
Only one application can have the DB open at one time. So when you're doing this NetBeans won't be able to open the database, and if NetBeans has the database open your application won't be able to open it. So you may find you want to reconfigure NetBeans as a DB client.
the simplest way of dealing with these problems is creating batch files..
first of all build your java database program.. the tricky part is to start the server. the jderby is a server so it needs to be started.. that's why you start the server in netbeans. so download db derby files from "http://db.apache.org/derby/releases/release-10.8.2.2.html". after you download these files, copy your netbeans project in those db jderby files.. go and copy your database folders from where they will be saved.. and paste them in the db jderby files.. now open notepad and type
#echo
start (PATH)
start (PATH)
the first path take the path of the file named start network server.bat
the second path take the path of the jar file of your main project.
Now save your the notepad as setup.bat and run the batch file afterward.. and ur program will start the server and running your application at once...
NB: you can use a different name from setup, any of your choice but the extension bat must be available