Servlet JNDI connection timing out - eclipse

Our Java Servlet was developed on Eclipse Helios for Windows and runs on Tomcat 7. Recently a SQL Server database that it connects to using JNDI was migrated to a new server. I checked I could set up the connection to the new SQL server database using Eclipse and this was successful. I also checked I could connect using the connection details using SQL Server Management Studio. However when I amend the JNDI connection using the new connection details and run the relevant web service request in SoapUI I am being returned the message;
java.net.SocketTimeoutException: Read timed out
I have also imported the new SSL certificates created on the new server but that did not resolve the problem. I have tried extending the timeout but I don't think that is working. What is causing this new connection to fail when the original worked fine?

Related

Error creating an Application Server connection in JDeveloper

Background
I am using the Oracle JDeveloper Studio with SOA installed as my IDE. In JDeveloper I want to create a connection to a remote Weblogic server.
The remote server is running on my local machine, and I refer to it as remote to distinguish it from the Integrated Weblogic Server that comes with JDeveloper.
After reading this answer I attempted to add the following lines to the Windows 10 host file:
#
127.0.0.10 localhost2
::1 localhost2
These two pictures show the Application Server setup in JDeveloper: Picture 1, Picture 2
However I still receive the following error:
Server excetion is :
Connection refused from server
When create new server on random port such as 7013 and 7014 for ssl, test connection return:
Testing HTTP Authentication ... failed
Connection refused: connect
Testing JSR-160 Runtime ... failed
Cannot establish connection.
Testing JSR-160 DomainRuntime ... skipped
Testing JSR-88 ... skipped
Testing JSR-88-LOCAL ... skipped
Testing Server MBeans Model ... skipped
Testing App Controller ... skipped
Testing JSR-88-DEP-MGR ... skipped
Testing JSR-88-DEP-MGR-LOCAL ... skipped
Testing JNDI ... skipped
Testing JSR-160 Edit ... skipped
Testing HTTP ... failed
Connection refused: connect
0 of 12 tests successful.
Can anyone suggest some troubleshooting steps here?
Clarification
I need to clarify a few points to guide you to the correct answer.
Are you sure this is a separate Weblogic server running on localhost, not the Integrated Weblogic Server?
Are you sure the Integrated Weblogic server is not running?
Are you sure the Weblogic server you are attempting to connect to is running?
Troubleshooting
General Recommendations
Always run JDeveloper as Administrator
Located an utilize the *-diagnostic.log file and the standard out file
Utilize the JPS utility to see if the WLS process is running
Utilize the EM console to see what interface your server is listening on
Integrated Weblogic or Standalone Weblogic
Firstly, because you are new to Oracle SOA I need you to clarify if you have a Weblogic server installed locally separate from your Oracle BPM Studio ( JDeveloper ) IDE.
When creating a local SOA environment, JDeveloper comes with an Integrated Weblogic Server pre-installed. You don't need to install the Weblogic server separately.
To determine if you have a standalone Weblogic server installed on your local machine you could do a few things.
Do a search for startWebLogic.cmd. If that file is somewhere other than beneath %APPDATA% you likely have a standalone server
Secondly, with 11g ( maybe 12c ) you can check Add or Remove Programs to see if the installation is listed
You could also check to see if it's running by running a jps command in command prompt. This shows all Java processes currently running, and your Weblogic server runs as as a Java process. It will look something like the following
If you see a suspicious process you can run a jinfo <pid> to get more information about the process
You can also check Windows Services to see if you have a Weblogic service.
Most likely you don't even have a local Weblogic installed separate from JDeveloper's Integrated Server. In that case, please read the following section.
Integrated Weblogic Server
As stated before when you download Oracle BPM Studio ( JDeveloper with all the SOA plugins ) it comes with an Integrated server.
You first need to create a default domain and connection to this server.
First, open the Application Server panel.
You should now see the Application Server panel to the left side of your IDE
Remember, generally you are not installing the server here, you are just connecting to a server that is already installed from your IDE. The purpose being that you can deploy composites directly to the server from JDeveloper. Configuring the Integrated Server is a bit different, but the difference doesn't need to be explained here.
Right click on "Application Servers" and click New Application Server. This will display the following popup
Now walk through the steps of creating the default domain and server connection
Then test and finish. You should not have an integrated weblogic server running. To start the server you simply run -> Start Integrated Weblogic Server
If you Windows -> log you can see the server stdout and stderr rolling.
On windows you can also find these logs on Windows 10 by navigating to %APPDATA%\Roaming\JDeveloper\system12.2.1.3.42.170820.0914\DefaultDomain\servers\DefaultServer\logs in your system's file explorer.
Standalone Server
If for whatever reason you aren't using the Integrated Weblogic Server and instead have a standalone installation of Weblogic on your local machine you would first need to find where your Middleware Home directory is.
The environment variable is MW_HOME or ORACLE_HOME
Navigate to that directory and run startWeblogic.cmd. Then tail the out file to see if if it starts successful. From there, the process of creating a connection to the server in JDeveloper is no different than the steps listed above, except that you want to select "standalone" not "integrated".
Final Thoughts
If you want to create the Integrated Server and have already failed several times I would try the following
Stop the Integrated Server (if its running) and delete the default domain
Starting the server again (see above) will recreate the domain.
If that doesn't work delete the entire server connection and recreate. You may also want to delete the DefaultDomain folder in your %APPDATA%\JDeveloper folder

