Occasionally Getting java.lang.NoClassDefFoundError - java

I have a very unusual error condition that I can't seem to find the solution to. I'm hoping someone out here in StackOverflowland can help. Before you just look at the title and say "your CLASSPATH is wrong," read on!
I work with a server-based Java application that utilizes a number of third-party libraries. The particular library that I'm getting the error with is a file transfer library. Part of the functionality of the application allows the user to connect to remote servers (FTP, SFTP and FTPS) and send/receive files.
One of our customers is using the application and occasionally gets a "Class Not Found Exception" (or more specifically, "No Class Definition Found") when attempting to connect to a remote host. What's weird is that they don't get it all the time. They have sent me logs that show a successful connection and then another one which shows this error. There was no restart of the server between the two and both connections are to the same host using the same connection settings.
What would cause a "Class Not Found Exception" to occur occasionally within a Java application on a class that has already been successfully used? I've contacted the third-party vendor and they are just as puzzled.
I wasn't able to determine anything from the stack trace, but since it was requested, here it is:
java.lang.NoClassDefFoundError: com.enterprisedt.net.j2ssh.configuration.ConfigurationLoader (initialization failure)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:139)
at com.enterprisedt.net.j2ssh.SshThread.a(SshThread.java:93)
at com.enterprisedt.net.j2ssh.SshThread.<init>(SshThread.java:73)
at com.enterprisedt.net.j2ssh.transport.TransportProtocolCommon.startTransportProtocol(TransportProtocolCommon.java:515)
at com.enterprisedt.net.j2ssh.SshClient.connect(SshClient.java:593)
at com.enterprisedt.net.ftp.ssh.SCPClient.connectSSH(SCPClient.java:1137)
at com.enterprisedt.net.ftp.ssh.SSHFTPClient.connect(SSHFTPClient.java:920)
at com.enterprisedt.net.ftp.async.internal.ConnectTask.connect(ConnectTask.java:154)
at com.enterprisedt.net.ftp.async.internal.ConnectTask.run(ConnectTask.java:216)
at com.enterprisedt.net.ftp.async.internal.FTPTaskProcessor$b.run(FTPTaskProcessor.java:590)

Related

"No subject alternative names present" error when connecting to private ip over https

