Running a Tika server from eclipse to be accessed from hosts other than localhost - eclipse

I have the following question: I have imported in eclipse the tika-server subdirectory of the tika-trunk main repository and managed to import it to eclipse and I am able to start the "Apache Tika 1.7-SNAPSHOT server" on the machine I run eclipse (localhost). My problem is that I can only access Tika from this machine (localhost).
I know how to solve this problem when I start the Tika server from my command line (see post Stopping a Tika server properly ), but I do not know how I can pass "-host 0.0.0.0" in order to instruct eclipse to do the same. I know that this might be solved through the "Run Configurations" eclipse menu but it is not intuitive to me how I can accomplish that. Thank you in advance !

First up, you need to open the Tika Server Cli class in eclipse. Then, do Run As followed by Run Configuration, as shown here:
Now, in the configuration for the Tika Server CLI, in the program arguments box, enter the arguments you want to give to Tika, eg --port 9876 as shown here
Finally, hit Run and the Tika Server will start with the alternate port you've givne

I think the only solution so far I found is to edit "TikaServerCli.java" and switch "public static final String DEFAULT_HOST" from "localhost" to "0.0.0.0". Then you can start the server in a way that can be accessed by everyone and not only by localhost.

Related

Debug Eclipse Wildfly from IntelliJ

I have a local application running in local Wildfly that is configured using eclipse. I also have IntelliJ running in local. Now I want to run the application in Eclipse and connect remote debugger to it from my IntelliJ which is also running in the same machine. How do I do that?
In eclipse, I can see that the checkbox of Attach remote debugger is ticked and the port is 8787.
I try remote configuration in IntelliJ with Host as localhost and Port as 8787, I get error Error running 'Eclipse': Unable to open debugger port (localhost:8787): java.net.ConnectException "Connection refused: connect"
Can some one help me with this?
Why I need this setup:
I have this application that is been setup on Eclipse since ages. As I am used to IntelliJ, I don't want to use eclipse. It will take some time for me to identify how to migrate it to intellij, so for now going with this work around.
Ah, never mind. I added -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8787 to launch configuration and it worked. I thought it appends these arguments automatically. But that is only when we use the bat file to start. Doesn't seem to be the way with eclipse.
PN: I am not deleting this post as there may be others who would have similar requirement.

maven was6:installApp TransferFailed

I'm trying to deploy my ear to a remote Websphere 8.5 with maven plugin was6 via SOAP.
I set up the correct ear with correct host, node,cell,server, port etc.
But when I try to install app I got WASX7017E: ConnectException - Connection refused with a TransferFailedException
In logs, there is nothing in local and remote neither. As I see with netstat when I run the mvn installApp there are many connection trying on serverside whiches have status TIME_WAIT.
The plugin seems to be working with v8.5 cause other functions for example wsListApp work.
I tried to google it but with no results.
Does anyone get this error before me? Or has anyone idea what should I do?
Thank you.
was6-maven-plugin generates a temporal ant file under "target\was6-maven-plugin\" folder and then calls $WAS_HOME\bin\ws_ant.sh/bat utility using -f option with the previously generated ant file.
If you don't use the clean target, the files should continue there so you can use ws_ant to find the real error and find if there is an error on your configuration or in the plugin.
If you find an error in the plugin, please open an issue here: http://jira.codehaus.org/browse/MWAS
In this link you'll find all the options available in the wsInstallApp target:
http://pic.dhe.ibm.com/infocenter/wasinfo/v8r5/index.jsp?topic=%2Fcom.ibm.websphere.javadoc.doc%2Fweb%2Fapidocs%2Fcom%2Fibm%2Fwebsphere%2Fant%2Ftasks%2FInstallApplication.html
Regards,
Javier Murciego

DFS locations in Eclipse Europa after accessing Hadoop in a VM

