How to run Atmosphere Sample? - java

I have just downloaded the Atmosphere Samples from Github. When I ran jetty:run goal on the chat-sample, I have some problems.
I can access to the page (http://localhost:9090) with my browser, but when i start chatting, nothing append, because the server return an 404 error page for each AJAX request.
What am I doing wrong?

I had the same problem, and was able to solve it by running jetty not through maven but with jett-runner. You have to download 2 jars:
wget http://repo1.maven.org/maven2/org/eclipse/jetty/jetty-websocket/8.1.4.v20120524/jetty-websocket-8.1.4.v20120524.jar
wget http://repo1.maven.org/maven2/org/mortbay/jetty/jetty-runner/8.1.4.v20120524/jetty-runner-8.1.4.v20120524.jar
build the war with:
mvn package
and than you can run it by:
java -jar jetty-runner-8.1.4.v20120524.jar --jar jetty-websocket-8.1.4.v20120524.jar --path /atmosphere target/atmosphere-chat.war
now you can open your browser to:
http://localhost:8080/atmosphere/

Ok something similar happened to me recently. Along with no message being sent, there were also 404 errors for all the JS files. Thats when I realized that trailing slash in http://localhost:9090/ is important :)

Related

how to install tasktop pro connector in eclipse

Facing Some issues while installing tasktop pro in my eclipse, giving the following error:
HTTP Server Unknown HTTP Response Code
(301):http://tasktop.com/downloads/discovery/update/content.xml
General connection error with response code=301
Can Someone help me with issue ?
thanks,
AJ
Error Screenshot
It looks like you had some connection issues with the update site. Or your Eclipse version can't handle a HTTP 301. Did you tried it again?
Otherwise try to install it via "Install New Software"
I tried to install it myself, it works without any problems. I created an Eclipse Profile for you. If you install it, it contains the Tasktop Dev Pro Plugin.

Eclipse tomcat - unable to display index.jsp page

There is a maven spring mvc project which I imported in eclipse . The same project is running successfully in my colleague's desktop . When i start the tomcat server in eclipse, I am not able to see http://localhost:8080/test/ , it is showing as error http status 404 . I even changed the port no to 8081 and ran it again but it is giving same error . It is not able to find the index.jsp page .
Try to use
File -> Import -> [General] -> Project interchange (for the whole ZIP)
or
File -> Import -> [General] -> Existing project into workspace (for the extracted file)
for eclipse to import them properly.
Do you see tomcat running properly under localhost:8080 or 8081 ? if not, then it means something is wrong with Tomcat in general, what can you see in catalina.log file during tomcat start attempt (or in the command shell where you attempt 'catalina start' ?
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
The first answer in the above query solved the issue . I was getting classNotFoundException due to which index.jsp I was unable to view .

how to install jautodoc in eclipse mars version

Hi i am trying to install jautodoc in my mars version but i got following error please help me
HTTP Server 'Service Unavailable': http://jautodoc.sourceforge.net/update/content.xml
HttpComponents connection error response code 503.
In your eclipse you can get it from help -->Eclipse MarketPlace --> search for jAutodoc this is one way.. If it is not supporting in your eclipse
2nd way is copy from your old eclipse pluggins
go to your eclipse pluggins location ........
C:\Program Files\eclipse\plugins and copy the net.sf.jautodoc.velocity_1.12 jar
net.sf.jautodoc_1.12.jar (if u have in your previous eclipse)
HTTP Error 503 - Service unavailable
The Web server (running the Web site) is currently unable to handle
the HTTP request due to a temporary overloading or maintenance of the
server
Please check attached screen shot SourceForge is under maintenance mode

Writing CGI script in Java

I trying to figure out how to write CGI scripts in Java.
I followed this examples -> http://www.javaworld.com/jw-01-1997/jw-01-cgiscripts.html?page=1
It provide cgi_lib.java, hello.html and hello.java
Everything seems fine, but in the html part.
The action is pointed to cgi_lib/hello.cgi
There's no cgi provided. So I tried with cgi_lib/hello.java, and it print the entire source code in the hello.java.
Then i tried to edit the hello.java extensions into hello.cgi, and tried again.
The browser returns me error 500.
What is the problem?
Is it that, there's some specific method to compile the hello.java into hello.cgi?
The script in hello.cgi is different from hello.java?
Please help.
Thank you.
UPDATE
I added hello.cgi
#!/bin/sh
java -Dcgi.content_type=$CONTENT_TYPE -Dcgi.content_length=$CONTENT_LENGTH - Dcgi.request_method=$REQUEST_METHOD -Dcgi.query_string=$QUERY_STRING -Dcgi.server_name=$SERVER_NAME -Dcgi.server_port=$SERVER_PORT -Dcgi.script_name=$SCRIPT_NAME -Dcgi.path_info=$PATH_INFO hello
So is the $CONTENT_TYPE, $CONTENT_LENGTH,... remain the same? Or should I enter something?
Just to make things clearer.
I put the the cgi_lib, hello.java and hello.cgi in the C:\xampp\cgi-lib
And the hello.html in C:\xampp\htdocs\test
When I tried to connect it returns me this
Server error!
The server encountered an internal error and was unable to complete your request.
Error message:
couldn't create child process: 720002: hello.cgi
If you think this is a server error, please contact the webmaster.
Error 500
localhost
Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.7
I had check the httpd.conf in c:\xampp\apache\conf and configure according to this
LoadModule cgi_module modules/mod_cgi.so
ScriptAlias /cgi-bin/ "C:/Program Files/Apache Group/Apache/cgi-bin/"
Seems to be already enable.
So whats the problem right now?
The contents of hello.cgi is shown at the top of page 2 of the article.
#!/bin/sh
java -Dcgi.content_type=$CONTENT_TYPE -Dcgi.content_length=$CONTENT_LENGTH -Dcgi.request_method=$REQUEST_METHOD -Dcgi.query_string=$QUERY_STRING -Dcgi.server_name=$SERVER_NAME -Dcgi.server_port=$SERVER_PORT -Dcgi.script_name=$SCRIPT_NAME -Dcgi.path_info=$PATH_INFO hello
The article says that you will execute the java jar from within a cgi script. You need to make sure that this script is set up to execute your jar file by making the correct calls to the java executable with your hello.jar file as the parameter. Also make sure your web server is configured correctly to allow the execution of cgi scripts.
You also have to chmod of your cgi and java files so others can execute them.

php java bridge not working on tomcat 6

I just installed the current Tomcat version on my mac because I wanted to try the PHP Java bridge.
I followed the guide here http://php-java-bridge.sourceforge.net/pjb/tomcat6.php but when I paste the xml config to the tomcat configuration file
<listener><listener-class>php.java.servlet.ContextLoaderListener</listener-class></listener>
<servlet><servlet-name>PhpJavaServlet</servlet-name><servlet-class>php.java.servlet.PhpJavaServlet</servlet-class></servlet>
<servlet><servlet-name>PhpCGIServlet</servlet-name><servlet-class>php.java.servlet.PhpCGIServlet</servlet-class>
<init-param><param-name>prefer_system_php_exec</param-name><param-value>On</param-value></init-param>
<init-param><param-name>php_include_java</param-name><param-value>On</param-value></init-param>
</servlet>
<servlet-mapping><servlet-name>PhpJavaServlet</servlet-name><url-pattern>*.phpjavabridge</url-pattern> </servlet-mapping>
<servlet-mapping><servlet-name>PhpCGIServlet</servlet-name><url-pattern>*.php</url-pattern></servlet-mapping>
nothing works anymore - all I get when I open localhost:8080 is "error 404 - resource() not found". If I leave out the above lines, at least I get the welcome page, but then the directory where I put the phpJavaBridge application only shows the resource() not found error.
I am pretty new to development with Tomcat, so I really have no idea how to fix that problem. Any help would be greatly appreciated!
Your Java Version is out of date. Use Sun Java 6 or above instead.
The 'NoClassDefFoundError' means that Sun's script api is missing. Search for script-api.jar and install that to get rid of this error.
deploy JavaBridge.war is easy
https://sourceforge.net/projects/php-java-bridge/files/Binary%20package/php-java-bridge_6.2.1/php-java-bridge_6.2.1_documentation.zip
unzip php-java-bridge_6.2.1_documentation.zip,you wil find JavaBridge.war in the folder.

Categories