You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by Lin Sun <li...@gmail.com> on 2006/03/09 19:53:52 UTC

valid XML checking

Hi there,

 

I've spent quite some time trying to get the MDB sample
(http://opensource2.atlassian.com/confluence/oss/display/GERONIMO/JBoss+to+G
eronimo+-+EJB-MDB+Migration) deployed using the eclipse plugin.   I was able
to get it running eventually but I had to spend extra time in modifying the
deployment plan to bypass the valid XML checking.   The extra editing is are
not needed if I use the command line deployer or admin console.

 

The problem is that the plugin checks the deployment plan very strictly.  I
have to use fully qualified elements, otherwise the plans are not treated as
valid xmls, and the model editor will not be able to parse the resource and
throws exception in the eclipse log.

 

For example:  the following is not treated as valid Geronimo deployment plan
in eclipse environment.   But the command line deployer or admin console
likes it:

 

  <ejb-ref>

    <ref-name>ejb/CustomerHome</ref-name>

    <target-name>

 
geronimo.server:EJBModule=MDBDemo,J2EEApplication=null,J2EEServer=geronimo,j
2eeType=EntityBean,name=CustomerEJB

   </target-name>

  </ejb-ref>

 

I had to change it to the following just for Eclipse environment.
(xmlns:nam=http://geronimo.apache.org/xml/ns/naming-1.0
<http://geronimo.apache.org/xml/ns/naming-1.0_>  is specified earlier in the
plan)

 

  <nam:ejb-ref>

    <nam:ref-name>ejb/CustomerHome</nam:ref-name>

    <nam:target-name>

 
geronimo.server:EJBModule=MDBDemo,J2EEApplication=null,J2EEServer=geronimo,j
2eeType=EntityBean,name=CustomerEJB

    </nam:target-name>

  </nam:ejb-ref>

 

Ideally, we don't want users to perform such extra efforts while porting
their Geronimo specific plans in eclipse.   I am not sure what can be done
in the plugin code to perform a loose XML checking. it seems to use the
WTP/pre-requisites' code to perform the XML checking.   Thoughts?

 

Thanks, 

 

Lin

 


Re: valid XML checking

Posted by Sachin Patel <sp...@gmail.com>.
David, you bring up a good point on wether or not to save the  
converted version.  Currently the serialized version is fully  
qualified but I think we could provide a way for the editors to  
create and open up a converted in-memory only version of the plan and  
the serialized version would always remain unqualified.  The thing  
I'm not quite sure about is how to convert from the in-memory copy  
back to unqualified form.

- sachin


On Mar 9, 2006, at 7:02 PM, Sachin Patel wrote:

