Can't get basic Apache Axis webservice to work - java

My example works when run on my PC but not on a remote server.
I'm following the Apache Axis "User's Guide", which can be found on the axis.apache website. I'm trying to get the example "Basics - Getting Started" working using a web service hosted on a server I control.
My client side code is exaclty the same as the example in the document.
My server side code is this :
public class Test {
public String echo(String s){
return s;
}
}
That code is in the File "apache-tomcat-7.0.81/webapps/axis/Test.jws". The "axis" directory is a copy of the one found in the axis download under webapps.
This actually does work when I run in on the Tomcat instance on my windows PC. I get the expected output when I run the client code:
Sent 'Hello!', got 'Hello!'
My problem happens when I try this on a remote server running centos7. I use the same code and the same axis webapp, but get this error in catalina.out:
- Exception:
java.io.FileNotFoundException: /usr/share/tomcat/webapps/axis/WEB-INF/jwsClasses/Test.java (No such file or directory)
On my local machine the file was created automatically, but on the Centos7 machine no file or directory is created. Any ideas what is going on here?

The problem was that the tomcat user didn't have permission to create the jwsClasses/Test.java file.
Fixed with:
chown -R tomcat:tomcat /usr/share/tomcat/webapps/axis

Related

HTTP Status 500 Internal Server Error when I deloy web application on docker ec2

When i try to deloy my web application using .war file on docker ubuntu aws ec2. I create container and assign the port to it. When I run it, I get the error 500 HTTP Status 500 - Internal Server Error. But when I execute it on eclipse, it works fine. The .war file I exported from the project followed this git hub link: https://github.com/vophucson/project-cloud
Please give me some advice

File not found exception :access is denied running on apache tomcat 7.0

I run a Java Application by using Apache Tomcat 7.0. I want to write files to another ftp server. The ftp file path is saving in a text file (//192.168.100.3/ftp/Testing).
When I start tomcat from bin>>tomcat.exe, the file is really written to the Ftp server.
When I start tomcat from services.msc, the following error occurs: File not found exception : access is denied
Execute services.msc as an administrator.
I assume one of the invoked files is in a subdirectory of Program Files and thus needs special permissions to be run.

Connect Eclipse to Websphere Liberty in another computer

I had installed Websphere Liberty Runtime in a Windows 7 machine following the instructions here :
https://developer.ibm.com/wasdev/downloads/liberty-profile-using-non-eclipse-environments/
I had installed and configured the admin-center feature following these instructions :
http://www-01.ibm.com/support/knowledgecenter/SSD28V_8.5.5/com.ibm.websphere.wlp.core.doc/ae/twlp_ui_setup.html
I set two users : admin and nonadmin
I am able to connect to this server from Eclipse in another computer.
However, each time i try to deploy an application on this server, i get this error in the computer with Eclipse :
Publish HelloWorldApplication
OK
Failed to transfer application HelloWorldApplication
CWWKX0121E: Access denied to path C:/wlp/usr/servers/servername/apps/HelloWorldApplication.war.
Failed to synchronize server configuration.
CWWKX0121E: Access denied to path C:/wlp/usr/servers/servername/server.xml.
Deployment of application HelloWorldApplication failed.
And, in the server i got this :
[ERROR ] CWWKX7901E: The C:/wlp/usr/servers/servername/apps/HelloWorldApplication.war file system path is not valid.
Can anyone help me, please ?
We are more than one developer needing to work on this server.
Thanks in advance.
SJRM
How do you have your server.xml configured? Given the error you mention, I think it's missing the configuration for writing into the remote directories, which looks something like this:
<remoteFileAccess>
<writeDir>${writePath}</writeDir>
</remoteFileAccess>
You can define several write directories and each one can refer to variables or absolute paths, for example:
<remoteFileAccess>
<writeDir>${wlp.user.dir}</writeDir>
</remoteFileAccess>
You can obtain the basic configuration for remote administration by executing this command on you Liberty profile bin directory:
configUtility install remoteAdministration
For reference see:
http://www-01.ibm.com/support/knowledgecenter/SSEQTP_8.5.5/com.ibm.websphere.wlp.doc/ae/t_creating_remote_server.html?cp=SSEQTP_8.5.5%2F1-3-11-0-2-3 for setting up a remote server,
http://www-01.ibm.com/support/knowledgecenter/SSEQTP_8.5.5/com.ibm.websphere.wlp.doc/ae/rwlp_command_configutil.html%23rwlp_command_configutil?cp=SSEQTP_8.5.5%2F1-3-11-0-3-2-1-1&lang=en for reading about the configUtility and
http://www-01.ibm.com/support/knowledgecenter/SSEQTP_8.5.5/com.ibm.websphere.wlp.doc/ae/rwlp_dirs.html?cp=SSEQTP_8.5.5%2F1-3-11-0-2-0&lang=en for a list of Liberty profile properties and their corresponding directories.

PHP - Error installing JavaBridge.war

I'm trying to install JavaBridge as I want to make connections between my php files and Java files.
I need my php request a GET method to Java file, and Java file will get the ID and run some script and return with an ARRAY.
I tried to install JavaBridge, but I get errors while trying to excess to localhost:8080/JavaBridge
javax.servlet.ServletException: php.java.bridge.http.FCGIConnectException: Could not connect to server
php.java.bridge.http.FCGIConnectException: Could not connect to server
java.io.IOException: File \\.\pipe\C:\apache-tomcat-7.0.39\temp\JavaBridge939398813756155712.socket not writable
java.io.IOException: PHP not found. Please install php-cgi. PHP test command was: [php-cgi, -v]
I didn't show out all the errors here, I showed only the first line of each root cause.
I will give more details in my setup.
I'm using XAMPP all the time, with PHP, MySQL in the XAMPP.
Then I just installed Tomcat inorder to install JavaBridge.
I copied JavaBridge.war into c:/tomcats/webapps, copied JavaBridge.jar and php-servlet.jar into c:/tomcats/lib
I assume the problems should lies with the PHP, but I don't know how to fix it as well.
Install PHP again? but I'm not sure too.
Whats the problem with my setup?
Or is there others way to make connections between PHP and Java as what I stated above?
Thank you.
Have you enabled php-cgi?
Here's how u can do it. Go to: xampp\apache\conf\extra\httpd-xampp.conf and uncomment this:
<FilesMatch "\.php$">
SetHandler application/x-httpd-php-cgi
</FilesMatch>
<IfModule actions_module>
Action application/x-httpd-php-cgi "/php-cgi/php-cgi.exe"
</IfModule>
Restart Apache & Tomcat.

FileNotFoundException while running SolrCloud on Tomcat

I have a Solr 4.2.0 server which is running under the Tomcat 7.0 container. I'm trying to wire it with my external zookeeper (actually, it doesn't work with the embdedded zookeeper too).
I tried this java opts:
-Dbootstrap_confdir=./solr/collection1/conf
-Dcollection.configName=myconf
-DzkRun
-DnumShards=2
for running the embedded zookeeper.
And also this java opts:
-Dbootstrap_confdir=./solr/collection1/conf
-Dcollection.configName=myconf
-DzkHost=localhost:2181
-DnumShards=2
For connecting to external zookeeper
In both cases I continue to get the same exception:
java.io.FileNotFoundException: File '.\solr\collection1\conf \admin-extra.html' does not exist
But the problem is that file admin-extra.html exists and it's right here. And I can't figure out what the problem is.
From your exception it seems your path has a white space after the config directory.
Try to define your bootstrap_configdir between "", like:
-Dbootstrap_confdir="./solr/collection1/conf"

Categories

Resources