how to make clm application to connect DB on tcps port

we are using clm 6.0.3 with liberty profile and oracle db 12c for our applications.
Java.runtime= Java™ SE Runtime Environment (pxa6470_27sr3fp40-201604220_01 (SR3 FP40))
our IBM clm applications are hosted on Websphere Liberty Server 8.5.5.9 (wlp-1.0.12.cl50920160227-1523)
java version - 1.7.0_75
ojdbc driver-ojdbc7.jar
Implementation setup
We want to enable mutual ssl authentication with DB server to application.
Steps followed.
We are using the default keystore of liberty profile , where we imported the DB certificate and also extracted the applicationcertificate and imported the same oracle DB wallet.
we are using default server.xml file and startup file and java.security files. For making this tcps communication, where exactly we need to make changes
Issue detrails
we are able to connect the db through tcp string. But not able to connect by tcps string.
tcp string – thin:jts-user/{password}#//192.168.100.216:1521/vmtestdb
tcps String - thin:jts_user/{password}#(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=192.168.100.216)(PORT=2484))(CONNECT_DATA=(SERVICE_NAME=vmtestdb)))
Error Code:-
Caused by: oracle.net.ns.NetException: The Network Adapter could not establish the connection
Caused by: oracle.net.ns.NetException: The ssl protocol specified is not supported.
Caused by: java.lang.IllegalArgumentException: SSLv2Hello is not a recognized protocol.
For reproducing the issue, we will get the same error when we put tcps string to connect the db.

IBM BPM unable to detect WODM server?

Following the tutorial on
http://bpmwiki.blueworkslive.com/display/samples/Decision+Service+demonstrating+BPM+and+WODM+integration#DecisionServicedemonstratingBPMandWODMintegration-PartI%26nbsp%3B%5C%26nbsp%3BImplementingtheJRulesSolution
I'm able to run the rule app using soapUI and everything works fine. Now, when I try to implement the rule service on BPM, it seems BPM is unable to detect the WODM server.
When I test this using soapUI, the wsdl URL was something like: http://localhost:9081/xxxxxxxx.
Now, when I try to implement this on BPM, I've set the Server location to http://localhost:9081 and SOAP Port to 8881 as shown below:
However, I've failed to login. I'm wondering what SOAP Port actually is and why BPM needs one and soapUI doesn't?
Update:
When I set the SOAP Port to 8881, it's throwing
java.io.IOException: Mismatched serialization UIDs :
Source(RepId RMI:java.lang.Throwable:F...............) =........ whereas Target (RepId RMI:com.ibm.jsse2.util.h:CAAC186..................) = D9CE.........
When I set the SOAP Port to 8880, it's not throwing any errors but there's no ruleset and ruleapp available
When I set the SOAP Port to 8882 and above, it's throwing me
[SOAPException: faultCode=SOAP-ENV; msg=Error opening socket:
java.net.ConnectException: Connection refused: connect; targetException: Connection
refused: connect; targetException=java.lang.IllegalArgumentException: Error opening socket:
java.net.ConnectException: Connection refused: connect]
Has your WAS been installed using the default ports or custom ports?
I have got this working using BPM 8.5 and ODM 8.5, but the default SOAP port is 8880 (although I have noticed that you are using port 9081, which implies you might have more than one WAS server installed so its bumped all the port numbers up by one, so this might not be the problem).
The other thing to check is how you have set up the BPM server in the Process App Settings in BPM. The format of the server location should be http://:
BPM need the SOAP port of WODM server to explore what rule app / rule set are available, so that BPM could present a list for you to choose from.
When you call a ruleset in soapUI like following, you have already specified which rule app / rule set to call in the URL.
https://HOST:PORT/DecisionService/ws/ruleapp/ruleset
You may go to WAS admin console to check what's the SOAP port of the server that running WODM.