> I'm already doing this on importing applications. Non-qualified  
> plans can be imported, and I run the conversion to make it a valid  
> doc so that the EMF models can process it.  Once its processed and  
> the namespaces have been entered from that point forward you have  
> to use qualified elements if you're modifying the resource via the  
> Text/XML editor otherwise you invaliding the document and thus the  
> editors can be opened against it.
>
> I may be able to put in a hook to always run SchemaConverstionUtils  
> on opening the editor which would resolve the problem.  Go ahead  
> and open a defect.  But if you put unqualified elements and run the  
> WTP xml validator its going to fail since technically it is an  
> invalid document.  I could add a ResourceChangeListener or Builder  
> as well which would help as well.
>
> But the "real solution" will be for users not have to modify the  
> xml at all and there needs to be a complete set of deployment plan  
> editors.  I've been very behind on this effort, what would help  
> would be if someone could mock up how they wanted things to be  
> layed out in the editors and then I could get it done much quicker.
>
> - sachin
>
>
>
> On Mar 9, 2006, at 2:59 PM, David Jencks wrote:
>
>> The builders all run plans through SchemaConversionUtils to  
>> install the correct namespaces.  Is there some way to get eclipse  
>> to do that?
>>
>> I don't know if it would be a good idea to then save the converted  
>> version.
>>
>> thanks
>> david jencks
>>
>> On Mar 9, 2006, at 10:53 AM, Lin Sun wrote:
>>
>>> Hi there,
>>>
>>>
>>> I’ve spent quite some time trying to get the MDB sample (http:// 
>>> opensource2.atlassian.com/confluence/oss/display/GERONIMO/JBoss+to 
>>> +Geronimo+-+EJB-MDB+Migration) deployed using the eclipse  
>>> plugin.   I was able to get it running eventually but I had to  
>>> spend extra time in modifying the deployment plan to bypass the  
>>> valid XML checking.   The extra editing is are not needed if I  
>>> use the command line deployer or admin console.
>>>
>>>
>>> The problem is that the plugin checks the deployment plan very  
>>> strictly.  I have to use fully qualified elements, otherwise the  
>>> plans are not treated as valid xmls, and the model editor will  
>>> not be able to parse the resource and throws exception in the  
>>> eclipse log.
>>>
>>>
>>> For example:  the following is not treated as valid Geronimo  
>>> deployment plan in eclipse environment.   But thecommand line  
>>> deployer or admin console likes it:
>>>
>>>
>>>   <ejb-ref>
>>>
>>>     <ref-name>ejb/CustomerHome</ref-name>
>>>
>>>     <target-name>
>>>
>>>        
>>> geronimo.server:EJBModule=MDBDemo,J2EEApplication=null,J2EEServer=ge 
>>> ronimo,j2eeType=EntityBean,name=CustomerEJB
>>>
>>>    </target-name>
>>>
>>>   </ejb-ref>
>>>
>>>
>>> I had to change it to the following just for Eclipse  
>>> environment.  (xmlns:nam=http://geronimo.apache.org/xml/ns/ 
>>> naming-1.0 is specified earlier in the plan)
>>>
>>>
>>>   <nam:ejb-ref>
>>>
>>>     <nam:ref-name>ejb/CustomerHome</nam:ref-name>
>>>
>>>     <nam:target-name>
>>>
>>>        
>>> geronimo.server:EJBModule=MDBDemo,J2EEApplication=null,J2EEServer=ge 
>>> ronimo,j2eeType=EntityBean,name=CustomerEJB
>>>
>>>     </nam:target-name>
>>>
>>>   </nam:ejb-ref>
>>>
>>>
>>> Ideally, we don’t want users to perform such extra efforts while  
>>> porting their Geronimo specific plans in eclipse.   I am not sure  
>>> what can be done in the plugin code to perform a loose XML  
>>> checking… it seems to use the WTP/pre-requisites’ code to perform  
>>> the XML checking.   Thoughts?
>>>
>>>
>>> Thanks,
>>>
>>>
>>> Lin
>>>
>>>
>>>
>>
>


Re: valid XML checking

Posted by Sachin Patel <sp...@gmail.com>.
The code is correct as is.  Even outside of tools applications are  
deployed in two steps, a "distribute" phase and a "start phase".  The  
only fix that that needs to be done is the conversion and beyond that  
the use of an in-memory copy so that the qualified version is never  
seen and only used internally.

- sachin



On Mar 10, 2006, at 12:14 PM, Lin Sun wrote:

> Is there a reason that we do this in two steps (distribute +  
> stop)?  Seems to me that we could consolidate distribute + start  
> into one step deploy and save us the need to get ConfigId of the  
> module.  (I don’t see how users perform distribute applications in  
> eclipse.) If we have to deploy an application in two steps and we  
> need to find the configId of the module to start, maybe we could  
> find a better way to parse the ConfigId value of the Geronimo  
> deployment plans?


RE: valid XML checking

Posted by Lin Sun <li...@gmail.com>.
Seems there are two cases:

1)       Ideally we want to provide a complete set of deployment plan
editors so that users can start building plans from the editor.   Like
Sachin pointed out, this is not complete yet and users will have to use the
text editor to make changes/add additions for now. 

2)       Even when the complete set of deployment plan editor is available,
certain users may still want to use the text editor if they don't like the
GUI or prefer text editor.  

 

For these users, they will not care if the plan will pass the XML checking
done by EMF since they choose to editor it using the text editor.  They just
want to run their applications within the eclipse environment, same as using
the admin console or command line deployer.   Thus, if users use
non-qualified plans (quite likely when they use the text editor), I'd like
to see the eclipse plugin handle it, same as the web console deployer or
command line deployer.    I spent some time going through the plugin
debugger, here's roughly what happens when I remotely deployed the MDB war
file using the plugin:

*      publishModule()

*      doDeploy()

*       ExecuteDistribute includes load file to server, distribute the
module id MDBDemoWebApp

*       Start module.   Failed here at trying to getConfigID of the
targetModule (which is MDBDemoWebApp in my case).  The code was trying to
get the ConfigID from the web deployment plan however the resource was
failed to load due to the fact that the ejb-ref tag within the deployment
plan not recognized as valid by EMF.   On my server, I verified that the
MDBDemoWebApp distributed, but not started.

 

Is there a reason that we do this in two steps (distribute + stop)?  Seems
to me that we could consolidate distribute + start into one step deploy and
save us the need to get ConfigId of the module.  (I don't see how users
perform distribute applications in eclipse.) If we have to deploy an
application in two steps and we need to find the configId of the module to
start, maybe we could find a better way to parse the ConfigId value of the
Geronimo deployment plans?  

 

