Getting exception while connecting to oracle database using JSP program
I have create a jsp program and added in tomcat docker while testing in local desktop i am getting below exception.
java.sql.SQLRecoverableException: IO Error: The Network Adapter could
not establish the connection.
i am using oracle database 12c docker.
First i have create below stack file.
stack file:
version: "3.7"
services:
oracle:
image: sath89/oracle-12c:latest
ports:
- "8080:8080"
- "1521:1521"
stop_grace_period: 1m0s
deploy:
replicas: 1
restart_policy:
condition: on-failure
max_attempts: 3
networks:
- fronter
jsp:
image: bitroid/jsp-db-docker
ports:
- "8888:8080"
networks:
- fronter
depends_on:
- oracle
deploy:
replicas: 1
restart_policy:
condition: on-failure
max_attempts: 3
networks:
fronter:
after creating above stack file i used below command to deploy docker in local system.
$docker stack deploy jsp_oracle -c pwdcmdstack.yml
and after deploying i have provisioned oracle database docker with below scripts.
docker exec -it --user root jsp_oracle_oracle.1.zqz4r7k4x1cxdagh9fj415u5p /bin/bash -c "apt-get update -y;apt-get install git -y --force-yes"
docker exec -it --user root jsp_oracle_oracle.1.zqz4r7k4x1cxdagh9fj415u5p /bin/bash -c "git clone https://github.com/hemanth22/Oracle_database.git"
docker exec -it --user root jsp_oracle_oracle.1.zqz4r7k4x1cxdagh9fj415u5p /bin/bash -c "chmod -R 777 Oracle_database;cd /Oracle_database;ls -la"
docker exec -it --user oracle jsp_oracle_oracle.1.zqz4r7k4x1cxdagh9fj415u5p /bin/bash -c "netstat -nlpt"
docker exec -it --user oracle jsp_oracle_oracle.1.zqz4r7k4x1cxdagh9fj415u5p /bin/bash -c "ls && cd Oracle_database && ls && bash login.sh"
Can you please check and advice how get ride of the java.sql.SQLRecoverableException
Thanks and regards,
Hemanth.
jsp docker
add a comment |
I have create a jsp program and added in tomcat docker while testing in local desktop i am getting below exception.
java.sql.SQLRecoverableException: IO Error: The Network Adapter could
not establish the connection.
i am using oracle database 12c docker.
First i have create below stack file.
stack file:
version: "3.7"
services:
oracle:
image: sath89/oracle-12c:latest
ports:
- "8080:8080"
- "1521:1521"
stop_grace_period: 1m0s
deploy:
replicas: 1
restart_policy:
condition: on-failure
max_attempts: 3
networks:
- fronter
jsp:
image: bitroid/jsp-db-docker
ports:
- "8888:8080"
networks:
- fronter
depends_on:
- oracle
deploy:
replicas: 1
restart_policy:
condition: on-failure
max_attempts: 3
networks:
fronter:
after creating above stack file i used below command to deploy docker in local system.
$docker stack deploy jsp_oracle -c pwdcmdstack.yml
and after deploying i have provisioned oracle database docker with below scripts.
docker exec -it --user root jsp_oracle_oracle.1.zqz4r7k4x1cxdagh9fj415u5p /bin/bash -c "apt-get update -y;apt-get install git -y --force-yes"
docker exec -it --user root jsp_oracle_oracle.1.zqz4r7k4x1cxdagh9fj415u5p /bin/bash -c "git clone https://github.com/hemanth22/Oracle_database.git"
docker exec -it --user root jsp_oracle_oracle.1.zqz4r7k4x1cxdagh9fj415u5p /bin/bash -c "chmod -R 777 Oracle_database;cd /Oracle_database;ls -la"
docker exec -it --user oracle jsp_oracle_oracle.1.zqz4r7k4x1cxdagh9fj415u5p /bin/bash -c "netstat -nlpt"
docker exec -it --user oracle jsp_oracle_oracle.1.zqz4r7k4x1cxdagh9fj415u5p /bin/bash -c "ls && cd Oracle_database && ls && bash login.sh"
Can you please check and advice how get ride of the java.sql.SQLRecoverableException
Thanks and regards,
Hemanth.
jsp docker
add a comment |
I have create a jsp program and added in tomcat docker while testing in local desktop i am getting below exception.
java.sql.SQLRecoverableException: IO Error: The Network Adapter could
not establish the connection.
i am using oracle database 12c docker.
First i have create below stack file.
stack file:
version: "3.7"
services:
oracle:
image: sath89/oracle-12c:latest
ports:
- "8080:8080"
- "1521:1521"
stop_grace_period: 1m0s
deploy:
replicas: 1
restart_policy:
condition: on-failure
max_attempts: 3
networks:
- fronter
jsp:
image: bitroid/jsp-db-docker
ports:
- "8888:8080"
networks:
- fronter
depends_on:
- oracle
deploy:
replicas: 1
restart_policy:
condition: on-failure
max_attempts: 3
networks:
fronter:
after creating above stack file i used below command to deploy docker in local system.
$docker stack deploy jsp_oracle -c pwdcmdstack.yml
and after deploying i have provisioned oracle database docker with below scripts.
docker exec -it --user root jsp_oracle_oracle.1.zqz4r7k4x1cxdagh9fj415u5p /bin/bash -c "apt-get update -y;apt-get install git -y --force-yes"
docker exec -it --user root jsp_oracle_oracle.1.zqz4r7k4x1cxdagh9fj415u5p /bin/bash -c "git clone https://github.com/hemanth22/Oracle_database.git"
docker exec -it --user root jsp_oracle_oracle.1.zqz4r7k4x1cxdagh9fj415u5p /bin/bash -c "chmod -R 777 Oracle_database;cd /Oracle_database;ls -la"
docker exec -it --user oracle jsp_oracle_oracle.1.zqz4r7k4x1cxdagh9fj415u5p /bin/bash -c "netstat -nlpt"
docker exec -it --user oracle jsp_oracle_oracle.1.zqz4r7k4x1cxdagh9fj415u5p /bin/bash -c "ls && cd Oracle_database && ls && bash login.sh"
Can you please check and advice how get ride of the java.sql.SQLRecoverableException
Thanks and regards,
Hemanth.
jsp docker
I have create a jsp program and added in tomcat docker while testing in local desktop i am getting below exception.
java.sql.SQLRecoverableException: IO Error: The Network Adapter could
not establish the connection.
i am using oracle database 12c docker.
First i have create below stack file.
stack file:
version: "3.7"
services:
oracle:
image: sath89/oracle-12c:latest
ports:
- "8080:8080"
- "1521:1521"
stop_grace_period: 1m0s
deploy:
replicas: 1
restart_policy:
condition: on-failure
max_attempts: 3
networks:
- fronter
jsp:
image: bitroid/jsp-db-docker
ports:
- "8888:8080"
networks:
- fronter
depends_on:
- oracle
deploy:
replicas: 1
restart_policy:
condition: on-failure
max_attempts: 3
networks:
fronter:
after creating above stack file i used below command to deploy docker in local system.
$docker stack deploy jsp_oracle -c pwdcmdstack.yml
and after deploying i have provisioned oracle database docker with below scripts.
docker exec -it --user root jsp_oracle_oracle.1.zqz4r7k4x1cxdagh9fj415u5p /bin/bash -c "apt-get update -y;apt-get install git -y --force-yes"
docker exec -it --user root jsp_oracle_oracle.1.zqz4r7k4x1cxdagh9fj415u5p /bin/bash -c "git clone https://github.com/hemanth22/Oracle_database.git"
docker exec -it --user root jsp_oracle_oracle.1.zqz4r7k4x1cxdagh9fj415u5p /bin/bash -c "chmod -R 777 Oracle_database;cd /Oracle_database;ls -la"
docker exec -it --user oracle jsp_oracle_oracle.1.zqz4r7k4x1cxdagh9fj415u5p /bin/bash -c "netstat -nlpt"
docker exec -it --user oracle jsp_oracle_oracle.1.zqz4r7k4x1cxdagh9fj415u5p /bin/bash -c "ls && cd Oracle_database && ls && bash login.sh"
Can you please check and advice how get ride of the java.sql.SQLRecoverableException
Thanks and regards,
Hemanth.
jsp docker
jsp docker
edited Nov 23 '18 at 6:51
secret super star
88414
88414
asked Nov 23 '18 at 6:45
Bitra HemanthBitra Hemanth
14
14
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Cause:
This error occurs when there are some issues with the Firewall on the Oracle server.
Solution:
To resolve this issue, ensure that the Firewall is open from both sides of the network, that is the Oracle Database should be able to connect back to ambari-server. And on the OS, ensure that the iptables or firewall is stopped or allows traffic on port 1521.
Ref: https://community.hortonworks.com/content/supportkb/150193/io-error-the-network-adapter-could-not-establish-t.html
i have checked the blog but i could see it is an issue for ambari server, but i am using tomcat server and more over i have add to ports 1521,8080,8888 using this command : firewall-cmd --add-port=1521/tcp,8080/tcp,8888/tcp --permanent --zone=public and after adding ports to firewall i have done reload also
– Bitra Hemanth
Dec 12 '18 at 6:25
Hi all, Issue solved for me instead of adding localhost i have added ip address of oracle docker hence resolved. When i have configured localhost it is point to tomcat docker instead pointing to oracle docker.
– Bitra Hemanth
Dec 12 '18 at 7:30
Happy to hear :)
– Senthil
Dec 12 '18 at 8:30
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53441816%2fgetting-exception-while-connecting-to-oracle-database-using-jsp-program%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Cause:
This error occurs when there are some issues with the Firewall on the Oracle server.
Solution:
To resolve this issue, ensure that the Firewall is open from both sides of the network, that is the Oracle Database should be able to connect back to ambari-server. And on the OS, ensure that the iptables or firewall is stopped or allows traffic on port 1521.
Ref: https://community.hortonworks.com/content/supportkb/150193/io-error-the-network-adapter-could-not-establish-t.html
i have checked the blog but i could see it is an issue for ambari server, but i am using tomcat server and more over i have add to ports 1521,8080,8888 using this command : firewall-cmd --add-port=1521/tcp,8080/tcp,8888/tcp --permanent --zone=public and after adding ports to firewall i have done reload also
– Bitra Hemanth
Dec 12 '18 at 6:25
Hi all, Issue solved for me instead of adding localhost i have added ip address of oracle docker hence resolved. When i have configured localhost it is point to tomcat docker instead pointing to oracle docker.
– Bitra Hemanth
Dec 12 '18 at 7:30
Happy to hear :)
– Senthil
Dec 12 '18 at 8:30
add a comment |
Cause:
This error occurs when there are some issues with the Firewall on the Oracle server.
Solution:
To resolve this issue, ensure that the Firewall is open from both sides of the network, that is the Oracle Database should be able to connect back to ambari-server. And on the OS, ensure that the iptables or firewall is stopped or allows traffic on port 1521.
Ref: https://community.hortonworks.com/content/supportkb/150193/io-error-the-network-adapter-could-not-establish-t.html
i have checked the blog but i could see it is an issue for ambari server, but i am using tomcat server and more over i have add to ports 1521,8080,8888 using this command : firewall-cmd --add-port=1521/tcp,8080/tcp,8888/tcp --permanent --zone=public and after adding ports to firewall i have done reload also
– Bitra Hemanth
Dec 12 '18 at 6:25
Hi all, Issue solved for me instead of adding localhost i have added ip address of oracle docker hence resolved. When i have configured localhost it is point to tomcat docker instead pointing to oracle docker.
– Bitra Hemanth
Dec 12 '18 at 7:30
Happy to hear :)
– Senthil
Dec 12 '18 at 8:30
add a comment |
Cause:
This error occurs when there are some issues with the Firewall on the Oracle server.
Solution:
To resolve this issue, ensure that the Firewall is open from both sides of the network, that is the Oracle Database should be able to connect back to ambari-server. And on the OS, ensure that the iptables or firewall is stopped or allows traffic on port 1521.
Ref: https://community.hortonworks.com/content/supportkb/150193/io-error-the-network-adapter-could-not-establish-t.html
Cause:
This error occurs when there are some issues with the Firewall on the Oracle server.
Solution:
To resolve this issue, ensure that the Firewall is open from both sides of the network, that is the Oracle Database should be able to connect back to ambari-server. And on the OS, ensure that the iptables or firewall is stopped or allows traffic on port 1521.
Ref: https://community.hortonworks.com/content/supportkb/150193/io-error-the-network-adapter-could-not-establish-t.html
answered Nov 23 '18 at 7:15
SenthilSenthil
7921515
7921515
i have checked the blog but i could see it is an issue for ambari server, but i am using tomcat server and more over i have add to ports 1521,8080,8888 using this command : firewall-cmd --add-port=1521/tcp,8080/tcp,8888/tcp --permanent --zone=public and after adding ports to firewall i have done reload also
– Bitra Hemanth
Dec 12 '18 at 6:25
Hi all, Issue solved for me instead of adding localhost i have added ip address of oracle docker hence resolved. When i have configured localhost it is point to tomcat docker instead pointing to oracle docker.
– Bitra Hemanth
Dec 12 '18 at 7:30
Happy to hear :)
– Senthil
Dec 12 '18 at 8:30
add a comment |
i have checked the blog but i could see it is an issue for ambari server, but i am using tomcat server and more over i have add to ports 1521,8080,8888 using this command : firewall-cmd --add-port=1521/tcp,8080/tcp,8888/tcp --permanent --zone=public and after adding ports to firewall i have done reload also
– Bitra Hemanth
Dec 12 '18 at 6:25
Hi all, Issue solved for me instead of adding localhost i have added ip address of oracle docker hence resolved. When i have configured localhost it is point to tomcat docker instead pointing to oracle docker.
– Bitra Hemanth
Dec 12 '18 at 7:30
Happy to hear :)
– Senthil
Dec 12 '18 at 8:30
i have checked the blog but i could see it is an issue for ambari server, but i am using tomcat server and more over i have add to ports 1521,8080,8888 using this command : firewall-cmd --add-port=1521/tcp,8080/tcp,8888/tcp --permanent --zone=public and after adding ports to firewall i have done reload also
– Bitra Hemanth
Dec 12 '18 at 6:25
i have checked the blog but i could see it is an issue for ambari server, but i am using tomcat server and more over i have add to ports 1521,8080,8888 using this command : firewall-cmd --add-port=1521/tcp,8080/tcp,8888/tcp --permanent --zone=public and after adding ports to firewall i have done reload also
– Bitra Hemanth
Dec 12 '18 at 6:25
Hi all, Issue solved for me instead of adding localhost i have added ip address of oracle docker hence resolved. When i have configured localhost it is point to tomcat docker instead pointing to oracle docker.
– Bitra Hemanth
Dec 12 '18 at 7:30
Hi all, Issue solved for me instead of adding localhost i have added ip address of oracle docker hence resolved. When i have configured localhost it is point to tomcat docker instead pointing to oracle docker.
– Bitra Hemanth
Dec 12 '18 at 7:30
Happy to hear :)
– Senthil
Dec 12 '18 at 8:30
Happy to hear :)
– Senthil
Dec 12 '18 at 8:30
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53441816%2fgetting-exception-while-connecting-to-oracle-database-using-jsp-program%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown