ClassCast exception during JET transformation! [message #53460] |
Fri, 28 November 2008 15:40 |
cyril Messages: 4 Registered: July 2009 |
Junior Member |
|
|
Dear all,
1°) I have developed an eclipse plugin which lets create a J2EE project
(ear + web project) customized with my company's framework.
I do it at the end of the Wizard page , in the performFinish method, by
creating an ecore model with all the informations collected in the
previous wizards ,
saving it into an xml file, and operating a JET transformation on it.
This is the utility method used at this aim, to be clear a call to
JET2Platform.runTransformOnResource(transformId, aModel, aMonitor):
public static void execute (IFile aModel, IProgressMonitor aMonitor)
throws CoreJETException, IOException {
String transformId = ISphinxUIConstants.SPHINX_JET_PLUGIN_ID;
if(transformId == null) {
throw new IllegalArgumentException( "pas de transformId"); //$NON-NLS-1$
}
if(JET2Platform.getJETBundleManager().getDescriptor(transfor mId)
== null) {
throw new IllegalArgumentException("transform id non valide");
}
final IStatus result = JET2Platform.runTransformOnResource(transformId,
aModel, aMonitor);
if(!result.isOK()) {
throw new IllegalArgumentException(result.getMessage());
}
2°) now i want to only execute the jet transformation on the model inside
RSA7 via right-click and execute JET transformation or with the
<jet-transform> ant task
<!-- =================================
target: default
================================= -->
<target name="jet-transformation" depends="depends" description="Runs
JET transformation on JET Model">
<jet.transform
transformid="com.natixis.sphinx.ide.eclipse.codegen"
source="WizAnt/src/model.xml" />
</target>
Here's the problem: every time i execute the JET transformation by either
way - right-click or ant task execution - i receive the following error:
!STACK 0
java.lang.ClassCastException:
org.eclipse.emf.ecore.xml.type.impl.AnyTypeImpl incompatible with
com.natixis.sphinx.ide.eclipse.codegen.emf.Racine
at org.eclipse.jet.compiled._jet_main.generate(Unknown Source)
It means that the in the deserialisation of such JET code:
Racine lRacine = (Racine) context.getVariable("root");
the JET engine isn't able to give me the correct object with correct type.
My xml with the targetNamespace
urn:com:natixis:sphinx:ide:eclipse:codegen:emf:Racine :
<sxgcm:Racine
xmlns:sxgcm="urn:com:natixis:sphinx:ide:eclipse:codegen:emf:Racine "
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:namespaceSchemaLocation="schema.xsd">
and the correct mapping in the EPackage ecore model:
public interface InputSchemaPackage extends EPackage {
/**
* The package name.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
String eNAME = "com.natixis.sphinx.ide.eclipse.codegen.emf";
/**
* The package namespace URI.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
String eNS_URI = "urn:natixis:sphinx:gencode:model:1.0";
/**
* The package namespace name.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
String eNS_PREFIX = "sxgcm";
Do you have any ide of the damned problem?
Thanks a lot in advance!
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04242 seconds