I am very new to hadoop. I need to install it and play around with samples.
SO i referred this tutorial . I have installed Sandbox given in that tutorial. I need to configure ECLIPSE in windows mentioning VM location as specified in the image below, which is given in the tutorial.
I have installed eclipse europa and hadoop plugin.
Then in Map/Reduce Locations i gave VM Ip for host name, Linux user name in UserName and 9001 in Map/Reduce port and 9000 in DFS port.
In Advanced Tab I have set value to the mapred.system.dir as /hadoop/mapred/system
and there is no hadoop.job.ugi to give username.
After i click ok, I couldn't get HDFS file system under my DFS locations in ECLIPSE.
Please help me on this
I also got the same problem. The problem here is not related to hadoop configuration but eclipse. To fix this, go to "\workspace\.metadata\.plugins\org.apache.hadoop.eclipse\locations". Here open the XML file and just add the property "hadoop.job.ugi" with value "hadoop-user,ABC" and then restart your eclipse. It worked for me.
I tried by giving just one value i.e. without ABC but it dint work and I dont know the significance of this comma separated value but since I have just started the tutorial I hope to get this answer soon :)
I too ran into the same issue. I installed RedHad cgywin (openssh and openssl packages) and updated the "Path" environment variable with a path to cgywin/bin (c:\rhcygwin\bin). Then my Eclipse DFS location was able to connect to Hadoop on the Virtual Machine. Once that was successful I saw the option "hadoop.job.ugi".
http://v-lad.org/Tutorials/Hadoop/00%20-%20Intro.html describes installing cgywin.
Note: I am running the Hadoop VM on Windows Vista.
I spawned Eclipse from within Cygwin and it worked fine for me (i.e. I could see the "hadoop.job.ugi" parameter). Also, I didn't make any changes to my PATH environment variable.

Eclipse: Glassfish and Tomcat don't work

I have reinstalled java JDK 6.0.25,(after some problems installing java, finally succeeded). I have set paths (JAVA_HOME points to C:\Program Files\Java\jdk1.6.0_25 and in Path also added C:\Program Files\Java\jdk1.6.0_25\bin).
In eclipse I have pointed everything to this new JDK, also in servers. When I have installed Glassfish 3.1, after installation the domain wasn't created. So when I add this server in Eclipse, the domain wasn't found.
So I did extract an ZIP version of Glassfish and in Eclipse configure the server to this ZIPPED Glassfish. Also I have installed tomcat 7.0.14 again and add to eclipse but both did not work.
Main problem: When I start Tomcat or Glassfish in Eclipse they don't start. Tomcat is starting but after 45 seconds it says, that the time is run out. I have read the forums to increase starting time, I have putted it to 240 sec, but it does not work, because it pop out error in which sazs, that the port is already used by a different server.
By Glassfish, when I start it, its starting, but after few minutes gives me error: Failed to start. It looks like some ports or something is blocking this servers. I have turned off firewall also and antivirus but nothing.
I have looked all the forum about "not starting Glassfish or Tomcat" but didn't found the solution. I don't want to reinstall windows for this.
So if anyone know anything about this problem, please HELP.
Update:
I've tried to change the ports in domain.xml and checked with netstat -b (everything was established), but the server (Glassfish) didn't start. It shows an error "Server GlassFish Server Open Source Edition 3 (Java EE 6) at localhost failed to start.". I've also tried install "built in Eclipse" Glassfish from marketspace and from "Install new software" from eclipse, but it comes out with the same error. Currently, for needs I'm using XP Mode in Windows 7, there servers work, without any problems.
It seems your installation odyssey messed up your system.
But you should get it working without reinstalling Windows. Maybe the fragment of an old server installation blocks the ports Glassfish and Tomcat need for operation.
Try the following:
Check which ports your "new" servers try to access (should be something like 8080 and should be written in server logs during startup)
Use netstat -b (from cmd started with admin rights) to check which application blocks this / these ports (could be java.exe if there is an old installation still hanging)
Remove the old installation (uninstall or disable service)
Try again to start your new server(s).
Try tell to GF or TC to bind the default web listener other port than 8080, because this is a root of problem.
I doesn't know well TC, but in GF case, this is very easy. Simply edit $GLASSFISH_HOME/domains/domain1/config/domain.xml and find something similar:
<network-listener port="8080" protocol="http-listener-1" transport="tcp" name="http-listener-1" thread-pool="http-thread-pool"></network-listener>
And replace 8080 with other port (but not same with TC). In your case I could choose 8888 which is easy to remember but you can pretty sure this is differs from TC's port.
Note: Edit this file before you start GF!

Installing Tomcat 7 as Service on Windows Server 2008

