PDA

View Full Version : LZX Files not found in installation


rbrown3
10-30-2004, 08:46 PM
Greetings:

I have developed a small Laszlo- based application and I am trying to work out some deployment issues. To that end, I have installed the Laszlo core onto Tomcat 5 (5.0.24).

I followed the installation instructions provided in the Laszlo "documentation" to the letter. I have an lps-2.2 directory under Tomcat's "webapp" directory; this directory contains the entire core installation (as instructed). I have another directory under webapps called "projman" which contains some JSPs and an lZX file that I am testing. This file is the app I sm testing. The web.xml file has the appropriate changes, and the lps subdirectory, with all of its contents, has been copied into projman (as instructed in the "documentation").

Unfortunately, when I run Tomcat and attempt to display the LZX file, I am getting the following error message:

Compilation Errors
ProjmanAdmin.lzx:3:50: file not found: lz/button.lzx

The file in question that is not being found actually exists within the lps-2.2 servlet directory (the exact pathname is tomcat\webapps\lps-2.2\lps\components\lz). It is obvious to me that somehow the Laszlo servlet is failing to look in its own component directory when attempting to use components specified in an LZX file (unless I am mistaken, button.lzx is the file containing the code for the standard button class).

I did try copying the subdirectories under "components" into my projman directory, hoping that that would enable Laszlo to fing the button.lzx file. This worked -- except that the Laszlo servlet failed to find the files for the button's parent class -- even though those files were also copied into projman!

Apparently the Laszlo system, when compiling LZX files, is programmed to look in a specific place for the components it needs to load and run the LZX files -- and it is looking in the wrong place. The question, of course, is: is there a way to make it look in the *right* place???

I have gone through these forums, only to discover that there are others who are having/have had similar problems. I have not yet seen anyone give a real solution to this problem.

Without such a solution, Laszlo is, at best, a nice toy that can only run under very specific circumstances and under a very specific environment. If this is true, then as far as I am concerned it is not useable for real world applications, regardless of how spiffy and impressive the demos are.

Is there a way to make this system find its required component files? Or am I going to have to look elsewhere for a decent rich- client solution?

bloch
10-30-2004, 08:59 PM
You're running into a "bug" in the current docs.

See

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

and

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

for how to make a minimal 2.2 laszlo-enabled web application (it doesn't include instructs on making web.xml, but most folks who are attempting this probably know precisely what to do... it's not that complicated). FYI, these instructions have been added to the 2.2.1 developers guide that is due out real soon now.



FYI, the 2.x Laszlo compiler will look by default in

current directory of the application, $WEBAPP_HOME/lps/components and
$WEBAPP_HOME/lps/fonts


-Eric

rbrown3
10-30-2004, 09:43 PM
Greetings, Eric:

Thanks for the (unusually swift) reply.

I have checked the links you referred to. With respect, they do not answer my question or provide any solution to my problem.

Both links tell what to remove from under lps-2.2/lps if you want a minimul install of the Laszlo core. They tell, primarily, what to remove from the lps and components directory, particularly if you want to secure your installation.

