How do I connect to Derby which is included with WebLogic? - java

I'm trying to add the Derby included with WebLogic as a data source. I'm running WebLogic 10.3.5. I didn't see a Derby flag in the setDomainEnv.cmd, so I added the client driver to the CLASSPATH:
set CLASSPATH=%PRE_CLASSPATH%;%WEBLOGIC_CLASSPATH%;%POST_CLASSPATH%;%WLP_POST_CLASSPATH%;%WL_HOME%\common\derby\lib\derbyclient.jar
in setDomainEnv.cmd. Now when I try to activate my data source in WebLogic I get:
An error occurred during activation of changes, please see the log for
details. Message icon - Error weblogic.application.ModuleException:
Message icon - Error java.net.ConnectException : Error connecting to
server localhost on port 1527 with message Connection refused:
connect.
What else do I need to do to get this to work?

I believe your local derby is not up yet. To check this, issue:
netstat -an | findstr 1527.
See if it returns anything. If nothing is returned, try to start the Derby Network Service manually. Go to <WLS_HOME>\common\derby\bin and click the startNetworkServer.cmd.
Double check with netstat again. If it's there, you can try to add to the datasource.
Note: this only covers manually start the Derby network service (not automatially start it upon weblogic start, which a bit tricky).

Either whatever is supposed to be running on that port isn't running or there is a firewall issue.

Related

RabbitMQ is running still getting connection refused Connect Exception

I have installed rabbit MQ 3.8.3 on windows 10 and I can see it is running as windows services.
When I try to access http://localhost:15672/ it is unreachable.
I have enabled the rabbit MQ management plugin in sbin directory
rabbitmq-plugins enable rabbitmq_management
But still, http://localhost:15672/ is unreachable.
Getting the following error in java service :
org.springframework.amqp.AmqpConnectException: java.net.ConnectException: Connection refused: connect
I have also run the command to see if anything is running on port 5672:
Command : netstat -ano | find "5672"
Response : TCP 0.0.0.0:25672 0.0.0.0:0 LISTENING 2900
How do I fix this?
The management UI can be accessed using a Web browser at http://{node-hostname}:15672/
The management plugin is included in the RabbitMQ distribution. Like any other plugin, it must be enabled before it can be used.
please refer below URL:
https://www.rabbitmq.com/management.html
Stop rabbitmq
Create the RABBITMQ_BASE environment variable set its value to full
path of rabbit mq server. (eg. C:\Program Files\RabbitMQ Server)
Restart the rabbit mq and make sure the rabbit mq plugin is enabled.

Java Mission Control: Flight Recorder throws: javax.naming.ServiceUnavailableException

I am trying to profile a Java Spring application with the Oracle Java Mission control.
I have the JVM Connection configured as: localhost:7091
and I started the application with java -Dcom.sun.management.jmxremote.rmi.port=7091 -jar app.jar.
When I attempt to start the flight recorder I get an error message.
Failed to retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:
java.net.ConnectException: Connection refused: connect]
Could not connect to a JVM at service:jmx:rmi:///jndi/rmi://localhost:7091/jmxrmi. Make sure one is running and that you are using the correct protocol in the Service URL.
Does anyone know what could be the reason for that error?
You could try to use auto discovery. Then the connection will show up automatically in JMC
-Dcom.sun.management.jmxremote.autodiscovery=true
You can also name the connection so you can identify it easily.
-Dcom.sun.management.jdp.name=App
and disable security
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
I had this issue. I had installed JDK 10 on Windows Server 2016. With JMC and the JVM I wished to monitor on the same server.
When going live, we switched the IP from a temporary IP to a live IP. However, JMC resolved localhost to the original IP. Also when specifying the server's current IP, JMC resolved it to the original IP.
Adding -Djava.rmi.server.hostname=localhost to the Java process I wanted to monitor, resolved the issue.
However, I will would still be interested to know why JMC (or RMI) still resolves incorrectly.

Access Hive Metadata using JDBC

I am trying to access Hive Metadata using JDBC. I have added all the jar files required in the classpath. I was following the tutorial from here- https://cwiki.apache.org/confluence/display/Hive/HiveClient#HiveClient-JDBC
After adding all the jar files I tried to wrote a sample program to connect to Hive using Java. When I debug the code, as soon as it hit the below line.
Connection con =
DriverManager.getConnection("jdbc:hive://lvsaishdc3in0001.lvs.host.com:10000/
default","", "");
I always get this exception. Not sure why is it happening. Can anyone help me how to fix this problem?
java.sql.SQLException: Could not establish connection to
lvsaishdc3in0001.lvs.host.com:10000/default: java.net.ConnectException: Connection
timed out: connect
I started my Hive sever by logging into Putty and passing the hostname.
$ bash
bash-3.00$ cd /usr/local/bin
bash-3.00$ hive --service hiveserver
Starting Hive Thrift Server
12/07/03 08:07:11 INFO service.HiveServer: Starting hive server on port 10000
Hive server is pretty unsecured by itself. It doesn't eve require username/password for authentication. From my experience, the most typical configuration is to start Hive server on the same box as the application, make sure that this box is connected to the Hadoop cluster and to secure this box. This way your connection string is jdbc:hive://localhost:10000 and the security becomes not your headache, but a headache of your networking folks.

Connection JDBC SQL Server Error

I've tryed to create a connection with a Microsoft SQl Server 2008 database through JDBC on Eclipse SDK. I've dowloaded JDBC driver from microsoft and I've installed it, then I've added at my System environment variables CLASSPATH the path of sqljdbc4.jar file. After icluding in the Eclipse project the jar file I've tryed to create the connection using:
String connectionUrl = "jdbc:sqlserver://localhost;integratedSecurity=true";
Connection con = DriverManager.getConnection(connectionUrl);
but it doesn't works, and launch me this exception:
com.microsoft.sqlserver.jdbc.SQLServerException: TCP/IP connection
at host localhost, port 1433 failed. Error: "Connection refused:
connect. Verify connection properties and make sure an instance of SQL
Server is running on the host and is accepting TCP/IP connections at
the port. Be sure no firewall blocks connections at the port.
I'm working on a JRE 1.6 so a sqljdbc4 should work, and I've created a working ODBC, so the server is responding, and the error should be in java command or JDBC installation.
Can anyone help me?
At the risk of stating the obvious, this looks to me as if TCP connections haven't been enabled on SQL Server. You have to manually enable them, they don't come enabled by default.
There's an article on MSDN here which explains how to enable TCP protocols for SQL 2005/2008.
Following are the quick trouble shooters:
Try to connect to your server using external front end.
Check if your firewall blocks the connection to the port
Check to see if server is really up.
A Suggestion :
If you are using eclipse , you don't need to add the jar into CLASSPATH variable , you can just add it in library of your project to make it available at runtime

UnknkownHostException

Please help;
Am trying to deploy a web application.
The build is returning successful,and am not getting any errors on the sever.log
however am getting a http 503 error:the requested service() is not currently available
and also my
Java DB Database Process has this message
Warning: UnknkownHostException: intracare: intracare.
Could not listen on port 1527 on host localhost.
am using glassfish v3 prelude
Possibly you already have another application (perhaps another JavaDB instance?) listening on port 1527 - that could explain the "could not listen" message. Use netstat to check.
I think that UnknownHostException is related that intracare can't be resolved to an IP.
I would:
Ping that host.
Check C:\WINDOWS\system32\drivers\etc\hosts or /etc/hosts files.
Regards.
Check the DNS settings on the host. Your short names do not resolve correctly.
Mayby string you are typing as a host name is wrong? Maybe it is firewall problem?

Categories