Hi Donald,

Here I present the simplest possible testcase.

Create mytext.lzx
<library>
<class name="mytext" extends="text">
<attribute name="text" value="Hello World!"/>
</class>
</library>

Then create index.lzx that uses the previous class
<canvas>
<include href="mytext.lzx"/>
<mytext/>
</canvas>

Now compile

lzc --dir somewhere --output index.swf index.lzx

All is fine and works as expected.
Now let's compile mytext.lzx into lzo library
(using also -a switch)

lzc -c -a --dir laszlo_home/lps/components --output mytext.lzo mytext.lzx

Now we have laszlo_home/lps/components/mytext.lzo
as expected.

Then let's try to compile index.lzx against that library.
Change index.lzx to:
<canvas>
<include href="mytext.lzo"/>
<mytext/>
</canvas>

and run
lzc --dir somewhere --output index.swf index.lzx

And that's when you should be getting the error I reported.

- rami

On 09/09/2011 07:25 PM, Donald Anderson wrote:
Hi Rami,

Sorry for the late reply. This is being tracked in JIRA: http://jira.openlaszlo.org/jira/browse/LPP-10066

I haven't seen this, and I'm not aware of any recent changes to the compiler in that area. I just ran the lzunit test suite ('ant runlzunit' from the top level). That does several lzo compilations and linking
against them in various combinations, and that ran clean.

I have not tried putting an lzo file into lps/components, perhaps that is confusing things.

Any chance you could put together a test case that fails this way? Including steps to compile it, move it, link against it?

Thanks!

- Don

On Sep 5, 2011, at 6:23 AM, Rami Ojares / AMG wrote:

Hi,

Now I started getting the following error

Exception in thread "main" java.lang.NullPointerException
at org.openlaszlo.compiler.CompilationEnvironment.addLZOFile(CompilationEnvironment.java:308) at org.openlaszlo.compiler.DefaultFileResolver.resolveInternal(FileResolver.java:206) at org.openlaszlo.compiler.DefaultFileResolver.resolve(FileResolver.java:110)
   at org.openlaszlo.compiler.Parser.expandIncludes(Parser.java:646)
   at org.openlaszlo.compiler.Parser.readExpanded(Parser.java:418)
   at org.openlaszlo.compiler.Parser.parse(Parser.java:707)
   at org.openlaszlo.compiler.Compiler.compile(Compiler.java:386)
   at org.openlaszlo.compiler.Compiler.compile(Compiler.java:208)
   at org.openlaszlo.compiler.Main.compile(Main.java:399)
   at org.openlaszlo.compiler.Main.lzc(Main.java:339)
   at org.openlaszlo.compiler.Main.main(Main.java:105)

This happens when linking against my own lzo library that is located at lps/components

The method where the npe occurs looks like this

public void addLZOFile(File lzo) {
   getGenerator().addLZOFile(lzo);
}

So it must be the getGenerator that returns null.

SWF writer that compilation within this
* environment writes to.
* @return the object writer
*/
ObjectWriter getGenerator() {
   return mObjectWriter;
}

so mObjectWriter is somehow null.
This problem does not arise when compiling the library.

Was this caused by some recent change or something?

- rami



--

Don Anderson
Java/C/C++, Berkeley DB, systems consultant

voice: 617-306-2057
email: [email protected] <mailto:[email protected]>
www: http://www.ddanderson.com <http://www.ddanderson.com/>
blog: http://libdb.wordpress.com






Reply via email to