I have installed a ftp server locally. I have a web service running on my web server too. My client class send a byte stream to web service which needs to be uploaded in to a file server. Both web server and file server running locally. When I'm trying to connect to the file server an exception is thrown. It looks the exception is thrown while trying to connect.
FTPClient client = new FTPClient()
client.connect("ftp.127.0.0.1");
client.login("username", "password");
I'm using Apache commons net library for FTPClient. I want to know whether this is acceptable to access the local file server from local web server. If so, Is there anything wrong on my code to get connection ?
Exception I get is added below
java.net.UnknownHostException: ftp.127.0.0.1
If you think there is something wrong with your code, not with instance of your FTP Server, then I would recommend to write a test when you would mock FTP server:
Here you'll find a way to mock it:
http://mockftpserver.sourceforge.net/fakeftpserver-versus-stubftpserver.html
Instead of ftp.127.0.0.1
use 127.0.0.1.
Related
I run my Solr engine on Ubuntu 14.04 in VirtualBox. The guest operating system is connect to local network. It has this IP address: 192.168.10.102.
I'm trying to connect with Solr engine using my browser. I'm going to http://192.168.10.102:8983/solr/ and everything is works.
I wrote an application in Java (with SolrJ). I try to connect to the Solr engine and delete everything. The code looks like this:
server = new HttpSolrServer("http://192.168.10.102:8983/solr/");
server.deleteByQuery("*:*");
server.commit();
Sadly I get an exception:
[main] INFO org.apache.solr.client.solrj.impl.HttpClientUtil -
Creating new http client,
config:maxConnections=128&maxConnectionsPerHost=32&followRedirects=false
Exception in thread "main" org.apache.solr.common.SolrException:
Server at http://192.168.10.102:8983/solr returned non ok status:404,
message:Not Found at
org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:372)
at
org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:181)
at
org.apache.solr.client.solrj.request.AbstractUpdateRequest.process(AbstractUpdateRequest.java:117)
at
org.apache.solr.client.solrj.SolrServer.deleteByQuery(SolrServer.java:285)
at
org.apache.solr.client.solrj.SolrServer.deleteByQuery(SolrServer.java:271)
...
Everything is good when I comment deleteByQuery() and commit() functions.
How can I solve it?
You have to create any collection your url should look like http://192.168.10.102:8983/solr/collection1 and then you can try do something
Using apache commons httpClient PutMethod to upload a doc to sharepoint 2010 as it was a large it is taking time and after sometime i am throwing by an exception.
Socket Error: Connection Reset by peer : socket write error
as peer means share-point is closing socket or socket just failing to write where is the error, can fix for this issue from java side.
Update:
After troubleshooting the class its working has standalone java class, but it is failing when it is running in Tomcat server. I think some configuration of tomcat server will fix this issue.
My understanding the tomcat server is a web server deals with http protocol and my java class is implementation of apache HttpClient 3.1 so this java class is works as individual class and failing in tomcat server means tomcat is overriding my httpclient params which is causing this issue
You will find below link use full in your case.I resolved same issue by reading below details.
http://jce.iaik.tugraz.at/sic/Products/Communication-Messaging-Security/iSaSiLk/documentation/Secure-Renegotiation
I have deployed a sample webservice application to remote weblogic server (12C) which has a datasource that accesses a remote database server.
The deployment was successful.
The data source was tested OK from within the Weblogic Server.
But when I am trying to test the webservice (which uses this datasource) I am getting the following error
inside weblogic
When I am testing the same webservice from standalone url (webservice test client - see image) I am getting the following error for the same method. The User name and passowrd for base authentication is correct. Though I am not very sure what/why the base authentication is required, since the data-source has it all. Please advise how to test a webservice that is acessing a remote database through a data source. Link to an example using remote weblogic server and remote database server will also be a great help.
! [In webservice test client]
We have a web service that is running on a web server. A web app (currently running on localhost) tries to access it. I can call the location in my browser and it will show me the WSDL so the web service is working. Also if I run the web app against the same service running on my localhost, it will work.
But if I try to connect to the remote web service it will give me a
java.net.MalformedURLException: no protocol: <URL here>
which will be wrapped by the wsdl2java generated Service class into
Can not initialize the default wsdl from <web service location here>
Yes, the URL is really working. It is there and running...
What could cause this? Do I need to set permissions or open a port on the remote web service server? (We're using CXF for the web service)
Thanks!
Thanks to Thihara I found the problem:
When accessing my local wsdl service I used
"http://localhost/pathToWsdl"
But when trying to access the remote wsdl I used
"ip.add.res.s/pathToWsdl"
So obviously there was no protocol in the latter and thus the exception.
I am trying to send a mail with gwt and java on the server with the buitin jetty on eclipse but I am getting the following error:
Cannot open and load mail server properties file.
Cannot send email. javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25;
nested exception is:
java.net.ConnectException: Connection refused: connect
does someone know what to configure to make it work??
This is not GWT related problem. Test you email sending code in isolation (without GWT and Jetty).
Start with sample code and configure it's parameters to your need. You will also need to use a SMTP server to send emails this way.