Rami,

I've been trying to reproduce the stack trace you saw.  (Note: we always like a 
test case so we can be assured we really fix something when we make a change).

>> 
>> 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
>> or when linking to the source code of the library.


In this one, you say you've installed an lzo in lps/components.  Here's what I 
have:

LPP-10066-lzo.lzx:
<library>
   <class name="class1">
      <view bgcolor="0xFF33AA" width="200" height="50" />
   </class>
</library>

LPP-10066.lzx:
<!-- -->
<canvas>
  <include href="LPP-10066-installed-lzo.lzx"/>
  <simplelayout axis="y" spacing="10"/>
  <class1/>
  <class1/>
</canvas>

How to compile/run:

cd $LPS_HOME/test      # this is where my source files are
rm -f $LPS_HOME/lps/components/LPP-10066*.lzo
lzc -c --runtime=swf10,dhtml --dir $LPS_HOME/lps/components ./LPP-10066-lzo.lzx
ls -l $LPS_HOME/lps/components/LPP-10066-lzo.lzo
# I rename it, to make sure the compiler really finds the installed file
# (I tested it the other way, without renaming, too).
mv $LPS_HOME/lps/components/LPP-10066-lzo.lzo 
$LPS_HOME/lps/components/LPP-10066-installed-lzo.lzo
lzc --runtime=swf10 --output LPP-10066.swf ./LPP-10066.lzx 

I get no errors in compilation, I can load LPP-10066.lzx successfully, I can 
modify the library file and build it and 'install' it (rename it as above) and 
see the changes I made.

Do you have any ideas how to trigger the error you saw?
(This JIRA is being tracked as http://jira.openlaszlo.org/jira/browse/LPP-10066 
-- you can respond there, or just reply to this message)

Thanks!

- Don


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

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





Reply via email to