Jetty runner is not executing the war file - jetty

I have a project named as test using spring,hibernate and struts.It is running when am using eclipse.But when i export this project as war and execute it using jetty runner in command prompt it just extracted the project and listed the contents in the browser.But i want the project to be executed.I have tried with some other simple web application war using the same procedure and it works fine.But in my project its not working with jetty.
here is my code for jetty
D:\>java -jar jetty-runner-7.0.0.v20091005.jar test.war
i just listing some console output of jetty
INFO::RUNNER
NO tx manager found
deploying file:D:/test.war #/[webAppContext#86f241#86f241/,null,file:D:/test.war
can any one tell me a solution for my problem

1) use a newer version of runner, 7.6.3.v20120416
2) what context are you trying to navigate to, you might want to experiment with some of the other cli options on the runner to set the context and whatnot from the command line and experiment with that. This site has some good information on using this artifact as well.

Related

Windows service not showing up

I have a windows service project that I inherited and need to migrate it to a new server. I have made changes to some code, and so I created a new setup project in VS 2017. I added the .exe of the service to the set up package, and rebuilt both the service and the setup projects. When I run the .msi it seems to complete installation but when I look in the Windows Services list it's not there. What am I missing?
Any help is greatly appreciated. Thanks!
The installer probably didn't run the installutil.exe program.
You can do this manually by dropping to a command prompt then navigating to the location that the installer put the .exe file. From there run this:
installutil.exe myservice.exe
where myservice is the exe file you generated.
For more information:
https://learn.microsoft.com/en-us/dotnet/framework/tools/installutil-exe-installer-tool
Also, you might need to add the installutil.exe path. It's part of the .net framework and will be found in that install directory.

Can't load JSTL in multi module maven project with embedded jetty

I have created a test framework for testing .jsp files and .tag files using embedded jetty. I'm starting Jetty server programmatically using Java API, adding servlet holder and wrapper test JSP and initializing the server passing the project's web root.
There were some issues with Jasper discovering TLD locations during runtime when run from maven surefire plugin. I fixed it by providing
<useManifestOnlyJar>false</useManifestOnlyJar>
plugin classpath settings. Everything works good when I run tests using mvn clean install now.
Running tests from eclipse context menu has one issue. If there is any other project in workspace in the multi module maven build, TLD's in that project are not resolved. One workaround I tried was to 'close' the project in eclipse workspace and it worked out.
However I would want it to work with all the projects open in workspace and running from the eclipse JUnit context menu. The problem is in the jasper TldScanner that looks for tld files in jar and WEB-INF of current project only.
TldScanner.scanTlds()
processWebDotXml();
scanJars();
processTldsInFileSystem("/WEB-INF/");
I'm using org.glassfish.web.jsp-impl 2.2.2-b06 version with Jetty-8.1.0-RC5.
Is there a way to specify file based TLD scanning for jasper for extra classpath items?

Missing build.xml when creating project with ClickStart?

I am using Eclipse EE version and CloudBees plugin to create a ClickStart JBoss 7 project. However, I am not very familiar with the EE version of Eclipse, and used Netbeans to edit my JSP.
Then I used CloudBees SDK to run and deploy my new project but it failed (the command prompt):
D:\Personel\Java EE\HelloCloudBees>bees run
ERROR: java.io.FileNotFoundException: D:\Personel\Java
EE\HelloCloudBees\build.xml (The system cannot find the file
specified)
I found no build.xml file in my folder. How can I create it?
bees run command expect an ant-based project structure, so the build.xml. As documented
CloudBees project commands are only available for applications
generated using the Bees wizard (on the web), built using the
CloudBees SDK style.
This is more or less some legacy stuff, as is now superseded by ClickStart. Equivalent command would be bees app:run but require your app to first be packaged as a WAR and only support the default tomcat6 runtime. So for your specific use-case would be simpler to package and deploy on a local JBoss 7 server. To deploy on RUN#Cloud, use bees app:deploy or just git push and let DEV#Cloud Jenkins build and deploy for you (assuming you created app with a clickstart).
Also, there's no need to use Eclipse if you're familiar with NetBeans.
Have you tried out maven?If yes you can download it and then use mvn eclipse:eclipse and then you can import your project in your workspace using eclipse import capabilities.File -> Import -> Maven -> Existing Maven Project...you point to the file where your pom.xml file is..and is imported. Take into accoutn m2eclipse plugin in eclipse must be installed prior.
regards
\n\m

How to stop jetty runner from executing

Am using jettyrunner for executing my war files.I am using command java -jar jetty runner ex.war.But am running this jetty server from my java application by executing this commands from java.My problem is at first time its working good,but the second time if i am again executing another war file with the same code its executing the older war.i have found the reason that the older jetty server is keep on running.How could i stop this server from java in order to start the jetty server for another war.
One option should be:
http://wiki.eclipse.org/Jetty/Howto/Secure_Termination
Another would be to use the ShutdownHandler:
http://git.eclipse.org/c/jetty/org.eclipse.jetty.project.git/tree/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ShutdownHandler.java
Or don't use the jetty-runner directly like that from java code and just write a small embedded usage:
http://wiki.eclipse.org/Jetty/Tutorial/Embedding_Jetty
Turned out, jetty-runner.jar doesn't have a feature to stop existing jetty process ran with stop-port and stop-key.
I found the answer in https://github.com/jetty-project/jetty-documentation/blob/master/src/docbkx/administration/runner/jetty-runner.xml
Then, to stop jetty from a different terminal, you need to
supply the same port and key information. For this you'll either
need a local installation of jetty, the jetty-maven-plugin jetty-ant plugin, or write a custom class
Fortunately, I was implementing gradle build, so jetty-ant satisfied my needs.

deploying scalatra onto Jetty

How does one deploy scala or scalatra onto Jetty servlet container? Does anyone have experience or can point me to some resources online?
If you're using sbt, run the package command from within the sbt shell. This will create you a war file in the target dir. You can drop that into jetty's webapps directory and configure a context xml file in its contexts directory.
If you're using maven, I believe the command you want is mvn package.
Are you using Simple Build Tool (SBT) for your project? If you do, it's as easy as running "sbt jetty"
Check it out: http://code.google.com/p/simple-build-tool/