Set server.root via Resin Plugin

Hi,

I've been using IDEA and Resin for a long time, but I have always just created an "Application" and gave it my Resin classes and set the appropriate environment variables to get it to allow me to have separate resin.home and server.root values.

Now I would like to use the plugin (so I can take advantage of IDEA's JSP/JSPX support), but I can't figure out how I need to configure everything to allow me to set this up.

Has anyone done this? What do I need to do? Magnus, if you're there, I'd be happy to help or write a "howto" if I can just get things working.

Thanks,
Tony

14 comments

Hi,

Here's a basic outline on how to get things going

1. Install the Resin plugin
2. Create an Application Server for Resin. Here you configure where your Resin installation is located. If you need some specific configurations for your Resin you can specify a resin.conf that is used as base and your web application is added to it
3. Create a Web Application module
4. Configure the Web Application module to have an exploded directory
5. Add a run configuration to IDEA; set it to use Resin You can if you like override the base resin.conf that should be used, but you don't need to
6. Run it


/Magnus Johansson

0

I've created a series of screenshots that shows how to use the plugin.
I haven't had the time to add some texts yet... so it's very light...

You can find it here

http://idearesinplugin.sourceforge.net/


/Magnus Johanssoon

0

Hi Magnus -

Thanks for the help. The screenshots are quite helpful.

However they don't really answer my question. I've got the basic version working, and it's ok for me when I'm using small apps.

However I'm working on a huge webapp (~120MB) with multiple modules that produce jar files, all of which end up getting deployed into my webapp. I have multiple versions of the software running in independent IDEA projects.

Because there are multiple versions, I don't want to have to duplicate the base resin binaries. I'm happy to have each project have its own server root but share resin.home.

Up to now, I've been creating an "Application" for Resin, and I've been passing in VM params to specify server.root and resin.home, and that works great, but I can't easily debug JSPs that way.


Using your instructions, here's the command line that got executed when I started Resin (I added line breaks for readability):

/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/bin/java
-Djava.util.logging.manager=com.caucho.log.LogManagerImpl
-Xdebug
-DRESIN_HOME=/usr/local/resin-3.0.21
-Djava.library.path=/usr/local/resin-3.0.21/bin
-Dfile.encoding=MacRoman
-classpath /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/tools.jar:/usr/local/resin-3.0.21/lib/jsdk-24.jar:/usr/local/resin-3.0.21/lib/activation.jar:/usr/local/resin-3.0.21/lib/aopalliance.jar:/usr/local/resin-3.0.21/lib/ejb-20.jar:/usr/local/resin-3.0.21/lib/ejb-30.jar:/usr/local/resin-3.0.21/lib/j2ee-deploy-10.jar:/usr/local/resin-3.0.21/lib/j2ee-management-10.jar:/usr/local/resin-3.0.21/lib/javamail-14.jar:/usr/local/resin-3.0.21/lib/jca-15.jar:/usr/local/resin-3.0.21/lib/jms-11.jar:/usr/local/resin-3.0.21/lib/jmx-12.jar:/usr/local/resin-3.0.21/lib/jstl-11.jar:/usr/local/resin-3.0.21/lib/jta-101.jar:/usr/local/resin-3.0.21/lib/portlet-10.jar:/usr/local/resin-3.0.21/lib/quercus.jar:/usr/local/resin-3.0.21/lib/resin-jdk15.jar:/usr/local/resin-3.0.21/lib/resin.jar:/usr/local/resin-3.0.21/lib/resinboot.jar:/usr/local/resin-3.0.21/lib/script-10.jar:/usr/local/resin-3.0.21/lib/webutil.jar
com.caucho.server.resin.Resin
-conf /tmp/resin30301.conf

I can see the plugin overrides the resin.conf file, but I actually don't need to just override the .conf, I want to be able to specify a server.root.

It's very similar to the way Tomcat lets you have a Tomcat Home and a Tomcat Base. If I can have that level of functionality working, that would be great. But it doesn't look like it's supported. Can you confirm?

Thanks very much,
Tony

0

I wasn't aware of the server.root functionality, and no, there is no support for it. However
I think it would be fairly easy to add support for it and I can do that in the next couple of days. Are you using IDEA 6?

/Magnsu Johansson

0

There is now a new version of the plugin in the plugin repository that allows you specify
additional program parameters. This should allow you to specify the server root manually

I've only updated the version for IDEA 6.x. It could however easily be backported to older
versions if you need that

/Magnus Johansson

0

Hi Magnus -

Yes, I'm using IDEA 6. I'll try the plugin with this new option and let you know if it gives me what I am looking for.

Thank you so much! :)
Tony

0

Hi Magnus -

Okay I finally tried your suggestion. It is working properly, setting the server.root variable the way I want.