Thanks, 

 

Lin

-----Original Message-----
From: Sachin Patel [mailto:sppatel2@gmail.com] 
Sent: Thursday, March 09, 2006 7:02 PM
To: dev@geronimo.apache.org
Subject: Re: valid XML checking

 

I'm already doing this on importing applications. Non-qualified plans can be
imported, and I run the conversion to make it a valid doc so that the EMF
models can process it.  Once its processed and the namespaces have been
entered from that point forward you have to use qualified elements if you're
modifying the resource via the Text/XML editor otherwise you invaliding the
document and thus the editors can be opened against it.  

 

I may be able to put in a hook to always run SchemaConverstionUtils on
opening the editor which would resolve the problem.  Go ahead and open a
defect.  But if you put unqualified elements and run the WTP xml validator
its going to fail since technically it is an invalid document.  I could add
a ResourceChangeListener or Builder as well which would help as well.

 

But the "real solution" will be for users not have to modify the xml at all
and there needs to be a complete set of deployment plan editors.  I've been
very behind on this effort, what would help would be if someone could mock
up how they wanted things to be layed out in the editors and then I could
get it done much quicker.

 

- sachin

 





 

On Mar 9, 2006, at 2:59 PM, David Jencks wrote:





The builders all run plans through SchemaConversionUtils to install the
correct namespaces.  Is there some way to get eclipse to do that?

 

I don't know if it would be a good idea to then save the converted version.

 

thanks

david jencks

 

On Mar 9, 2006, at 10:53 AM, Lin Sun wrote:





Hi there,

 

I've spent quite some time trying to get the MDB sample
(http://opensource2.atlassian.com/confluence/oss/display/GERONIMO/JBoss+to+G
eronimo+-+EJB-MDB+Migration) deployed using the eclipse plugin.   I was able
to get it running eventually but I had to spend extra time in modifying the
deployment plan to bypass the valid XML checking.   The extra editing is are
not needed if I use the command line deployer or admin console.

 

The problem is that the plugin checks the deployment plan very strictly.   

 

    <ref-name>ejb/CustomerHome</ref-name>

 
geronimo.server:EJBModule=MDBDemo,J2EEApplication=null,J2EEServer=geronimo,j
2eeType=EntityBean,name=CustomerEJB

  </ejb-ref>

I had to change it to the following just for Eclipse environment.
(xmlns:nam= <http://geronimo.apache.org/xml/ns/naming-1.0_>
http://geronimo.apache.org/xml/ns/naming-1.0 is specified earlier in the
plan)

  <nam:ejb-ref>

    <nam:target-name>

    </nam:target-name>


Re: valid XML checking

Posted by Sachin Patel <sp...@gmail.com>.
I'm already doing this on importing applications. Non-qualified plans  
can be imported, and I run the conversion to make it a valid doc so  
that the EMF models can process it.  Once its processed and the  
namespaces have been entered from that point forward you have to use  
qualified elements if you're modifying the resource via the Text/XML  
editor otherwise you invaliding the document and thus the editors can  
be opened against it.

I may be able to put in a hook to always run SchemaConverstionUtils  
on opening the editor which would resolve the problem.  Go ahead and  
open a defect.  But if you put unqualified elements and run the WTP  
xml validator its going to fail since technically it is an invalid  
document.  I could add a ResourceChangeListener or Builder as well  
which would help as well.

But the "real solution" will be for users not have to modify the xml  
at all and there needs to be a complete set of deployment plan  
editors.  I've been very behind on this effort, what would help would  
be if someone could mock up how they wanted things to be layed out in  
the editors and then I could get it done much quicker.

- sachin



On Mar 9, 2006, at 2:59 PM, David Jencks wrote:

