PDA

View Full Version : Deploying on JBoss


dybomaha
07-15-2004, 07:47 PM
Hello,

I would like to test deployment on JBoss 3.2.5 under Linux.

My JBoss is working great, but I can't find the WAR file in the LPS downloads. I have both the core download and the full Linux download, but I do not see the prepackaged WAR file in any of them.

DYBOMAHA

bloch
07-15-2004, 07:56 PM
In the LPS DE core distribution, you can find an exploded war directory.

-Eric

bloch
07-15-2004, 07:58 PM
To be clear, youi can turn it into a .war file, if you need that by doing

% cd $LPS_CORE_DIR
% $JAVA_HOME/bin/jar cf lps-2.1.2.war lps-2.1.2

dybomaha
07-15-2004, 08:06 PM
Thanks,

That's what I needed to know.

I will try it out...

Tim

dybomaha
07-15-2004, 08:14 PM
Thanks again, the delpoyment worked fine except I have found that the pls path is needed twice:

http://localhost:8080/lps-2.1.2/lps-2.1.2/tutorials/index.html

The above URL works - but I need to fix the duplicated path listing.

I suppose this should be done with a revised web.xml.

DYBOMAHA

dybomaha
07-15-2004, 08:20 PM
While I am testing the Krank file are not able to be loaded. I guess this is because the server can't create them in the deployed WAR file?

DYBOMAHA

