Jasper-Struts2 plugin: compiled reports from external directory - struts2

I'm using Jasper with the Struts2 plugin to generate PDF reports for my web application, as described in this tutorial.
The application uses Weblogic as app server and Apache as webserver in development environment, IIS in testing and production environments.
Locally I put the .jasper files under WEB-INF of the WAR section, which is then put in a EAR after compilation.
PDF generation works locally, passing a relative path (namely WEB-INF/jasper/template.jasper) to the result parameters of the "jasper" result in struts.xml . This does not work when the application is deployed as an EAR.
How can I get my application to find the .jasper template even when deployed as an EAR? I tried to pass in an absolute path pointing to a directory in the same server the EAR is in, but it doesn't work.
And by the way, is there a comprehensive guide to the Struts2 plugin for Jasper? I couldn't find anything except for that tutorial.

In weblogic domain home's webapplications tab; enable the option called Archived Real Path Enabled
works for me in weblogic 11g or later versions

Related

Adding IHS server details under ant script

I have an ant script to deploy the EAR file to my Websphere application server. This server is under clustered environment and has a cell with its respective nodes.
I also have an IHS server above this WAS instance which my application uses.
Requesting to kindly guide as to how the ant script can be used to deploy the EAR file on cluster by providing the required IHS server details.
Thanks
You should have a look at the section in $WASHOME/bin/configureWebserverDefinition.jacl that iterates through the existing web modules and maps them to the newly created webserver.
In Jython, from the manual:
AdminApp.edit('myapp', ['-MapModulesToServers',
[['.*', '.*', '-WebSphere:cell=mycell,node=mynode,server=server1']]])
But you'd need to substitue the full name for your webserver.

Deploying asp.net mvc app to folder

I have a hosting running windows, lets say the root domain is xxx.com. On xxx.com there should be website running on php (since IIS can run PHP, right?) or asp.net. I really dont know yet.
I am now responsible of making a asp.net mvc app, which should be running only inside a folder like xxx.com/myaspapp.
I've tried to publish the app straight to the folder via visual studio and it fails with an error:
Server Error in '/' Application.
Configuration Error
Description: An error occurred during the processing of a configuration file
required to service this request. Please review the specific error details
below and modify your configuration file appropriately.
Parser Error Message: It is an error to use a section registered as
allowDefinition='MachineToApplication' beyond application level. This error
can be caused by a virtual directory not being configured as an application in IIS.
What is a solution for this? Is this scenario even possible?
Thank you.
WebDeploy can create a virtual application under an IIS site automatically. Check it out:
THE ANATOMY OF A WEBDEPLOY PACKAGE
It is simple to host an application in a sub folder. Follow the below steps.
Create a folder (myaspapp) under the root site path.
Open IIS Manager (inetmgr) and expand till the new folder.
Right the newly created folder and click on Convert to Application.
Deploy/Upload the application files directly to this folder.
Now you will be able to access the site from the sub folder.

Is there a way make a Grails app aware of changes in properties file without server restart?

I've externalized the properties file for my production Grails app running on Tomcat.
I'm wondering if there is a way the Grails app will read the configs from the config file in real time instead of having the changes take affect only after server restart.
For example, I'm using the LDAP plugin which has the following config:
grails.plugin.springsecurity.ldap.context.managerDn = 'somethinghere'
If I change the above setting in the external config file the server needs to be restarted for it to take effect.
I googled "grails external reload" and the first result was http://grails.org/plugin/external-config-reload

ASP.NET MVC Deployment Referencing Development Environment

I am trying to deploy my ASP.NET MVC 3 application using Visual Studio 2010's "Publish Web" option (build/Publish App). This generates deployment/bin, deployment/scripts, deployment/views etc.
I loaded these resulting deployment files/folders to a web server running IIS 6. Afterwards, everything seemed to run just fine on this web server.
I then started to make new updates, just to my local environment. After doing that, the deployed version of the site stopped working. I looked at the stack trace and the web server seemed to be referencing controllers.cs from my local environment, as opposed to the dll's in the bin directory on the web server.
Is there something else I need to do before deployment to tell the web server to use it's own bin files as opposed to files on my development environment?
BTW both my development machine and the web server live on the same network.
Update:
Another thing that made me suspect that the web server was referencing my local dev environment was that when a new user tried to access the application she got an IOFileNotFoundException in regards to a reference to "Interop.ActiveDs.dll". The stack trace mentioned my_local_path/Interop.ActiveDs.dll. This file was in fact not on the web server so I added it and then her error went away. The Odd thing was that all other users before her did not recieve an error about this missing reference.

Grails 2.0, Resource Plugin and root hosting

I've been upgrading a Grails 1.3.7 project to Grails 2.0. Everything was going smoothly until I hit integration (first non-local deployment). The gist of the problem is that it appears the Resource plugin always prepends the app name to the static CSS/JS URLs it generates, regardless of the grails.serverURL or grails.app.context specified for the environment. What's strange is image resources are hosted with the appropriate URL "/static/foo.png" but CSS/JS files attempt to be served as "/AppName/static/foo.js". Tracking this issue in ResourceTagLib, this initially looks like a issue in Resource Plugin but I don't want to jump to conclusions.
Our integration environment is setup with Apache proxy passing all traffic from "/" to ":8080/AppName" hosted on Tomcat. Therefore, all traffic to "http://int.sitename.com" is hitting the app running on Tomcat. Previously, in 1.3.7, grails.serverURL="http://int.sitename.com" was all that was required to get resources to served correctly.
Does anyone know a way to resolve this issue or does this look like a bug present in Resource plugin.
I'm using Grails 2.0 too. There is a line app.context=/ in the application.properties. As application is deployed to Tomcat, it's also on renamed to ROOT.war on deployment, so Tomcat will use a ROOT ie / context for this application. As result I don't have the described issue.

Resources