Entity Framework "The underlying provider failed on Open" - Cassini vs IIS

I have a service that uses EF to retrieve data from a SQL database.
The EF model is in a class library. In the class library the connection is configured as:
<add name="APIC2CEntities"
connectionString="metadata=res://*/MyModel.csdl|res://*/MyModel.ssdl|res://*/MyModel.msl;provider=System.Data.SqlClient;provider connection string="data source=MYSERVER;initial catalog=MYDB;user id=MYUSER;password=THEPASSWORD;multipleactiveresultsets=True;App=EntityFramework""
providerName="System.Data.EntityClient" />
This class library is referenced by a WCF service project. In webconfig I control the EF connection with:
<add name="APIC2CEntities"
connectionString="metadata=res://*/MyModel.csdl|res://*/MyModel.ssdl|res://*/MyModel.msl;provider=System.Data.SqlClient;provider connection string="data source=MYSERVER;initial catalog=MYDB;user id=MYUSER;password=THEPASSWORD;multipleactiveresultsets=True;App=EntityFramework""
providerName="System.Data.EntityClient" />
When my service is running in Cassini the data is retrieved correctly. When the service is running under IIS (Windows XP) the connection fails with the following exception:
The underlying provider failed on Open
with an inner exception telling me:
{"A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)"}
I understand that Cassini is running under my logged in account, and that IIS is running under the IUSR_MYMACHINE account, but my connection is not trusted, so this shouldn't matter...
How else might an EF connection be manipulated or controlled differently between IIS and Cassini?
Thanks,
Mark
Our resolution on this occasion was to force the connection to use tcp (using data source=tcp:MyServer in the connection string) and enabling TCP on the SQL box (oops!)..
I still have no idea how the Cassini session was able to establish connection where the IIS session was not :-S
Mark
I think the issue is still in connection string. If you are sure please do the following steps and test
Open blank notepad and save as connectionString.UDL
Open connectionString (just saved in step 1)
Under the connection tab: type server name (in my case: DESKTOP-IDSLV81) or IP as XXX.XXX.XXX.XXX,1433 where 1433 is default port the use respective username and password and the select Database(available DB is in Dropdown list)
Then press test connection if succeeded the press Ok button.
Open the connectionString.UDL file in notepad. The correct connection string is there and compare with your connection string in web.config
This solution is for someone facing this issue while deploying windows application,
I know this is late, but this maybe useful for someone in future, In my scenario, purely this is a connection string issue I developed a windows application using entity framework (DB First approach) and I published it, the code was worked fine on my machine, but it's not worked on the client machine
Reason for this issue:-
I updated the client machine connection string in App.config file, but this is wrong, if that is a windows application, then it will not read the connection string from App.config (For deployed machines), it will read from .exe.config file,
So after deployment, we need to change the connection string in "AppicationName".exe.config file

Problems with SOAPUI, SpringWS, and Tomcat5.5

Ive been trying to get an example Web Service working using SpringWS and Tomcat5.5
Ive followed examples such as:
1)http://justcompiled.blogspot.com/2010/09/building-...eb-service-with-spring-ws.html
2)http://jamesbnuzzo.wordpress.com/2009/04/14/spring...s-with-jaxb-maven-amp-eclipse/
The latter has an ZIP file which includes the WAR to drop into Tomcat
In both examples the Web Service runs and I can view the WSDL file (eg:http://localhost:8080/eightball/eightball.wsdl)
However, when I startup SOAPUI version 3.6.1, import the WSDL, set the endpoint for example to http://localhost:8080/eightball/eightball, and then try to submit a request to that endpoint, I get the following error.
Fri Nov 05 19:49:05 GMT 2010:INFO:Error getting response for [eightballSoap11.eightBall:Request 1]; java.net.ConnectException: Connection refused: connect
With the 1st example I used Eclipse Helios to develop and publish the WebService to Tomcat. Using SOAPUI in this scenario worked and I got the expected Responses back.
When I exported the same project to a WAR file and deployed on Tomcat, I got the SOAPUI connection exception ?!?!
Can anybody please help....
Which SOAP-Version does the Tomcat/SpringWS use, there might be a discrepancy between SOAP 1.0 and 1.2
I resolved this problem by adding in address="0.0.0.0" to the Connector element in server.xml.
The problem identified also meant that Tomcat could not be reached on address 127.0.0.1:8080 and only by localhost:8080
I think its all down to how Windows was listening on the loopback address for IPv4 and IPv6.