> The builders all run plans through SchemaConversionUtils to install  
> the correct namespaces.  Is there some way to get eclipse to do that?
>
> I don't know if it would be a good idea to then save the converted  
> version.
>
> thanks
> david jencks
>
> On Mar 9, 2006, at 10:53 AM, Lin Sun wrote:
>
>> Hi there,
>>
>>
>> I’ve spent quite some time trying to get the MDB sample (http:// 
>> opensource2.atlassian.com/confluence/oss/display/GERONIMO/JBoss+to 
>> +Geronimo+-+EJB-MDB+Migration) deployed using the eclipse  
>> plugin.   I was able to get it running eventually but I had to  
>> spend extra time in modifying the deployment plan to bypass the  
>> valid XML checking.   The extra editing is are not needed if I use  
>> the command line deployer or admin console.
>>
>>
>> The problem is that the plugin checks the deployment plan very  
>> strictly.  I have to use fully qualified elements, otherwise the  
>> plans are not treated as valid xmls, and the model editor will not  
>> be able to parse the resource and throws exception in the eclipse  
>> log.
>>
>>
>> For example:  the following is not treated as valid Geronimo  
>> deployment plan in eclipse environment.   But thecommand line  
>> deployer or admin console likes it:
>>
>>
>>   <ejb-ref>
>>
>>     <ref-name>ejb/CustomerHome</ref-name>
>>
>>     <target-name>
>>
>>        
>> geronimo.server:EJBModule=MDBDemo,J2EEApplication=null,J2EEServer=ger 
>> onimo,j2eeType=EntityBean,name=CustomerEJB
>>
>>    </target-name>
>>
>>   </ejb-ref>
>>
>>
>> I had to change it to the following just for Eclipse environment.   
>> (xmlns:nam=http://geronimo.apache.org/xml/ns/naming-1.0 is  
>> specified earlier in the plan)
>>
>>
>>   <nam:ejb-ref>
>>
>>     <nam:ref-name>ejb/CustomerHome</nam:ref-name>
>>
>>     <nam:target-name>
>>
>>        
>> geronimo.server:EJBModule=MDBDemo,J2EEApplication=null,J2EEServer=ger 
>> onimo,j2eeType=EntityBean,name=CustomerEJB
>>
>>     </nam:target-name>
>>
>>   </nam:ejb-ref>
>>
>>
>> Ideally, we don’t want users to perform such extra efforts while  
>> porting their Geronimo specific plans in eclipse.   I am not sure  
>> what can be done in the plugin code to perform a loose XML  
>> checking… it seems to use the WTP/pre-requisites’ code to perform  
>> the XML checking.   Thoughts?
>>
>>
>> Thanks,
>>
>>
>> Lin
>>
>>
>>
>


Re: valid XML checking

Posted by David Jencks <da...@yahoo.com>.
The builders all run plans through SchemaConversionUtils to install  
the correct namespaces.  Is there some way to get eclipse to do that?

I don't know if it would be a good idea to then save the converted  
version.

thanks
david jencks

On Mar 9, 2006, at 10:53 AM, Lin Sun wrote:

> Hi there,
>
>
> I’ve spent quite some time trying to get the MDB sample (http:// 
> opensource2.atlassian.com/confluence/oss/display/GERONIMO/JBoss+to 
> +Geronimo+-+EJB-MDB+Migration) deployed using the eclipse plugin.    
> I was able to get it running eventually but I had to spend extra  
> time in modifying the deployment plan to bypass the valid XML  
> checking.   The extra editing is are not needed if I use the  
> command line deployer or admin console.
>
>
> The problem is that the plugin checks the deployment plan very  
> strictly.  I have to use fully qualified elements, otherwise the  
> plans are not treated as valid xmls, and the model editor will not  
> be able to parse the resource and throws exception in the eclipse log.
>
>
> For example:  the following is not treated as valid Geronimo  
> deployment plan in eclipse environment.   But thecommand line  
> deployer or admin console likes it:
>
>
>   <ejb-ref>
>
>     <ref-name>ejb/CustomerHome</ref-name>
>
>     <target-name>
>
>        
> geronimo.server:EJBModule=MDBDemo,J2EEApplication=null,J2EEServer=gero 
> nimo,j2eeType=EntityBean,name=CustomerEJB
>
>    </target-name>
>
>   </ejb-ref>
>
>
> I had to change it to the following just for Eclipse environment.   
> (xmlns:nam=http://geronimo.apache.org/xml/ns/naming-1.0 is  
> specified earlier in the plan)
>
>
>   <nam:ejb-ref>
>
>     <nam:ref-name>ejb/CustomerHome</nam:ref-name>
>
>     <nam:target-name>
>
>        
> geronimo.server:EJBModule=MDBDemo,J2EEApplication=null,J2EEServer=gero 
> nimo,j2eeType=EntityBean,name=CustomerEJB
>
>     </nam:target-name>
>
>   </nam:ejb-ref>
>
>
> Ideally, we don’t want users to perform such extra efforts while  
> porting their Geronimo specific plans in eclipse.   I am not sure  
> what can be done in the plugin code to perform a loose XML  
> checking… it seems to use the WTP/pre-requisites’ code to perform  
> the XML checking.   Thoughts?
>
>
> Thanks,
>
>
> Lin
>
>
>