bloch
07-15-2004, 08:25 PM
I gave you poor instructs to make the war :-(

You want to remake it as

cd $LPS_CORE_HOME/lps-2.1.2
$JAVA_HOME/bin/jar cfv ../lps-2.1.2.war *

Sorry for the inconvenience.

-Eric

bloch
07-15-2004, 08:26 PM
A handful of things won't work (krank included)
if the container doesn't explode the war; that is, the LPS expects there to be a file system (rather than a simple .war) that houses the LPS during development.

At deployment time, a read-only .war file is ok.


-Eric

dybomaha
07-16-2004, 05:23 AM
Bloch, thanks so much.

The war file is working fine now, except for the krank part.

In the previous post, you mentioned a handful of things. Can you elaborate on that, so that I can get a clear understanding of the limitation of using something like JBoss as our container?

Secondly, I am still hoping to find a way to use krank during development. I am connecting to our stateful session beans, maybe I need to rethink how we connect to JBoss. It may be better to run Tomcat as a display front end and then connect to JBoss that way? Just my thoughts.

DYBOMAHA

bloch
07-16-2004, 04:56 PM
JBoss uses jetty or tomcat (or other?) servlet containers. Both tomcat and jetty explode wars into directories so you should have no prob there.
If you use jboss with another container, then it would depend on the container; the servlet spec is loose on whether there has to be an underlying file system behind a webapp.

You mostly want to krank before deployment.
And not that many times since krank-ing is
slow.

As to how to get to your session beans.
You can run lps in one webbapp and session beans inanother... or both in the same. And you can run in one container or two. It's up to you... and a good choice will depend on expected load and usage patterns. In general the LPS is stateless.

We do have a feature in test for making it easier to connect LZX and Java server code. I'm hoping to provide details real soon now.

k-dub
10-06-2004, 11:34 AM
You can deploy exploded WAR applications in JBoss by putting the application in the deploy directory and adding ".war" to the name of the application folder. I just installed the "lps-2.2" folder in JBoss 4.0 by renaming the folder to "lps-2.2.war" and browsing to http://<myserver>:<myport>/lps-2.2/.

The same goes for EAR and SAR files. Deploy them in exploded format by using a directory with the file extension in the name of the directory.

bloch
10-06-2004, 11:40 AM
The feature I described in my post above is called Java RPC in LPS 2.2. See

http://www.laszlosystems.com/lps-2.2/docs/guide/laszlorpc.html



-Eric

dybomaha
10-06-2004, 11:52 AM
We are very excited about the new RPC functionlity.

Also, I added a detailed example about using exploded directories under a different thread, see:

http://www.laszlosystems.com/developers/community/forums/showthread.php?s=&threadid=1052&highlight=JBoss

The use of the exploded directory under JBoss does work great with JBoss 3.2.5.

I have not tested JBoss 4.0, but I will be doing so shortly.

DYBOMAHA

k-dub
10-06-2004, 12:08 PM
That RPC stuff looks *very* interesting, indeed. I can't wait to get up to speed on the Laszlo platform.

milx
10-08-2004, 04:57 AM
Hello there
I am new to Laszlo, just found out about the product after it was open sourced. Great work guys!

I have successfull deployed it (lps-2.2-core) on Jboss 3.2.5. I have not tested the Krank feature, but to me it seems like an unexpanded war, a war expaned directly in the deployment directory or a war expanded in the deployment directory + 'webapps' works the same way.
Problem is that Laszlo displays no images that (I'm guessing here) are not compiled into the application. For instance, the Amazon demo works fine, but there are no images, and the ImageLoader demo shows only the compiled images.

Does anyone have an idea about this? Thanks a lot!
Regards
Trygve

dybomaha
10-08-2004, 05:00 AM
I have not tried lps-2.2 under JBoss 3.2.5 yet, what platform are you using?

DYBOMAHA

dybomaha
10-08-2004, 05:56 AM
OK, I tried the process under Linux and it does work.

First, it's better to stop JBoss. The hot deployer does not like some things about the Laszlo files, so it always works better to stop JBoss.

Then, make sure you have a webapps directory:


{jboss-3.2.5 home}/server/default/deploy/webapps


Get rid of any other versions of Laszlo lps that you may have in there! They WILL interfere with each other.

I used the LPS 2.2 core files and copied them to the webapps directory.


tar xvfz lps-2.2-core.tar.gz
cd lps-2.2-core

mv lps-2.2/ {jboss-3.2.5 home}/server/default/deploy/webapps/lps-2.2.war


Make sure that the directory is named lps-2.2.war as shown above. This does not mean that lps-2.2 should be archived into a war file, it means that the directory is just named "lps-2.2.war" to work with JBoss.

Now, start JBoss, and you should get the message towards the last part of startup that LPS was deployed.

08:27:24,673 INFO [TomcatDeployer] deploy, ctxPath=/lps-2.2, warUrl=file:/opt/jboss/jboss-3.2.5/server/default/deploy/webapps/lps-2.2.war/

Now, you should be able to point your browser to http://yourserver:8080/lps-2.2/.

Also, there are some notes about setting up logging correctly. JBoss has log4j already inside it, but I have not configured logging yet for this installation, but it will still work fine anyway.

I will have some time to try it under Windows on Monday, but I expect that it will work just fine there as well.

Once everything was wroking, I got the following message from the JBoss console:


08:28:07,172 INFO [Engine] StandardContext[/lps-2.2]LPS: LPS_HOME is /opt/jboss/jboss-3.2.5/server/default/deploy/webapps/lps-2.2.war
08:28:07,202 INFO [Engine] StandardContext[/lps-2.2]LPS: LPS config directory is: /opt/jboss/jboss-3.2.5/server/default/deploy/webapps/lps-2.2.war/WEB-INF/lps/config
08:28:07,289 INFO [Engine] StandardContext[/lps-2.2]LPS: Detailed LPS log is at /opt/jboss/jboss-3.2.5/server/default/deploy/webapps/lps-2.2.war/WEB-INF/lps/work/logs/lps.log
08:28:07,289 INFO [Engine] StandardContext[/lps-2.2]LPS: LPS log configured with /opt/jboss/jboss-3.2.5/server/default/deploy/webapps/lps-2.2.war/WEB-INF/lps/config/lps.xml
08:28:07,290 INFO [Engine] StandardContext[/lps-2.2]LPS: ------------------------------------
08:28:07,294 INFO [Engine] StandardContext[/lps-2.2]LPS: Laszlo Presentation Server, 2.2, initialized
08:28:07,295 INFO [Engine] StandardContext[/lps-2.2]LPS: Running in context:Apache Tomcat/5.0.26
08:28:07,295 INFO [Engine] StandardContext[/lps-2.2]LPS: Build: lps-2.2-001144-0001
08:28:07,295 INFO [Engine] StandardContext[/lps-2.2]LPS: Built on: 07:57 PM 04-Oct-2004
08:28:07,296 INFO [Engine] StandardContext[/lps-2.2]LPS: Running against JRE 1.4.2_05
08:28:07,296 INFO [Engine] StandardContext[/lps-2.2]LPS: Running with Java CLASSPATH: /opt/jboss/jboss-3.2.5/bin/run.jar:/opt/sun-jdk-1.4.2.05/lib/tools.jar
08:28:07,296 INFO [Engine] StandardContext[/lps-2.2]LPS: Running on Linux 2.6.8-gentoo-r5
08:28:07,296 INFO [Engine] StandardContext[/lps-2.2]LPS: Running as user -----
08:28:07,302 INFO [Engine] StandardContext[/lps-2.2]LPS: Max memory: 506.31 MB
08:28:07,302 INFO [Engine] StandardContext[/lps-2.2]LPS: Total memory: 126.75 MB
08:28:07,303 INFO [Engine] StandardContext[/lps-2.2]LPS: Available memory: 92.16 MB


You can see from the output that there is a lot of memory allocated, which you can control with your JBoss "run" script:


# Setup JBoss sepecific properties
#JAVA_OPTS="$JAVA_OPTS -Dprogram.name=$PROGNAME"
JAVA_OPTS="$JAVA_OPTS -Dprogram.name=$PROGNAME -Xms128m -Xmx512m"


If you modify the above code in your "run.sh" or "run.bat", JBoss will allocate more memory at startup. Just search for the instance of JAVA_OPTS with the comment as shown above, it's at line 141 in my "run.sh" file. The change is the same for both the BAT file or the SH file.

DYBOMAHA

milx
10-08-2004, 10:38 AM
Thanks for the answer, OS in Windows. As I pointed out, the was only a problem with images. Since I tested Laszlo on a Jboss installation with many non-standard libraries, I tried on a clean install, and everything worked fine. I then redeployed from a clean Laszlo distribution to the dependent server, and now it works there to. Problem migth have been that I created a war form the Laszlo distribution the first time I deployed it, and later expanded it manually. Anyway, it works now, time to play!
Regards
Trygve