However, I noticed though, that it's not setting the resin.home environment variable. I think Caucho changed it from RESIN_HOME to resin.home. Could you make that switch for Resin 3.x verison plugins?

Here's my console output, as well as a link to the release note where the launch env. var changed.

/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/bin/java -Djava.util.logging.manager=com.caucho.log.LogManagerImpl -Xdebug -DRESIN_HOME=/usr/local/resin-3.0.21 -Djava.library.path=/usr/local/resin-3.0.21/bin -Dserver.root=/Users/Shared/StripesTimesheet/Resin -Dfile.encoding=MacRoman -classpath /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/tools.jar:/usr/local/resin-3.0.21/lib/jsdk-24.jar:/usr/local/resin-3.0.21/lib/activation.jar:/usr/local/resin-3.0.21/lib/aopalliance.jar:/usr/local/resin-3.0.21/lib/ejb-20.jar:/usr/local/resin-3.0.21/lib/ejb-30.jar:/usr/local/resin-3.0.21/lib/j2ee-deploy-10.jar:/usr/local/resin-3.0.21/lib/j2ee-management-10.jar:/usr/local/resin-3.0.21/lib/javamail-14.jar:/usr/local/resin-3.0.21/lib/jca-15.jar:/usr/local/resin-3.0.21/lib/jms-11.jar:/usr/local/resin-3.0.21/lib/jmx-12.jar:/usr/local/resin-3.0.21/lib/jstl-11.jar:/usr/local/resin-3.0.21/lib/jta-101.jar:/usr/local/resin-3.0.21/lib/portlet-10.jar:/usr/local/resin-3.0.21/lib/quercus.jar:/usr/local/resin-3.0.21/lib/resin-jdk15.jar:/usr/local/resin-3.0.21/lib/resin.jar:/usr/local/resin-3.0.21/lib/resinboot.jar:/usr/local/resin-3.0.21/lib/script-10.jar:/usr/local/resin-3.0.21/lib/webutil.jar com.caucho.server.resin.Resin -conf /tmp/resin19818.conf
Resin-3.0.21 (built Thu, 10 Aug 2006 12:03:19 PDT)
Copyright(c) 1998-2006 Caucho Technology. All rights reserved.

Using Resin(R) Open Source under the GNU Public License (GPL).

See http://www.caucho.com for information on Resin Professional,
including caching, clustering, JNI acceleration, and OpenSSL integration.

Starting Resin on Sun, 08 Oct 2006 08:58:49 -0400 (EDT)

Server[] starting

Mac OS X 10.4.8 i386
Java 1.5.0_06-64, 32, mixed mode, MacRoman, en, "Apple Computer, Inc."
resin.home = null
server.root = /Users/Shared/StripesTimesheet/Resin

http listening to *:7001
Connected to server
Host[] starting

http://www.caucho.com/resin-3.0/features/resin-3.0.15.xtp


Thanks,
Tony

0

Ok, I'll modify the plugin for this. I'll probably have a new release tomorrow

/Magnus Johansson

0

Now there is a new version that sets resin home correctly

/Magnus Johansson

0

Thanks Magnus - that's now working properly, great!

In my application, I have two web modules. Your plugin lets me enable both of them for deployment, but for some reason only one seems to actually get deployed to resin. I checked the auto-generated .conf file, and only one webapp has been listed there.

I can choose one or the other and it deploys each one fine, but when I combine them, it only deploys the first one.

Can you check that out?

Thanks!
Tony

0

That's strange. I just tried and it works when I test it.

What you need to do (if you haven't allready) is that in the Run configuration dialog you need check both web applications on the Deployment tab. You also need to make sure that they deploy to different application context. So:

1. Go to the Deployment tab.
2. Choose web-app-1. Click deploy checkbox and choose application context /app1
3. Choose web-app-2. Click deploy checkbox and choose application context /app2
4. Run

/Magnus Johansson

0

Weird. OK I'll check it out shortly. These are project module files built using maven:

mvn idea::idea

so they may have some quirks...

0

Hello Magnus,

First of all, thanks for the development of the Resin plugin.

I've been using Resin with version 4.0.3 of IntelliJ. Our company has stuck with this version because of a work-around to not have-to-have an exploded directory or war file for deployment of a module. We are upgrading to 6.x and have noticed we now must have an exploded directory or war file. The exploded directory is working fine for us, however for our use it is waste of disk space and it is painful to 'package' or 'make' a jsp to move it to the exploded directory. We are often making scripltet or text changes on a jsp and then refreshing the browser.

Is there anyway to use the "web" directory for a module without having to explode it?

Thanks,
Mike Bushman

0

I'm also trying to deploy multiple web modules at once and have been unsuccessful. Were you able to get this working?

0

Please sign in to leave a comment.