I want to install my tomcat v7.0.12 as a service on my Windows 2008 Server.
On the tomcat page I found this tutorial. But there isn't a service.bat file in my installation dir.
In the service overview of WS2008 it isn't possible easily create a new service like new->service ...
To Start Tomcat7 Service :
Open cmd, go to bin directory within "Apache Tomcat 7" folder. You will see some this like C:\..\bin>
Enter above command to start the service: C:\..\bin>service.bat install. The service will get started now.
Enter above command to start tomcat7w monitory service. If you have issue with starting the tomcat7 service then remove the service with command : C:\..\bin>tomcat7 //DS//Tomcat7
Now the service will no longer exist. Try the install command again, now the service will get installed and started: C:\..\bin>tomcat7w \\MS\tomcat7w
You will see the tomcat 7 icon in the system tray. Now, the tomcat7 service and tomcat7w will start automatically when the windows get start.
You can find the solution here!
Install the service named 'Tomcat7'
C:\>Tomcat\bin\service.bat install
There is a 2nd optional parameter that lets you specify the name of the service, as displayed in Windows services.
Install the service named 'MyTomcatService'
C:\>Tomcat\bin\service.bat install MyTomcatService
Looks like now they have the bat in the zip as well
note that you can use windows sc command to do more
e.g.
sc config tomcat7 start= auto
yes the space before auto is NEEDED
I just had the same issue and could only install tomcat7 as a serivce using the "32-bit/64-bit Windows Service Installer" version of tomcat:
http://tomcat.apache.org/download-70.cgi
I have spent a couple of hours looking for the magic configuration to get Tomcat 7 running as a service on Windows Server 2008... no luck.
I do have a solution though.
My install of Tomcat 7 works just fine if I just jump into a console window and run...
C:\apache-tomcat-7.0.26\bin\start.bat
At this point another console window pops up and tails the logs
(tail meaning show the server logs as they happen).
SOLUTION
Run the start.bat file as a Scheduled Task.
Start Menu > Accessories > System Tools > Task Scheduler
In the Actions Window: Create Basic Task...
Name the task something like "Start Tomcat 7" or something that makes sense a year from now.
Click Next >
Trigger should be set to "When the computer starts"
Click Next >
Action should be set to "Start a program"
Click Next >
Program/script: should be set to the location of the startup.bat file.
Click Next >
Click Finish
IF YOUR SERVER IS NOT BEING USED: Reboot your server to test this functionality
There are a lot of answers here, but many overlook a few points. I ran into the same issue and it was likely due to a combination of being a complete neophyte when it comes to tomcat. Even more I am rather new to web servers in general. I consider myself somewhat proficient user of windows, but I guess not proficient enough. In particular I don't work with services too much.
I did not have a startup.bat or any bat files. I only downloaded the 32-bit/64-bit Windows Service Installer. The bin that is created for that download is small - only 4 files. My colleagues were surprised that I did not have a catalina.bat etc... and I was too. Only the below four files in the bin. And no %CATALINA_HOME% or %TOMCAT_HOME% etc...
bootstrap.jar
tomcat-juli.jar
Tomcat7.exe
Tomcat7w.exe
With this setup I had some frustrations as setting parameters is done via the gui widget - very helpful I might add.
So nearly all the answers I have perused were not immediately applicable as many said, "go to bin and issue the startup.bat file" I am a neophyte but not so much to not be able to look into the bin and start such a file it is existed!
For my simple purposes (again remember that I am a neophyte at tomcat and even web servers) all I wanted to do was to be able to startup and shutdown the tomcat server from a cmd prompt window. Nothing too heavy duty. I am embarrassed to say how simple it is. It is probably evident to anyone with a shred of experience with services and such.
To Start server: <Tomcat Root>/bin>Tomcat7.exe start
To Stop server: <Tomcat Root>/bin>Tomcat7.exe stop
Found here - http://crunchify.com/how-to-start-stop-apache-tomcat-server-via-command-line-setup-as-windows-service/
I did not realize there was a separate download the 64-bit Windows zip file that has a tomcat server and all the standard array of cmd line tomcat management tools. This zip file has all the common startup/shutdown scripts, batch files for windows, including catalina.bat/.sh etc... Then all the above answers make sense and are rather trivial.
Remember I am a neophyte when it comes to tomcat and web servers. It appears these two downloads are somewhat mutually exclusive in the sense that if I download and install the 32-bit/64-bit Windows Service Installer version and the 64-bit Windows zip file the startup.bat file in the 64-bit Windows zip file version will not run or interact with the 32-bit/64-bit Windows Service Installer tomcat instance. But I am not sure about this point.
Edit service.bat – Swap two lines so that they appear in following order:
if not “%JAVA_HOME%“ == ““ goto got JdkHome
if not “%JRE_HOME%“ == ““ goto got JreHome
Open cmd and run command service.bat install
Open Services and find Apache Tomcat 7.0 Tomcat7. Right click and Properties. Change its startup type to Automatic (with delay).
Reboot machine to verify if the service started automatically
its done through service.bat file in apache tomcat7
visit this blog ..
install tomcat7 on windows
I had a similar problem, there isn't a service.bat in the zip version of tomcat that I downloaded ages ago.
I simply downloaded a new 64-bit Windows zip version of tomcat from http://tomcat.apache.org/download-70.cgi and replaced my existing tomcat\bin folder with the one I just downloaded (Remember to keep a backup first!).
Start command prompt > navigate to the tomcat\bin directory > issue the command:
service.bat install
Hope that helps!