when using jrebel, How can I make it automaticly republish static resource such as HTML javascript and jsp?
you should use rebel.xml configuration file to map your resources like jsps to the deployed app.
Check out the example: http://www.zeroturnaround.com/reference-manual/app.html#app-3.1
Related
I have a web application I'd like to edit while it's already deployed.
The part I'd like to edit is inside ...applications/myapplication/WEB-INF/classes/META-INF/*.xhtml.
I have a tool that I use to generate these XHTML files and insert them into the aforementioned directory. In a production environment actually these XHTML files are part of a jar project included as a dependency in the main web application.
But what I need is to make hot deploy during development.
I can do it by removing the jar dependency and adding the XHTML in the directory mentioned above. But updating it later doesn't do the job.
Any idea?
If you're using IntellijIDEA, just go to the configuration of glassfish server and select "Update Resources" on "Frame Deactivation".
I have installed IBM Bluemix tools on Eclipse and created a 'Hello World' JSF and EAR project. While creating I have chosen a Bluemix runtime environment. Now I try to deploy EAR from Eclipse, it successfully deployed and started but when I try to open it I get the following error:
Not Found The application or context root for this request has not been found: [Ljava.lang.Object;#bdb04149
What have I missed? Is there comprehensive tutorial to deploy Java EE web applications on Bluemix available anywhere?
You can deploy complete EAR files on Bluemix yes. Using the eclipse tools also makes it much easier. This link has steps on how you can do this https://www.ng.bluemix.net/docs/#manageapps/eclipsetools.html
Further down the page (you can use the menu on the left too) there are steps on how to push an EAR. It might be with pushing a complete Liberty profile to get finer control on the application behavior. This link has further details on pushing Liberty apps and the profile itself https://www.ng.bluemix.net/docs/#starters/liberty/index.html#liberty
If you deployed an EAR (containing your JSF app) you need to add the web module name to the URL, for example, if your project is called testJSF, your URL will look like this:
http://testApp.mybluemix.net/testJSF/
And of course, if your web page is not called index.xxx you need to add the web page name as well, for example:
http://testApp.mybluemix.net/testJSF/textPage.xhtml
or
http://testApp.mybluemix.net/testJSF/textPage.faces
I am learning how ServiceStack works with the help of self-hosting projects.
Self-hosting projects are much easier to debug and understand, since no magic happens inside IIS.
I followed these steps, read http://www.servicestack.net/mythz_blog/?p=785 and applied them backwards.
It worked fine for Docs, but not for the SocialBootstrapApi. The code in Application_Start() from Global.asax is the problem I think
Steps for ServiceStack Docs
Download the ServiceStack Docs sample project
Create a new console project (.Net 3.5 since Docs is still 3.5)
Copy all files from old web project except web.config. (I first used drag and drop, but that only moved the file, it didn't update the .csproj file, so I had to use an editor to copy some ItemGroup sections.)
Move AppHost into a separate class file, changed to inherit from AppHostHttpListenerBase
Copie the Programs.cs file from the RazorRockstars project
Change the baseUrl: var baseUrl = "http://localhost:2001/"; // ConfigUtils.GetAppSetting("WebHostUrl");
Copy the app.config file from RazorRockstars project (but this wasn't needed)
Change output path for console project to .\ because otherwise PageManager.Init got the wrong path and most files were not found
When you done this, download the complete ServiceStack source code and recompile in Debug mode, replace all ServiceStack references in the Docs project by the newly compiled things. Now, you can easily step through all ServiceStack-code, set breakpoints etc, and understand what is happening and when. Console projects also have some other advantages, they start faster, Edit-and-Continue works more often.
For SocialBootstrapApi I did the same except/and
Renamed web.config to app.config
Commented away // [assembly: WebActivator.PreApplicationStartMethod(typeof(SocialBootstrapApi.AppHost), "Start")]
Now, the normal ServiceStack part of the project works, although the url is without the initial /api/
Tried moving Application_Start() from Global.asax to AppHost.Configure ==>> Refuses to start
ASP.NET MVC can't be hosted in a self-hosted HttpListener (since it's coupled to ASP.NET), but ServiceStack does support hosting it's Razor and Markdown view engines inside a self-hosted HttpListener app.
The Razor Rockstars website is a show case website of ServiceStack's Razor and Markdown view engine support. razor-console.servicestack.net is the same website hosted in a HttpListener self-host. The source code of RazorRockstars is on GitHub with the RazorRockstars.SelfHost example contains the source code for razor-console. The one thing you have to remember with self-hosted websites is that the Razor view pages Build Action in VS.NET needs to be set to Copy if Newer so the views are copied in the /bin directory so they can be found by ServiceStack at runtime.
I'm developing a Liferay application, consisting on 2 different portlets, an both have to make certain operations in common, so I decided to put that operations in static methods in an external Utils class.
I have to externalize that class to avoid duplicating the same code in both portlets, and I want to have the portlets in different WAR files.
I know I can package the Utils class in a JAR file, but we are still developing and we don't want to regenerate the JAR and restart the Tomcat for every change.
Which is the best option and how can I perform it?
If you're using the Liferay SDK, you can use the clients (recently changed to shared) directory to put your common code.
A good example is how deploy-listener-shared is used in conjunction with deploy-listener-hook.
From what it looks like, all the configuration you need to do is to modify your build.xml files that will use the client\shared classes. If you look at build file of deploy-listener-hook you can see all you need to add is the.
For the new SDK:
<property name="import.shared" value="my-utils-shared" />
For the older SDK:
<property name="dependent.clients" value="my-utils-client" />
Hope this helps!
There is another method that involves building a JAR file but it doesn't require a server restart (on Tomcat at least).
Write a build script for your JAR file so it compiles, builds the JAR and finally copies it to the following location:
{tomcat}/webapps/ROOT/WEB-INF/lib
Then in your portlet open the "liferay-plugin-package.properties" (in Liferay Developer Studio / Liferay IDE this should open with a nice GUI).
Then add the name of your JAR to the "portal-dependency-jars" list in this file so in the source it would like (Or just hit the "Add" button in the GUI and select the JARs you want):
portal-dependency-jars=my-custom-lib.jar,my-other-custom-lib.jar
Save the file, and redeploy the portlet, and the JAR will be copied across when the portlet is deployed.
I've used this method for custom JARs, and 3rd party JARs that I've needed to use in my portlets.
For the development phase just package the jar file with both applications.
Unless one application depends on the other somehow it is completely ok.
Another solution is to use JRebel tool. It will allow you to redeploy jar in tomcat without restarting.
Also you may have several portlets in one .war. You may just define them both in portlet.xml.
I want to develop richface implented app on Ibm Websphere. I include *.jars under
WEB-INF/libs and it runs succesfull. But first deployment proccess is realy terriable..
So I want to add libraries to server, not include in application.
(i belevie it could increase 1st deployment).. Is there a way to override server impelemented
JSf in server side?
Thanks
You need to set the webapp's classloading policy to module instead of application in the Websphere deploy manager.