I have a java application running as an Azure App Service. We would like this app to be able to connect to an apache server running on a vm which is in the same vnet that the java application is integrated with. The app can communicate fine with this apache server over its public domain. However when changing to the private ip (e.g https:///path) I get the following error:
[INFO] org.springframework.web.client.ResourceAccessException: I/O error on POST request for "https://<my private ip>/path": No subject alternative names present; nested exception is javax.net.ssl.SSLHandshakeException: No subject alternative names present
I've looked at this myself and I know this issue is due to Java not allowing it to connect because it's not using the domain listed in the ssl certificate.
Any suggestions on how to work around this without changing the certificate or making any changes to the java code? (For work reasons I am unable to modify the code of the java app itself)
I've tried adding the property -Dcom.sun.jndi.ldap.object.disableEndpointIdentification=true as suggested here to the startup command for the java application as seen below:
-Dcom.sun.jndi.ldap.object.disableEndpointIdentification=true
The error is still occurring. A colleague has also suggested using the hosts file but I don't think this is possible for Azure web apps.
Hope this is clear. Thanks

SFTP connect error - The message store has reached EOF

I am getting exception "The message store has reached EOF" when I try to connect to remote host for SFTP using "com.enterprisedt.net.ftp.ssh.SSHFTPClient" class (edtFTPj/PRO - a commercial Java file transfer client).
I am able to successfully connect to another remote host for SFTP with the same code.
Is there any configuration specific to the particular host which is causing the problem? If that is the case, is there any way to confirm it? I don't have any other log other than this exception message. However, I can change the code to try any suggested debugging options.
Please note that I can't use other SFTP library as my existing code is already using this library.
com.enterprisedt.net.j2ssh.authentication.AuthenticationProtocolException: Failed to read messages
at com.enterprisedt.net.j2ssh.authentication.AuthenticationProtocolClient.a(AuthenticationProtocolClient.java:265)
Caused by: com.enterprisedt.net.j2ssh.transport.MessageStoreEOFException: The message store has reached EOF
at com.enterprisedt.net.j2ssh.transport.SshMessageStore.getMessage(SshMessageStore.java:177)
at com.enterprisedt.net.j2ssh.transport.SshMessageStore.getMessage(SshMessageStore.java:110)
at com.enterprisedt.net.j2ssh.authentication.AuthenticationProtocolClient.a(AuthenticationProtocolClient.java:261)
... 31 more
I think there is a problem with the library itself. A concurrency problem. I could reproduce this and other random errors consistently when you try to open many connections at the same time (in the same millisecond), for example, when you use multiple threads to do that. This happens even if you use several different SSHFTPClient instances. I think there should be a static thing inside those classes.
I had to synchronize the access of any SSHFTPClient instances using a third variable, like this:
final static String sincronizadorUnico = "";
synchronized (sincronizadorUnico) {
// use the code to connect
}
The it will work. I will report the bug to the library. I'm using 7.1.0 version of library.

java webserver is not receiving requests from internet, Not Found error

I have restarted a project that i closed after it became too comfusing, the original project was a webserver run entirely from java code. I have started this back up in the hopes of making the code 100% my own using java. I have gotten to the testing stage of hosting website however whenever i try to connect from the outside world i am shutdown with an error page. I have note coded this error page and after extensive research it is viewable that the error page is originating from apache. The only problem with this is that there is no apache in the code or in the virtualbox server. I have also tested this on two different virtual servers: opensuse 13.1 and fedora 20.
The URL of the server is blends.hopto.org/beta. There should be a black background there with some arrows and a blue dot, but instead there is an error that states:
"Not Found
The requested URL /beta was not found on this server.
Additionally, a 404 Not Found error was encounted while trying to use an ErrorDocument to handle the request."
I do not get this error if i request the page from inside my local network. But i do from outside, it is not a port forwarding problem because my minecraft server works and the server is assigned to the public ip of my home router!
Thanks, any help is appreciated!
Extra info:
After positing this question i stumbled across some other problems and it seems that the error is originating from SELinux, however i have disabled SELinux and the error is still coming through!
This is not an answer. I cannot comment on StackOverflow yet but would like to help.
You said that you get an Apache error page, which means that Apache must be running on your system. You can check this by typing this in the terminal:
apachectl status
You don’t mention what port you want to serve on. Apache usually uses port 80. You could configure your homemade Java server to work on a different port, say 8080. Also, if you are using Fedora 20, then you will have to configure FirewallD to allow this.
Okay well i finally found out what the problem was after just looking over the assigned ips to devices and found it strange that our networked hard drive was assigned the very first ip always. So i logged into the hard drive and found out it had been capturing all the port 80 requests from the router in an attempt to do remote login!!! I am very excited that this problem is resolved! I will be hoping to release my WebServer API for everyone to use as it is incredibly small and gives the programmer full controll

Any reason why I would not be permitted to confirm a message using Tibco Rendezvous?

I have a setup in which some applications communicate with each other via Tibco rendezvous. The applications communicate using certified messaging. My problem is that two of my receivers have recently started exhibiting the behavior that they will get an Error 27, Not Permitted when they want to confirm a message (the first message in a certified message exchange isn't certified, we've accounted for that).
I've been looking around the internet to find people with the same error, and I have found many, but they all get the error when trying to create the tibco transport. I can create the transport just fine, but I can't confirm any messages received over it.
Our environment uses both tibco 7.X and 8.X, some times intermingled. This problem appears both when the peers use the same tibco version and when they use different versions. It doesn't show up for all applications, but when it does show up for an application, it remains "broken". Discarding the ledger files for both sender and receiver does nothing. We still get the error. Both sender and receiver have proper permissions to write to (and create the) ledger files. We are connecting to permanently running rvds. The sender and receiver are on different machines. Communication has worked flawlessly in the past, but at some point, it stopped doing so. The application is in java, and we're using the tibrvj.jar auto-native libraries.
The error is
...
Caused by: TibrvException[error=27,message=Not permitted]
at com.tibco.tibrv.TibrvImplCmTPortC.natConfirmMsg(Native Method)
at com.tibco.tibrv.TibrvImplCmTPortC.confirmMsg(TibrvImplCmTPortC.java:304)
at com.tibco.tibrv.TibrvCmListener.confirmMsg(TibrvCmListener.java:88)
....
I know you're going to ask me "what did you do to make it start happening", and my response is "I don't know".
Any input would be appreciated.
Thanks.
It may be possible that TCP connections between the two RVD servers is not possible. Can you check if you can connect from one to the other (connect from the subscriber host back to the publisher)? In my experience, CM acknowledgments are handled over TCP (please take this with a grain of salt as I'm more an end user than a Middleware support guy).
As it turns out, it was a screw-up on the application level.
Due to some old code lying around, after having updated a dependency (our messaging layer), we had moved from an application level confirmation to a container level confirmation, but we had forgotten to remove an explicit message confirmation in the application code.
To summarize: We tried to confirm the message twice, and the second time it threw this exception.
I recently encountered the same exception - application had been working for months, suddenly was throwing exception. In my case some maintenance had been done on the Windows server the application ran on and directories had been marked read-only. Once that was cleared the exception went away.
Discovered this after trouble-shooting hours worth of other potential causes.
Just my two cents: This exception also occurs when you try to explicitly confirm message on non-CM transport.

JDBC: Oracle Application Server and "The Network Adapter could not establish the connection" error

I am getting the error: "The Network Adapter could not establish the connection" from a web application deployed in Oracle Application Server 10g. The database is local, so there shouldn't be any connection issues.
First test: I can connect to the DB no problem from SQL plus, run queries, etc.
Second test: I can connect to the database no problem from a locally installed JDeveloper on the server, and run queries, etc. no problem. This works with the short JDBC scring, and the long one (shown below).
jdbc:oracle:thin:#(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=abcd)(SERVER=DEDICATED)))
Yet when I run the web app, it gives the above error. It seems too generic for me to do anything about.
Any suggestions on how to solve this? I assume that Oracle logs failed connection attempts somewhere, but I couldn't find anything relevant in the databases alert.log file.
It is possible that the problem is that the application is using an old jsdk, but I would assume that then some version mismatch error would be given instead of a "network connection" message.
Edit: I don't know whether this is an OAS problem or a problem with the specific Web Application, I would like to figure this out first, as it seems it should be easy. In WebSphere, there is a "test connection" button to dest data-sources you have added, but it seems there is no such functionality in OAS10? Somehow I think there must be, and I am just missing it because I am not an OAS expert.
Edit 2: I installed JDevelop on a remote machine and connected to the database with no problems, so I know for sure it isn't an issue with the database connectivity itself - it seems like it must be a problem within OAS?
I faced similar problem(able to connect through client but not web application) with Oracle XE when running with default configuration. Increasing number of sessions and processes solved my problem. Check this http://www.markcallen.com/oracle/oracle-xe-tuning.
I assume that Oracle logs failed connection attempts somewhere
It would show up in listener.log, but with the error you get, it seems doubtful that JDBC could even contact the listener.
jdbc:oracle:thin:#(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=abcd)(SERVER=DEDICATED)))
Is that the same string you use for the web app?
I've had issues with localhost and 127.0.0.1 which go away when using a more definitive host name or address [IE a name that other machines would know the host as.]. I think it was to do with how the name was resolved (eg locally or off to a name server or similar).
Not a java person, but is there any way to simply ping localhost/127.0.0.1 from the java and see whether there's a response.
One of the ways to fix the issueis to update Hosts file at WAS Server with entries for DB servers as shown below:
111.222.333.444 serverab.abc.com serverab

Categories