Can't load JSTL in multi module maven project with embedded jetty - 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?

Related

How to deploy files for Sitecore using TDS

I'm starting a new Sitecore 9 project using Helix and TDS. I've got my basic structure setup, using Hedgehog's fork of the Habitat site as a guide. I'm also referencing Hedgehog's docs.
My solution is just a start, so it's very simple right now, only a Foundation.Serialization module that contains the TDS projects for the basic layer folders and a Project.Website module that contains a TDS project and an MVC Website project (MVC)....it's got a basic Razor view and some random CSS/JS files.
The TDS Habitat readme, says to use Solution > Deploy Solution to deploy the projects. When I do this on my project it builds and the Sitecore items are deployed to Sitecore, but my Views and CSS/JS are not....presumably because I haven't configured anything to facilitate this.
Looking at the docs and the TDS Habitat solution, it's not clear to me how to configure TDS to know anything about how to deploy files. I'm finding info on the web that says that TDS will deploy files, transform configs, etc but with no examples of how to actually make that happen.
How do I set things up so Deploy Solution will also deploy files from all of the web projects in a solution to my local web root?
First, you will need to make sure the Sitecore Deploy Folder is set. From the documentation:
Sitecore Deploy Folder – Contains the path to the ROOT of the Sitecore
instance on the file system. This setting is used to install the TDS
Classic service when needed and to deploy the compiled code when the
TDS Classic project is built.
You also need to make sure that file deployment has not been disabled:
Disable File Deployment – Stops TDS Classic deploying files to the
directory specified in the Sitecore Deploy Folder.
If you are still not seeing the files being deployed, you will need to check if the process has access to the deploy folder.
You can also deploy files as a .update package and then use another automated tool to deploy the .update package to the target environment.
I figured out the issue. On the properties page for a TDS project there is a field where you indicate which projects should be built and deployed along with the sitecore items:
https://www.hhogdev.com/help/tds/propgeneral

WSO2 Carbon Identity Server - Build and run

I've modified a .jsp file in the org.wso2.carbon.identity.entitlement.ui package, in order to customize the server for my purposes.
The problem is that when I build the project with Eclipse, the build is successful, but I don't understand how I can actually run the compiled code. How can I do it?
Once you build the project with maven, in the target directory you will find the jar (OSGi bundle). In your IS Server under /repository/component/patches, create a new directory something similar to "patch0100". Copy the jar inside this "patch0100" directory and restart the IS server.
The number in the patch directory (0100 in this case) is important. If you put the same jar to a patch directory with a higher number, say pactch0200, that particular jar with override the earlier one. That's how patching works in WSO2 Carobon Server, which is the platform on which the products are built.

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

Jetty runner is not executing the war file

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.

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/