Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[m2t-dev] Run a template from java error

Hi,
 I am using jet to generate code from a xml model.
 I have created a JET transformation project , then coded my own jet template and xml model , then new a JET transformation and run it successfully.

Now, in order to abtain more flexibilities, I want to run the jet template from java. I
have read the JET FAQ "M2T-JET-FAQ/How do I run a JET template from Java?" , 
url:http://wiki.eclipse.org/M2T-JET-FAQ/How_do_I_run_a_JET_template_from_Java%3F

Based on the discription of this faq,  I invoke the JET API in my java class.
First, I create a eclipse plugin project(not jet transformation project),  and config it depends jet plugins
, then code some java class to invoke jet API directly.But I got the following error:

Exception in thread "main" java.lang.NullPointerException
	at org.eclipse.jet.taglib.TagLibraryManager.getTagLibrary(TagLibraryManager.java:89)
	at org.eclipse.jet.internal.runtime.TagFactoryImpl.createRuntimeTag(TagFactoryImpl.java:61)
	at com.neusoft.unieap.dc.jet.domain.DomainMainTemplate.generate(DomainMainTemplate.java:83)
	at test.JETTest.transformation4DO(JETTest.java:30)
	at test.JETTest.main(JETTest.java:19)

I search some information about the error and read a mail ,url:
http://dev.eclipse.org/newslists/news.eclipse.technology.emft/msg01659.html
http://dev.eclipse.org/newslists/news.eclipse.technology.emft/msg01743.html
The response is "Looking at your stack trace, it seems you are trying to run an EMFT JET 
template directly from a Java program (Transform.main()). EMFT JET doesn't 
work that way...."	

Now, I confused:
1 Can I run a run jet template from java? Or from a eclipse plugin project?
2 If it's ok, how to resolve the problem?

Thanks a lot.	
--------------
Frank
2009-08-13

---------------------------------------------------------------------------------------------------
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) 
is intended only for the use of the intended recipient and may be confidential and/or privileged of 
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is 
not the intended recipient, unauthorized use, forwarding, printing,  storing, disclosure or copying 
is strictly prohibited, and may be unlawful.If you have received this communication in error,please 
immediately notify the sender by return e-mail, and delete the original message and all copies from 
your system. Thank you. 
---------------------------------------------------------------------------------------------------

Back to the top