Menu:

Sponsor

Discover Master of Alchemy, our first iPad/iPhone and iPod touch game!

Follow Me

 

Forum's topics

Latest Files

Archives

Top Rated

Categories

Photo Gallery


Alessandro Crugnola on March 18, 2007 in flex

mxmlc NullPointerException crash

Today I was getting crazy to find out why Flex didn't want to compile my application.. Clicking on compile it started suddenly to give me an internal compile error and nothing else. So i tried to compile with the mxmlc from a console just to see the error log and the outpuw was:

java.lang.NullPointerException
        at macromedia.asc.semantics.FlowAnalyzer.evaluate(FlowAnalyzer.java:891)
        at macromedia.asc.parser.BinaryExpressionNode.evaluate(BinaryExpressionNode.java:38)
        at macromedia.asc.semantics.FlowAnalyzer.evaluate(FlowAnalyzer.java:890)
        at macromedia.asc.parser.BinaryExpressionNode.evaluate(BinaryExpressionNode.java:38)
        at macromedia.asc.semantics.FlowAnalyzer.evaluate(FlowAnalyzer.java:891)
        at macromedia.asc.parser.BinaryExpressionNode.evaluate(BinaryExpressionNode.java:38)
        at macromedia.asc.semantics.FlowAnalyzer.evaluate(FlowAnalyzer.java:890)
        at macromedia.asc.parser.BinaryExpressionNode.evaluate(BinaryExpressionNode.java:38)
        at macromedia.asc.semantics.FlowAnalyzer.evaluate(FlowAnalyzer.java:962)
        at macromedia.asc.parser.ListNode.evaluate(ListNode.java:27)
        at macromedia.asc.semantics.FlowAnalyzer.evaluate(FlowAnalyzer.java:5859)
        at macromedia.asc.parser.LiteralXMLNode.evaluate(LiteralXMLNode.java:28)
        at macromedia.asc.semantics.FlowAnalyzer.evaluate(FlowAnalyzer.java:3087)
        at macromedia.asc.parser.VariableBindingNode.evaluate(VariableBindingNode.java:48)
        at macromedia.asc.semantics.FlowAnalyzer.evaluate(FlowAnalyzer.java:962)
        at macromedia.asc.parser.ListNode.evaluate(ListNode.java:27)
        at macromedia.asc.semantics.FlowAnalyzer.evaluate(FlowAnalyzer.java:2897)
        at macromedia.asc.parser.VariableDefinitionNode.evaluate(VariableDefinitionNode.java:32)
        at macromedia.asc.semantics.FlowAnalyzer.evaluate(FlowAnalyzer.java:4629)
        at macromedia.asc.parser.ClassDefinitionNode.evaluate(ClassDefinitionNode.java:86)
        at macromedia.asc.semantics.FlowAnalyzer.evaluate(FlowAnalyzer.java:938)
        at macromedia.asc.parser.ArgumentListNode.evaluate(ArgumentListNode.java:28)
        at macromedia.asc.semantics.FlowAnalyzer.evaluate(FlowAnalyzer.java:750)
        at macromedia.asc.parser.SetExpressionNode.evaluate(SetExpressionNode.java:39)
        at macromedia.asc.semantics.FlowAnalyzer.evaluate(FlowAnalyzer.java:580)
        at macromedia.asc.parser.MemberExpressionNode.evaluate(MemberExpressionNode.java:31)
        at macromedia.asc.semantics.FlowAnalyzer.evaluate(FlowAnalyzer.java:1273)
        at macromedia.asc.parser.ExpressionStatementNode.evaluate(ExpressionStatementNode.java:33)
        at macromedia.asc.semantics.FlowAnalyzer.evaluate(FlowAnalyzer.java:4407)
        at macromedia.asc.parser.ClassDefinitionNode.evaluate(ClassDefinitionNode.java:86)
        at macromedia.asc.semantics.FlowAnalyzer.evaluate(FlowAnalyzer.java:2577)
        at macromedia.asc.parser.ProgramNode.evaluate(ProgramNode.java:63)
        at flex2.compiler.as3.Compiler.analyze2(Compiler.java:436)
        at flex2.compiler.mxml.InterfaceCompiler.analyze2(InterfaceCompiler.java:337)
        at flex2.compiler.mxml.Compiler.analyze2(Compiler.java:130)
        at flex2.compiler.API.analyze(API.java:2360)
        at flex2.compiler.API.analyze(API.java:2275)
        at flex2.compiler.API.batch2(API.java:337)
        at flex2.compiler.API.batch(API.java:1025)
        at flex2.compiler.API.compile(API.java:1211)
        at flex2.compiler.API.compile(API.java:1114)
        at flex2.tools.Compiler.main(Compiler.java:222)

Wow!!
So, how can I find the problem? I can't find any useful information from this log..
For this reason I had to remove portion of code from my mxml and from all the imported packages.. 2 hours of "debugging" gave me the solution!

A syntax error in a declaration of an XMLList was the problem!  Fixed the line also the compiler started to run again with no problems.

This is a portion of mxml code to reproduce the problem:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
	<![CDATA[
	private var uuid:String = "";
	private var menubarXML:XMLList =
		 <>
			  <menuitem data=uuid>
			  </menuitem>
		 </>;
	]]>
</mx:Script>
</mx:Application>

 

Bookmark and Share

 

 

2 comments
It's a crazy really but, you can do this
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
	<![CDATA[
        
	private var uuid:String = "";
        [Bindable]
	private var menubarXML:XMLList =
		 <>
			  <menuitem data=uuid>
			  </menuitem>
		 </>;
	]]>
</mx:Script>
</mx:Application>
It will works, since once this error already took other on other blog I read. but it was on Java world.
It'll sometimes report an internal build error if you use [Bindable] and the line before doesn't have a ";" at the end of it. Never been so far as to check the Java stack .


Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)


Type the characters you see in the picture above.





 

TrackBacks

TrackBack URL for this entry: http://www.sephiroth.it/cgi-bin/mt/mt-tb.cgi/195