This is useful information, granted, and I will use it once I am ready to start removing unneeded files from my installation. Unfortunately, this information does *not* explain why my installation is not finding the component files that reside in the lps directory. Assuming that placing the lps-2.2 stuff under Tomcat's webapps directory is not the documentation bug you were referring to, then it doesn't matter what I removed (or didn't remove) from lps-2.2/lps: the fact is, for some reason the servlet is not finding the contents of the components directory that resides under lps-2.2/lps. I need to know why this is not happening so I can run my LZX applications.

The most useful info was the search information you gave was the information on where the Laszlo compiler looks for components by default. A question: is the $WEBAPP_HOME variable you are referring to the actual webapps directory under Tomcat, the lps-2.2 directory, or the root directory of my web application? Or is it something else? In other words, where exactly does my components directory need to be?

I do not believe that my Tomcat installation is using WEBAPP_HOME (I actually have several Tomcat installations; I don't think I set that variable for any of them). If this is a variable to set, where do I set it?

Again: thanks for the quick response, but based on the links you provided what I have, while containing several unneeded directories, should actually work! That it doesn't means that some information is incomplete. I need to complete that information in order to get this thing in a deployable state.

bloch
10-30-2004, 10:51 PM
You can turn on DEBUG logging and look to see how the compiler's file resolver is resolving files during a compile.


Did you copy both the lps and WEB-INF/lps pieces?

You need to have those in your projman webapp (your posting was unclear on how you constructed that webapp).

Perhaps it's a permissions issue, too.

----



edit .../WEB-INF/lps/config/lps.xml and turn INFO to DEBUG and restart the webapp/server.

Then look in .../WEB-INF/lps/work/logs/lps.log

$WEBAPP_HOME was my shorthand here... neither the LPS nor TOMCAT have such a variable.

If you're stuck, then simply add your bits into the working lps-2.2 webapp and voila, you're done.

Good luck,
Eric

d~l
10-31-2004, 01:23 AM
to add to the above advice on tracking where the compile process is failing .. in addition to using DEBUG .. download and install FileMon (http://www.sysinternals.com) and keep it running in background to detect files not found or failed paths.

Search the forum .. keyword=filemon .. to see how to setup the filemon include and exclude filters.

Include filter = tomcat

rbrown3
11-01-2004, 09:46 AM
Greetings:

To answer the installation questions and describe what went wrong, let me document what I did.

As stated, I followed the instructions for setting up an application for use with the Laszlo core to the letter. The instructions used were those given in the Documentation->Installation tab under Laszlo Explorer. Since I was going to be using the Laszlo Core, I looked at the instructions titled "Installing the Core LPS Only" and "Running the Core LPS Only".

The installation of the Core was straightforward. Everything under and including the lps-2.2 directory needed to be deployed to the "webapps" directory under Tomcat. This was done without incident.

Setting up and running my applications was a different story. I followed the instructions given within the chapter titled "Running your own Laszlo applications" on the "Running the Core LPS Only" page, to wit:

1. Create a new directory for your application
2. In this new directory, create a subdirectory called WEB-INF.
3. Copy the lib and lps directories and web.xml file from the LPS web application directory into your web application. These files can be found at

yourInstallationDir\lps-2.2\WEB-INF (Windows)
yourInstallationDir/lps/lps-2.2/WEB-INF (Linux, OS-X)

Copy them into your application's WEB-INF directory. If your application already has a web.xml file, you will need to merge the contents of the lps-2.2 web.xml with your web.xml.

4. Put the .lzx files and art assets that make up your application inside the new directory you created, or put them into a subdirectory you create inside of it.
5. Consult your servlet container documentation for information about how to deploy this Web application into the container. For Tomcat, you can simply copy this directory into

tomcatInstallationDirectory\webapps\your-application-dir (Windows)
tomcatInstallationDirectory/webapps/your-application-dir (Linux, OS-X)

Please note, concerning Step 3: my application is intended to test the use of Laszlo with the Struts Framework, so I already had a standardized web.xml file containing references to the Struts Action Servlet, as well as several TLDs for the various Struts tags. In order to prepare this application for incorporating Laszlo, I added the following to my web.xml file:

<servlet>
<servlet-name>LPS</servlet-name>
<servlet-class>com.laszlosystems.servlets.LZServlet</servlet-class>
</servlet>

and:

<servlet-mapping>
<servlet-name>LPS</servlet-name>
<url-pattern>*.lzx</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>LPS</servlet-name>
<url-pattern>*.lzo</url-pattern>
</servlet-mapping>

What I did *not* do, what Eric advised and what the instructions failed to mention, was to add the lps directory (and its contents) to my application directory.

Note that in the instructions, you are told to copy the lib and lps directories under lps-2.2\WEB-INF
(on Windows) to your application's WEB-INF directory. The instructions fail to mention adding the lps directory under lps-2.2 to your application's directory. Eric's last posting mentioned the need to do this.

Once I did so, my Laszlo application worked without problems (except for a few memory problems which I easily solved by adding arguments to my JVM).

Consequently, the *complete* instructions should be as follows:

1. Create a new directory for your application
2. In this new directory, create a subdirectory called WEB-INF.
3. Copy the lib and lps directories and web.xml file from the LPS web application directory into your web application. These files can be found at

yourInstallationDir\lps-2.2\WEB-INF (Windows)
yourInstallationDir/lps/lps-2.2/WEB-INF (Linux, OS-X)

Copy them into your application's WEB-INF directory. If your application already has a web.xml file, you will need to merge the contents of the lps-2.2 web.xml with your web.xml.

4. Copy the contents of the lps directory under lps-2.2 to your application directory. Under Tomcat, this means copying lps-2.2\lps to tomcatInstallationDirectory\webapps\your-application-dir

5. Put the .lzx files and art assets that make up your application inside the new directory you created, or put them into a subdirectory you create inside of it.

6. Consult your servlet container documentation for information about how to deploy this Web application into the container. For Tomcat, you can simply copy this directory into

tomcatInstallationDirectory\webapps\your-application-dir (Windows)
tomcatInstallationDirectory/webapps/your-application-dir (Linux, OS-X)

That should enable you to run your application without worrying about "file not found" errors.

Eric: could this be the "bug" in the documentation that you were talking about?

In any event, I eagerly await the new version of the documentation, hoping that this oversight will be addressed. Until then, this posting will hopefully help others who are having deployment problems.

Thanks, Eric, for your assisance.

Oh, by the way: so far it looks like Laszlo applications can be integrated smoothly into Struts applications. This is a good thing, since the combination of these technologies will be extremely powerful. I have a lot more experimenting to do, though, so the jury is still out. Those interested in following my experiments, please let me know. I will start a new Topic describing my progress in this area...

bloch
11-01-2004, 01:40 PM
Eric: could this be the "bug" in the documentation that you were talking about?

yes :-)

-Eric

d~l
11-02-2004, 01:17 AM
also .. copy jing.jar into %TOMCAT_HOME%\common\lib\

jogorman
11-03-2004, 06:56 AM
Thanks to all the posters who contributed to my resolution of my problem.

Just so everyone knows where I went with this, here's a synopsis.

The first time I downloaded the Presentation Server, it took nearly 4 hours! I just put that down to the fact that I am on dialup, but I think there was something else going on.

When I started having trouble, as you all know, I posted several (sometimes not very complimentary) posts here, and I tried to move some of the files around to see if the lps could resolve some its file not found errors with no luck.

Yesterday, I removed the entire pacakage, and started to reload. I had the same slow download going, when I received an NSIS error. It suggested I might have a corrupt disk or a download virus. I did a complete scan of my system for spyware and viruses, and it found - among other things - a download.trojan virus.

After I got everything cleaned up, I decided to try downloading again, but this time overnight. I went into the download page of laszlo, did all the requisite acceptances, and clicked the 'Download' button. The 104 MB file loaded in about 2 minutes! I was stunned. I installed it in the default directory, and voila!! I am operational! I didn't touch anything else, so as far as I know, all of the files are in their rightful place.

Thanks again everyone, and if something was changed on the Laszlo end to make this all happen, then bless you one and all.

bloch
11-04-2004, 07:57 AM
also .. copy jing.jar into %TOMCAT_HOME%\common\lib\


FYI, this is only necessary in certain containers. In general, it's not needed in Tomcat 4 or 5, afaik.

It has been required in version of Resin 3.0.x.

-Eric