You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by Jonathan Gallimore <jg...@wav2.com> on 2007/09/05 16:04:31 UTC
Re: ejb-jar.xml to Annotations tool
Hey guys,
I'd be interested in contributing to this piece of work, and I have some
previous development experience with Eclipse plugins. Has anything been
setup to check out?
Cheers
Jon
On Aug 28, 2007, at 3:01 AM, Mohammad Nour El-Din wrote:
> gr8, we can start reading about Eclipse plugins together and start
> doing the
> simple idea u explained, I suggest we start reading how to extebd
> the WST
> first, I think Jeremy has sent an e-mail about that b4, I will
> search for
> this article and will send it back to you :) .
I don't really have much interest in Eclipse, but I can certainly
help on the core part of the tool that creates the annotation model
from the xml.
-David
--
View this message in context: http://www.nabble.com/ejb-jar.xml-to-Annotations-tool-tf4325175.html#a12498749
Sent from the OpenEJB Dev mailing list archive at Nabble.com.
Re: ejb-jar.xml to Annotations tool
Posted by Jonathan Gallimore <jo...@gmail.com>.
Fantastic, many thanks Jacek.
Jon
Jacek Laskowski wrote:
> On Jan 6, 2008 7:02 PM, Jonathan Gallimore <jo...@gmail.com> wrote:
>
>
>> Just wanted to give you an update on the plug-in work I've been doing.
>> I've added another patch to OPENEJB-674 (many thanks to whoever applied
>> the last patch. I've also attached a zip to the issue as I'm not sure if
>> files I added made it into SVN last time.
>>
>
> The patch's committed. It built fine. I have not tried running it
> though. Will do it the next time a patch comes in.
>
> Jacek
>
>
Re: ejb-jar.xml to Annotations tool
Posted by Jacek Laskowski <ja...@laskowski.net.pl>.
On Jan 6, 2008 7:02 PM, Jonathan Gallimore <jo...@gmail.com> wrote:
> Just wanted to give you an update on the plug-in work I've been doing.
> I've added another patch to OPENEJB-674 (many thanks to whoever applied
> the last patch. I've also attached a zip to the issue as I'm not sure if
> files I added made it into SVN last time.
The patch's committed. It built fine. I have not tried running it
though. Will do it the next time a patch comes in.
Jacek
--
Jacek Laskowski
http://www.JacekLaskowski.pl
Re: ejb-jar.xml to Annotations tool
Posted by Jonathan Gallimore <jo...@gmail.com>.
Hi All,
Just wanted to give you an update on the plug-in work I've been doing.
I've added another patch to OPENEJB-674 (many thanks to whoever applied
the last patch. I've also attached a zip to the issue as I'm not sure if
files I added made it into SVN last time.
With this patch, I think the plug-in will now generate most of the
annotations for session and message driven beans. I'm hoping to use the
plug-in to migrate the code at work (which doesn't have any entity
beans) over to EJB 3 over the next week or so. I'll post with how I get on.
I've added some PDE tests, although I'm not completely sure how to get
them to run from Maven, does anyone know how to do this?
I've also started working on generating annotations for Entity beans.
The approach I've taken is to use the CmpJpaConversion class to get
EntityMappings from both the ejb-jar.xml and openejb-jar.xml and using
the EntityMappings structure to work out which annotations should be
added to the entity bean classes. If I've understood it correctly, when
an EJB 2 app is deployed, OpenEJB generates an intermediate orm.xml file
that it passes to OpenJPA to handle the persistence, so I'm trying to do
the same thing. Obviously, please let me know if you think I'm going
about this the wrong way, or if I could be doing something better.
In terms of CMP beans, I guess we need to convert the CMP class into a
regular class, I was thinking of just removing the abstract keyword, and
turning them into very basic POJOs. I guess we'll also need to find some
way of refactoring lookups to CMP beans to use the JPA EntityManager.
Does anyone have any thoughts on this?
Sorry this has taken longer than I had hoped, I've been pretty busy with
work lately.
Cheers
Jon
Re: ejb-jar.xml to Annotations tool
Posted by Jonathan Gallimore <jo...@jrg.me.uk>.
Hi,
Manu - Many thanks for applying the patch - I'll attach them to the JIRA
issue in future.
I've had a stab at updating the README file for the plugin, and I've
attached a patch to the JIRA issue.
Hopefully I'll get a chance to do a bit more work on this over the weekend.
Cheers
Jon
Manu George wrote:
> Jonathan,
> I have made the change. Please submit your patches via
> the JIRA from now on. It will be easier to track and you also need to
> agree to grant access to Apache there :).
>
> Regards
> Manu
>
> On 11/1/07, Manu George <ma...@gmail.com> wrote:
>
>> Hi Jonathan,
>> My thanks to you for taking time out to work on
>> this tool :) and my apologies for taking so much time to respond. The
>> wiki is the best place for documentation and I believe it will be a
>> good idea to add the docs there. Regarding the patches attach away. I
>> will start by looking at what you have attached and checking them in.
>> I will respond on this thread once done
>>
>> Regards
>> Manu
>>
>> On 10/30/07, Jonathan Gallimore <jo...@jrg.me.uk> wrote:
>>
>>> Hi Manu
>>>
>>> Thanks for getting this checked in. It all looks good (thanks for adding
>>> the repository too!). I've done a clean checkout and build (after
>>> removing my .m2 directory) and the only thing that didn't work was the
>>> generation of the update site - The build was successful, but Eclipse
>>> complained that the <?xml... line wasn't the first thing in the site.xml
>>> file when I tried to install the plugin.
>>>
>>> I've attached a patch which has sorted it out on my local copy.
>>>
>>> I'll sort out the README tomorrow. I'm also happy to add some
>>> documentation to the wiki, if you like, although I'm not sure quite
>>> where the best place for the documentation would be?
>>>
>>> I've also had a go at a screen cam demonstration of the plugin if
>>> anyone's interested (http://www.jrg.me.uk/Projects/OpenEJB.html) - there
>>> is sound, but its a bit quiet. I don't know if this sort of thing is
>>> useful or appropriate, but I'd be interested to know what people think.
>>>
>>> Manu, Many thanks again for doing this, and sorry it wasn't less painful ;-)
>>>
>>> Regards
>>>
>>> Jon
>>>
>>>
>>>> Hi Jonathan,
>>>> I have checked in your files into sandbox. Pls have
>>>> a look and test it. I am not yet deleting the existing plugin files in
>>>> sandbox and will do that once this has been tested.
>>>> Also please modify the Readme in sandbox with the additional
>>>> instructions and submit a patch when you can.
>>>>
>>>> One other thing that I did was add a repository temporarily to resolve
>>>> javax\xml\jsr173\1.0\jsr173-1.0.jar i.e
>>>> http://jass.objectweb.org/repository/m2.
>>>>
>>>> Regards
>>>> Manu
>>>>
>>>>
>>>>
>>>
>>>
>
>
Re: ejb-jar.xml to Annotations tool
Posted by Manu George <ma...@gmail.com>.
Jonathan,
I have made the change. Please submit your patches via
the JIRA from now on. It will be easier to track and you also need to
agree to grant access to Apache there :).
Regards
Manu
On 11/1/07, Manu George <ma...@gmail.com> wrote:
> Hi Jonathan,
> My thanks to you for taking time out to work on
> this tool :) and my apologies for taking so much time to respond. The
> wiki is the best place for documentation and I believe it will be a
> good idea to add the docs there. Regarding the patches attach away. I
> will start by looking at what you have attached and checking them in.
> I will respond on this thread once done
>
> Regards
> Manu
>
> On 10/30/07, Jonathan Gallimore <jo...@jrg.me.uk> wrote:
> > Hi Manu
> >
> > Thanks for getting this checked in. It all looks good (thanks for adding
> > the repository too!). I've done a clean checkout and build (after
> > removing my .m2 directory) and the only thing that didn't work was the
> > generation of the update site - The build was successful, but Eclipse
> > complained that the <?xml... line wasn't the first thing in the site.xml
> > file when I tried to install the plugin.
> >
> > I've attached a patch which has sorted it out on my local copy.
> >
> > I'll sort out the README tomorrow. I'm also happy to add some
> > documentation to the wiki, if you like, although I'm not sure quite
> > where the best place for the documentation would be?
> >
> > I've also had a go at a screen cam demonstration of the plugin if
> > anyone's interested (http://www.jrg.me.uk/Projects/OpenEJB.html) - there
> > is sound, but its a bit quiet. I don't know if this sort of thing is
> > useful or appropriate, but I'd be interested to know what people think.
> >
> > Manu, Many thanks again for doing this, and sorry it wasn't less painful ;-)
> >
> > Regards
> >
> > Jon
> >
> > > Hi Jonathan,
> > > I have checked in your files into sandbox. Pls have
> > > a look and test it. I am not yet deleting the existing plugin files in
> > > sandbox and will do that once this has been tested.
> > > Also please modify the Readme in sandbox with the additional
> > > instructions and submit a patch when you can.
> > >
> > > One other thing that I did was add a repository temporarily to resolve
> > > javax\xml\jsr173\1.0\jsr173-1.0.jar i.e
> > > http://jass.objectweb.org/repository/m2.
> > >
> > > Regards
> > > Manu
> > >
> > >
> >
> >
> >
>
Re: ejb-jar.xml to Annotations tool
Posted by Manu George <ma...@gmail.com>.
Hi Jonathan,
My thanks to you for taking time out to work on
this tool :) and my apologies for taking so much time to respond. The
wiki is the best place for documentation and I believe it will be a
good idea to add the docs there. Regarding the patches attach away. I
will start by looking at what you have attached and checking them in.
I will respond on this thread once done
Regards
Manu
On 10/30/07, Jonathan Gallimore <jo...@jrg.me.uk> wrote:
> Hi Manu
>
> Thanks for getting this checked in. It all looks good (thanks for adding
> the repository too!). I've done a clean checkout and build (after
> removing my .m2 directory) and the only thing that didn't work was the
> generation of the update site - The build was successful, but Eclipse
> complained that the <?xml... line wasn't the first thing in the site.xml
> file when I tried to install the plugin.
>
> I've attached a patch which has sorted it out on my local copy.
>
> I'll sort out the README tomorrow. I'm also happy to add some
> documentation to the wiki, if you like, although I'm not sure quite
> where the best place for the documentation would be?
>
> I've also had a go at a screen cam demonstration of the plugin if
> anyone's interested (http://www.jrg.me.uk/Projects/OpenEJB.html) - there
> is sound, but its a bit quiet. I don't know if this sort of thing is
> useful or appropriate, but I'd be interested to know what people think.
>
> Manu, Many thanks again for doing this, and sorry it wasn't less painful ;-)
>
> Regards
>
> Jon
>
> > Hi Jonathan,
> > I have checked in your files into sandbox. Pls have
> > a look and test it. I am not yet deleting the existing plugin files in
> > sandbox and will do that once this has been tested.
> > Also please modify the Readme in sandbox with the additional
> > instructions and submit a patch when you can.
> >
> > One other thing that I did was add a repository temporarily to resolve
> > javax\xml\jsr173\1.0\jsr173-1.0.jar i.e
> > http://jass.objectweb.org/repository/m2.
> >
> > Regards
> > Manu
> >
> >
>
>
>
Re: ejb-jar.xml to Annotations tool
Posted by Mohammad Nour El-Din <no...@gmail.com>.
Hi Jonathan, the video is cool, how did u do it :D. And the tool is greater
:D, it will be an edge to add in the JDC2 presentation on OpenEJB3.
On 10/30/07, Jonathan Gallimore <jo...@jrg.me.uk> wrote:
>
> Hi Manu
>
> Thanks for getting this checked in. It all looks good (thanks for adding
> the repository too!). I've done a clean checkout and build (after
> removing my .m2 directory) and the only thing that didn't work was the
> generation of the update site - The build was successful, but Eclipse
> complained that the <?xml... line wasn't the first thing in the site.xml
> file when I tried to install the plugin.
>
> I've attached a patch which has sorted it out on my local copy.
>
> I'll sort out the README tomorrow. I'm also happy to add some
> documentation to the wiki, if you like, although I'm not sure quite
> where the best place for the documentation would be?
>
> I've also had a go at a screen cam demonstration of the plugin if
> anyone's interested (http://www.jrg.me.uk/Projects/OpenEJB.html) - there
> is sound, but its a bit quiet. I don't know if this sort of thing is
> useful or appropriate, but I'd be interested to know what people think.
>
> Manu, Many thanks again for doing this, and sorry it wasn't less painful
> ;-)
>
> Regards
>
> Jon
>
> > Hi Jonathan,
> > I have checked in your files into sandbox. Pls have
> > a look and test it. I am not yet deleting the existing plugin files in
> > sandbox and will do that once this has been tested.
> > Also please modify the Readme in sandbox with the additional
> > instructions and submit a patch when you can.
> >
> > One other thing that I did was add a repository temporarily to resolve
> > javax\xml\jsr173\1.0\jsr173-1.0.jar i.e
> > http://jass.objectweb.org/repository/m2.
> >
> > Regards
> > Manu
> >
> >
>
>
>
--
Thanks
- Mohammad Nour
Re: ejb-jar.xml to Annotations tool
Posted by Jonathan Gallimore <jo...@jrg.me.uk>.
Hi Manu
Thanks for getting this checked in. It all looks good (thanks for adding
the repository too!). I've done a clean checkout and build (after
removing my .m2 directory) and the only thing that didn't work was the
generation of the update site - The build was successful, but Eclipse
complained that the <?xml... line wasn't the first thing in the site.xml
file when I tried to install the plugin.
I've attached a patch which has sorted it out on my local copy.
I'll sort out the README tomorrow. I'm also happy to add some
documentation to the wiki, if you like, although I'm not sure quite
where the best place for the documentation would be?
I've also had a go at a screen cam demonstration of the plugin if
anyone's interested (http://www.jrg.me.uk/Projects/OpenEJB.html) - there
is sound, but its a bit quiet. I don't know if this sort of thing is
useful or appropriate, but I'd be interested to know what people think.
Manu, Many thanks again for doing this, and sorry it wasn't less painful ;-)
Regards
Jon
> Hi Jonathan,
> I have checked in your files into sandbox. Pls have
> a look and test it. I am not yet deleting the existing plugin files in
> sandbox and will do that once this has been tested.
> Also please modify the Readme in sandbox with the additional
> instructions and submit a patch when you can.
>
> One other thing that I did was add a repository temporarily to resolve
> javax\xml\jsr173\1.0\jsr173-1.0.jar i.e
> http://jass.objectweb.org/repository/m2.
>
> Regards
> Manu
>
>
Re: ejb-jar.xml to Annotations tool
Posted by Manu George <ma...@gmail.com>.
Hi Jonathan,
I have checked in your files into sandbox. Pls have
a look and test it. I am not yet deleting the existing plugin files in
sandbox and will do that once this has been tested.
Also please modify the Readme in sandbox with the additional
instructions and submit a patch when you can.
One other thing that I did was add a repository temporarily to resolve
javax\xml\jsr173\1.0\jsr173-1.0.jar i.e
http://jass.objectweb.org/repository/m2.
Regards
Manu
On 10/24/07, Jonathan Gallimore <jo...@gmail.com> wrote:
> Whoops! I've attached another patch created with TortoiseSVN, hopefully
> that'll do the trick.
>
> The plugin should work with an EJB 2.1 ejb-jar.xml file, I have an old
> version of the Bank sample (I think its a Geronimo sample) which is EJB
> 2.1 and that seems to work. I have had some exceptions with openejb-jee
> unmarshalling EJB 2.0 xml files though. You do need to have the EJB 3
> API classes on your classpath though (although it might be an idea for
> me to check for that, and add it if its not there already). I think it
> would be useful if I put together some documentation and perhaps a
> screencam of it in action.
>
> Glad you like the preview - I forgot to mention I had done that.
> Essentially its works in the same way as any of the other Java
> refactorings. It took a while to figure out how to do it, but was well
> worth it, I think ;-)
>
> Cheers
>
> Jon
>
> Manu George wrote:
> > Hi Jonathan,
> > Sorry for the delay,Can you attach a patch that is
> > created using svn. The current patch has diffs for the svn specific
> > files as well. If you create one using svn it will be easier for me to
> > apply too. There was no error in the error logs because I was using an
> > ejb 2.1 bean :). Once I changed to 3.0 beans it worked like a charm.
> > The diff view is awesome. Great work Jon
> >
> > Thanks
> > Manu
> >
> > On 10/23/07, Jonathan Gallimore <jo...@gmail.com> wrote:
> >
> >> Hi Manu,
> >>
> >> I have attached a patch to JIRA issue OPENEJB-674. I've have applied the
> >> patch to a fresh checkout of the plugin that is already in the sandbox,
> >> and it seemed to work ok, but I had to manually remove the
> >> org.eclipse.jst.server.generic.openejb folder in the root (its now under
> >> the plugins folder). Please let me know if you need anything else.
> >>
> >> Also, did you have any luck getting a stack trace from the error log for
> >> the error message you were encountering?
> >>
> >> Cheers
> >>
> >> Jon
> >>
> >>
> >> Manu George wrote:
> >>
> >>> Hey David, hope you are enjoying your vacation. Jonathan, I will be
> >>> happy to get this into sandbox. Please attach a patch.
> >>>
> >>> Thanks
> >>> Manu
> >>>
> >>>
> >>>
> >
> >
>
>
Re: ejb-jar.xml to Annotations tool
Posted by Jonathan Gallimore <jo...@gmail.com>.
Whoops! I've attached another patch created with TortoiseSVN, hopefully
that'll do the trick.
The plugin should work with an EJB 2.1 ejb-jar.xml file, I have an old
version of the Bank sample (I think its a Geronimo sample) which is EJB
2.1 and that seems to work. I have had some exceptions with openejb-jee
unmarshalling EJB 2.0 xml files though. You do need to have the EJB 3
API classes on your classpath though (although it might be an idea for
me to check for that, and add it if its not there already). I think it
would be useful if I put together some documentation and perhaps a
screencam of it in action.
Glad you like the preview - I forgot to mention I had done that.
Essentially its works in the same way as any of the other Java
refactorings. It took a while to figure out how to do it, but was well
worth it, I think ;-)
Cheers
Jon
Manu George wrote:
> Hi Jonathan,
> Sorry for the delay,Can you attach a patch that is
> created using svn. The current patch has diffs for the svn specific
> files as well. If you create one using svn it will be easier for me to
> apply too. There was no error in the error logs because I was using an
> ejb 2.1 bean :). Once I changed to 3.0 beans it worked like a charm.
> The diff view is awesome. Great work Jon
>
> Thanks
> Manu
>
> On 10/23/07, Jonathan Gallimore <jo...@gmail.com> wrote:
>
>> Hi Manu,
>>
>> I have attached a patch to JIRA issue OPENEJB-674. I've have applied the
>> patch to a fresh checkout of the plugin that is already in the sandbox,
>> and it seemed to work ok, but I had to manually remove the
>> org.eclipse.jst.server.generic.openejb folder in the root (its now under
>> the plugins folder). Please let me know if you need anything else.
>>
>> Also, did you have any luck getting a stack trace from the error log for
>> the error message you were encountering?
>>
>> Cheers
>>
>> Jon
>>
>>
>> Manu George wrote:
>>
>>> Hey David, hope you are enjoying your vacation. Jonathan, I will be
>>> happy to get this into sandbox. Please attach a patch.
>>>
>>> Thanks
>>> Manu
>>>
>>>
>>>
>
>
Re: ejb-jar.xml to Annotations tool
Posted by Manu George <ma...@gmail.com>.
Hi Jonathan,
Sorry for the delay,Can you attach a patch that is
created using svn. The current patch has diffs for the svn specific
files as well. If you create one using svn it will be easier for me to
apply too. There was no error in the error logs because I was using an
ejb 2.1 bean :). Once I changed to 3.0 beans it worked like a charm.
The diff view is awesome. Great work Jon
Thanks
Manu
On 10/23/07, Jonathan Gallimore <jo...@gmail.com> wrote:
> Hi Manu,
>
> I have attached a patch to JIRA issue OPENEJB-674. I've have applied the
> patch to a fresh checkout of the plugin that is already in the sandbox,
> and it seemed to work ok, but I had to manually remove the
> org.eclipse.jst.server.generic.openejb folder in the root (its now under
> the plugins folder). Please let me know if you need anything else.
>
> Also, did you have any luck getting a stack trace from the error log for
> the error message you were encountering?
>
> Cheers
>
> Jon
>
>
> Manu George wrote:
> > Hey David, hope you are enjoying your vacation. Jonathan, I will be
> > happy to get this into sandbox. Please attach a patch.
> >
> > Thanks
> > Manu
> >
> >
>
Re: ejb-jar.xml to Annotations tool
Posted by Jonathan Gallimore <jo...@gmail.com>.
Hi Manu,
I have attached a patch to JIRA issue OPENEJB-674. I've have applied the
patch to a fresh checkout of the plugin that is already in the sandbox,
and it seemed to work ok, but I had to manually remove the
org.eclipse.jst.server.generic.openejb folder in the root (its now under
the plugins folder). Please let me know if you need anything else.
Also, did you have any luck getting a stack trace from the error log for
the error message you were encountering?
Cheers
Jon
Manu George wrote:
> Hey David, hope you are enjoying your vacation. Jonathan, I will be
> happy to get this into sandbox. Please attach a patch.
>
> Thanks
> Manu
>
>
Re: ejb-jar.xml to Annotations tool
Posted by Manu George <ma...@gmail.com>.
Hey David, hope you are enjoying your vacation. Jonathan, I will be
happy to get this into sandbox. Please attach a patch.
Thanks
Manu
On 10/21/07, dblevins <db...@visi.com> wrote:
>
> Hi all from vacation-land (London to be specific).
>
> Jonathan, great to hear you're now using the JAXB tree from openejb-jee,
> that'll be a big time saver and will definitely make maintaining the tool
> easier in future spec revisions.
>
> I agree we should get this checked in somewhere. The sooner we get the code
> in and patch process started the sooner we can get Jonathan pulled into the
> community.
>
> Anyone out there want to get this in?
>
> -David
>
>
> Jonathan Gallimore-2 wrote:
> >
> > I realise I've been doing bits and pieces of work on this, and have been
> > quite for a little while now, so I thought I'd just give you a bit of an
> > update.
> >
> > I've managed to "Mavenize" the build of both the ejb-jar.xml to
> > annotations plugin, and the WTP server adapter plugin, and bundled them
> > both into a single OpenEJB feature. This generates an update site - I
> > have a copy at http://www.jrg.me.uk/update-site if you fancy pointing
> > your copy of Eclipse at it and trying it out. The POMs are largely based
> > on the Geronimo Dev tools build. I would like to add my PDE tests to
> > this as well at some point.
> >
> > I've moved away from parsing the ejb-jar.xml with a SAX parser and I'm
> > now using the JaxbJavaee class to unmarshal it. I've added a couple more
> > annotations, and I'm currently looking at adding annotation attributes
> > to the source correctly (it only handles strings properly at the moment).
> >
> > I guess now that I've done some work with Maven and put the two plugins
> > together in one bundle, it would make good sense to move this into the
> > sandbox some time soon - are you happy for me to attach a patch to
> > http://issues.apache.org/jira/browse/OPENEJB-674 - it might be quite
> > large as that plugin is now in a subdirectory? My current code is
> > available at https://jrg.me.uk/annotations-plugin/trunk/ if anyone
> > fancies taking a look / trying it out.
> >
> > Regards
> >
> > Jon
> >
> >
> >
>
> --
> View this message in context: http://www.nabble.com/ejb-jar.xml-to-Annotations-tool-tf4325175.html#a13331089
> Sent from the OpenEJB Dev mailing list archive at Nabble.com.
>
>
Re: ejb-jar.xml to Annotations tool
Posted by Jonathan Gallimore <jo...@gmail.com>.
Hi Manu,
Thanks for giving it a whirl, I'm glad it installs ok.
As for your error... I guess something is broken :-) - obviously its
early days ;-)
Is there anything in the error log view (Window->Show View->PDE
Runtime->Show log) - if there's a stack trace in there, can you send it
over and I'll have a look.
I've noticed a problem with adding an OpenEJB server where its missing a
dependency, so I'll look into this too.
Cheers
Jon
Manu George wrote:
> Hi Jonanthan,
> This is really cool. I downloaded and installed it in
> my Eclipse instance and it installed perfectly. However I am getting a
> dialog with the message, the chosen operation is not available when i
> select generate annotations. Why is this coming. Any Idea? I may be
> doing something wrong I guess.
>
> Regards
> Manu
>
>
Re: ejb-jar.xml to Annotations tool
Posted by Manu George <ma...@gmail.com>.
Hi Jonanthan,
This is really cool. I downloaded and installed it in
my Eclipse instance and it installed perfectly. However I am getting a
dialog with the message, the chosen operation is not available when i
select generate annotations. Why is this coming. Any Idea? I may be
doing something wrong I guess.
Regards
Manu
On 10/20/07, Jonathan Gallimore <jo...@gmail.com> wrote:
> I realise I've been doing bits and pieces of work on this, and have been
> quite for a little while now, so I thought I'd just give you a bit of an
> update.
>
> I've managed to "Mavenize" the build of both the ejb-jar.xml to
> annotations plugin, and the WTP server adapter plugin, and bundled them
> both into a single OpenEJB feature. This generates an update site - I
> have a copy at http://www.jrg.me.uk/update-site if you fancy pointing
> your copy of Eclipse at it and trying it out. The POMs are largely based
> on the Geronimo Dev tools build. I would like to add my PDE tests to
> this as well at some point.
>
> I've moved away from parsing the ejb-jar.xml with a SAX parser and I'm
> now using the JaxbJavaee class to unmarshal it. I've added a couple more
> annotations, and I'm currently looking at adding annotation attributes
> to the source correctly (it only handles strings properly at the moment).
>
> I guess now that I've done some work with Maven and put the two plugins
> together in one bundle, it would make good sense to move this into the
> sandbox some time soon - are you happy for me to attach a patch to
> http://issues.apache.org/jira/browse/OPENEJB-674 - it might be quite
> large as that plugin is now in a subdirectory? My current code is
> available at https://jrg.me.uk/annotations-plugin/trunk/ if anyone
> fancies taking a look / trying it out.
>
> Regards
>
> Jon
>
>
Re: ejb-jar.xml to Annotations tool
Posted by dblevins <db...@visi.com>.
Hi all from vacation-land (London to be specific).
Jonathan, great to hear you're now using the JAXB tree from openejb-jee,
that'll be a big time saver and will definitely make maintaining the tool
easier in future spec revisions.
I agree we should get this checked in somewhere. The sooner we get the code
in and patch process started the sooner we can get Jonathan pulled into the
community.
Anyone out there want to get this in?
-David
Jonathan Gallimore-2 wrote:
>
> I realise I've been doing bits and pieces of work on this, and have been
> quite for a little while now, so I thought I'd just give you a bit of an
> update.
>
> I've managed to "Mavenize" the build of both the ejb-jar.xml to
> annotations plugin, and the WTP server adapter plugin, and bundled them
> both into a single OpenEJB feature. This generates an update site - I
> have a copy at http://www.jrg.me.uk/update-site if you fancy pointing
> your copy of Eclipse at it and trying it out. The POMs are largely based
> on the Geronimo Dev tools build. I would like to add my PDE tests to
> this as well at some point.
>
> I've moved away from parsing the ejb-jar.xml with a SAX parser and I'm
> now using the JaxbJavaee class to unmarshal it. I've added a couple more
> annotations, and I'm currently looking at adding annotation attributes
> to the source correctly (it only handles strings properly at the moment).
>
> I guess now that I've done some work with Maven and put the two plugins
> together in one bundle, it would make good sense to move this into the
> sandbox some time soon - are you happy for me to attach a patch to
> http://issues.apache.org/jira/browse/OPENEJB-674 - it might be quite
> large as that plugin is now in a subdirectory? My current code is
> available at https://jrg.me.uk/annotations-plugin/trunk/ if anyone
> fancies taking a look / trying it out.
>
> Regards
>
> Jon
>
>
>
--
View this message in context: http://www.nabble.com/ejb-jar.xml-to-Annotations-tool-tf4325175.html#a13331089
Sent from the OpenEJB Dev mailing list archive at Nabble.com.
Re: ejb-jar.xml to Annotations tool
Posted by Jonathan Gallimore <jo...@gmail.com>.
I realise I've been doing bits and pieces of work on this, and have been
quite for a little while now, so I thought I'd just give you a bit of an
update.
I've managed to "Mavenize" the build of both the ejb-jar.xml to
annotations plugin, and the WTP server adapter plugin, and bundled them
both into a single OpenEJB feature. This generates an update site - I
have a copy at http://www.jrg.me.uk/update-site if you fancy pointing
your copy of Eclipse at it and trying it out. The POMs are largely based
on the Geronimo Dev tools build. I would like to add my PDE tests to
this as well at some point.
I've moved away from parsing the ejb-jar.xml with a SAX parser and I'm
now using the JaxbJavaee class to unmarshal it. I've added a couple more
annotations, and I'm currently looking at adding annotation attributes
to the source correctly (it only handles strings properly at the moment).
I guess now that I've done some work with Maven and put the two plugins
together in one bundle, it would make good sense to move this into the
sandbox some time soon - are you happy for me to attach a patch to
http://issues.apache.org/jira/browse/OPENEJB-674 - it might be quite
large as that plugin is now in a subdirectory? My current code is
available at https://jrg.me.uk/annotations-plugin/trunk/ if anyone
fancies taking a look / trying it out.
Regards
Jon
Re: ejb-jar.xml to Annotations tool
Posted by Mohammad Nour El-Din <no...@gmail.com>.
JIRA assigment done
On 9/20/07, Mohammad Nour El-Din <no...@gmail.com> wrote:
>
> Hi Jonathan...
>
> Welcome to our contributors list, look at this issue
> http://issues.apache.org/jira/browse/OPENEJB-674, this is the one Karan
> mentioned at the beginning of this thread, I will assign it to you, have
> fun. And if you could add what you to our wiki area in the Developers and
> Users spaces it would be more fun ;), for the documentation on wiki you can
> consult Karan, he is the man having all the fun on the documentation. I hope
> I could go on the right rhythm - this is another subject I will tell you
> about later Jonathan :D .
>
> On 9/20/07, Jonathan Gallimore <jg...@wav2.com> wrote:
> >
> >
> > >> Definitely updating the source in a one-time conversion kind of a
> > >> thing is most useful. For a command line tool it'd probably targeted
> > >> at people not using eclipse or any individual IDE and would probably
> > >> just spit out some sort of terse report (perhpas some stubbed out
> > >> version of their class with the annotations in it) that wouldn't be a
> > >> ready to deploy app but just an aid to either help them convert their
> >
> > >> app or something help them understand how xml and annotations relate.
> > >>
> > >>
> > That sounds like a good approach to me - stubbing out the code that is
> > updating the source at the moment and getting it to output what
> > modification needs to be done should be fairly straighforward.
> >
> > >> In code we currently do the reverse to deploy a bean. We read in the
> > >> ejb-jar.xml if you have one, then we scrape all your classes for
> > >> annotations and fill out the ejb-jar tree we have in memory (it's a
> > >> valid jaxb tree) respecting all of the overriding rules in the EJB
> > >> 3.0 spec, then use that tree to deploy your app just as if it was a
> > >> pure xml app with no annotations at all.
> > >>
> > >> 100% of our annotation processing work is done in this class http://
> > >> svn.apache.org/repos/asf/openejb/trunk/openejb3/container/openejb-
> > >> core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java
> > >>
> > >> For the core bit, we'd want something that did exactly what this
> > >> does, but in reverse. We'd want to take an assumed to be complete
> > >> ejb-jar.xml and build up the annotations. Except you can't
> > >> instantiate annotations so we'd probably want to create some similar
> > >> tree. The eclipse (or possibly an intellij) plugin could use that
> > >> tree to update the source and the command line tool could format it
> > >> as a report or something and spit it out to the console or a file.
> > >> There's a sort of "java tree" set of objects in ASM (asm-tree.jar) we
> > >> might be able to use -- haven't looked at it closely with this in
> > >> mind. If that works, then the core tool would take our ejb-jar.xml
> > >> jaxb tree and create a thin ASM tree with the annotations in it.
> > >>
> > Thanks for that David, that's very useful to know.
> >
> > >> I personally don't know anything about Eclipse plugins and how hard
> > >> it would be to directly update the source. Anyone have any input on
> > >> that? Don't want to come up with a core tool that is a super big
> > >> pain for the "update the source" version -- which is certainly more
> > >> intriguing.
> > >>
> > >
> > >
> > > >From my humble experience about Eclipse plugins, Editing Java source
> > code
> > > from the Eclipse plugin is an easy task - I don't know how to do it -
> > but it
> > > is not a problem cause you will use the JDT of Eclipse . And I believ
> > > Jonathan can say more about .
> > >
> > The plugin as it stands already updates the source, although its only
> > one annotation at a class level at the moment. Now that we've got
> > started with it, it should be pretty trivial to expand the annotations
> > we can add, and be able to add them to method declarations as well.
> >
> > The Eclipse JDT API is pretty easy to work with, essentially you use the
> >
> > JDT parser to parse a file, and then get the AST to "record" your
> > modifications. Once your done modifying the tree you can get a set of
> > modifications which you can apply to a buffer (this is all being done in
> >
> > this class:
> > https://jrg.me.uk/annotations-plugin/trunk/org.apache.openejb.helper.annotation/src/main/java/org/apache/openejb/helper/annotation/JavaProjectAnnotationFacade.java
> > ).
> >
> > Jon
> >
>
>
>
> --
> Thanks
> - Mohammad Nour
--
Thanks
- Mohammad Nour
Re: ejb-jar.xml to Annotations tool
Posted by Mohammad Nour El-Din <no...@gmail.com>.
Sorry you can create create a new account from here
http://issues.apache.org/jira/secure/Dashboard.jspa
On 9/19/07, Mohammad Nour El-Din <no...@gmail.com> wrote:
>
> Jonathan do you have a JIRA account ??? If you have please send it to me
> so I can add you to the contributers list, if not please create one and then
> send it to me .
>
> On 9/19/07, Mohammad Nour El-Din <no...@gmail.com> wrote:
> >
> > Jonathan, you can find our JIRA here
> > http://issues.apache.org/jira/browse/openejb
> >
> > On 9/19/07, Jacek Laskowski <ja...@laskowski.net.pl> wrote:
> > >
> > > On 9/18/07, Jonathan Gallimore <jg...@wav2.com> wrote:
> > >
> > > > I plan to do more, but wondered what you guys think. I'm quite happy
> > > to
> > > > use SVN on my server for this, or is there a better place for this
> > > to live?
> > >
> > > If it's ready to make even a simple work like adding @Stateless
> > > annotation I'd file a jira report and include a patch that would be
> > > committed to the repo. Let me/us know how we could help you out.
> > >
> > > Jacek
> > >
> > > --
> > > Jacek Laskowski
> > > http://www.JacekLaskowski.pl
> > >
> >
> >
> >
> > --
> > Thanks
> > - Mohammad Nour
>
>
>
>
> --
> Thanks
> - Mohammad Nour
--
Thanks
- Mohammad Nour
Re: ejb-jar.xml to Annotations tool
Posted by Mohammad Nour El-Din <no...@gmail.com>.
Sure I will do that, thanks for info :)
On 9/20/07, David Blevins <db...@visi.com> wrote:
>
>
> On Sep 19, 2007, at 2:21 AM, Mohammad Nour El-Din wrote:
>
> > Jonathan do you have a JIRA account ??? If you have please send it
> > to me so
> > I can add you to the contributers list, if not please create one
> > and then
> > send it to me .
>
> Make sure you add to the contributors part of "Project Roles" for our
> project definition in JIRA, the openejb-contributors group doesn't do
> anything anymore since an upgrade a few months ago.
>
> -David
>
>
> >
> > On 9/19/07, Mohammad Nour El-Din <no...@gmail.com> wrote:
> >>
> >> Jonathan, you can find our JIRA here
> >> http://issues.apache.org/jira/browse/openejb
> >>
> >> On 9/19/07, Jacek Laskowski <ja...@laskowski.net.pl> wrote:
> >>>
> >>> On 9/18/07, Jonathan Gallimore <jg...@wav2.com> wrote:
> >>>
> >>>> I plan to do more, but wondered what you guys think. I'm quite
> >>>> happy
> >>> to
> >>>> use SVN on my server for this, or is there a better place for
> >>>> this to
> >>> live?
> >>>
> >>> If it's ready to make even a simple work like adding @Stateless
> >>> annotation I'd file a jira report and include a patch that would be
> >>> committed to the repo. Let me/us know how we could help you out.
> >>>
> >>> Jacek
> >>>
> >>> --
> >>> Jacek Laskowski
> >>> http://www.JacekLaskowski.pl
> >>>
> >>
> >>
> >>
> >> --
> >> Thanks
> >> - Mohammad Nour
> >
> >
> >
> >
> > --
> > Thanks
> > - Mohammad Nour
>
>
--
Thanks
- Mohammad Nour
Re: ejb-jar.xml to Annotations tool
Posted by David Blevins <db...@visi.com>.
On Sep 19, 2007, at 2:21 AM, Mohammad Nour El-Din wrote:
> Jonathan do you have a JIRA account ??? If you have please send it
> to me so
> I can add you to the contributers list, if not please create one
> and then
> send it to me .
Make sure you add to the contributors part of "Project Roles" for our
project definition in JIRA, the openejb-contributors group doesn't do
anything anymore since an upgrade a few months ago.
-David
>
> On 9/19/07, Mohammad Nour El-Din <no...@gmail.com> wrote:
>>
>> Jonathan, you can find our JIRA here
>> http://issues.apache.org/jira/browse/openejb
>>
>> On 9/19/07, Jacek Laskowski <ja...@laskowski.net.pl> wrote:
>>>
>>> On 9/18/07, Jonathan Gallimore <jg...@wav2.com> wrote:
>>>
>>>> I plan to do more, but wondered what you guys think. I'm quite
>>>> happy
>>> to
>>>> use SVN on my server for this, or is there a better place for
>>>> this to
>>> live?
>>>
>>> If it's ready to make even a simple work like adding @Stateless
>>> annotation I'd file a jira report and include a patch that would be
>>> committed to the repo. Let me/us know how we could help you out.
>>>
>>> Jacek
>>>
>>> --
>>> Jacek Laskowski
>>> http://www.JacekLaskowski.pl
>>>
>>
>>
>>
>> --
>> Thanks
>> - Mohammad Nour
>
>
>
>
> --
> Thanks
> - Mohammad Nour
Re: ejb-jar.xml to Annotations tool
Posted by Mohammad Nour El-Din <no...@gmail.com>.
Jonathan do you have a JIRA account ??? If you have please send it to me so
I can add you to the contributers list, if not please create one and then
send it to me .
On 9/19/07, Mohammad Nour El-Din <no...@gmail.com> wrote:
>
> Jonathan, you can find our JIRA here
> http://issues.apache.org/jira/browse/openejb
>
> On 9/19/07, Jacek Laskowski <ja...@laskowski.net.pl> wrote:
> >
> > On 9/18/07, Jonathan Gallimore <jg...@wav2.com> wrote:
> >
> > > I plan to do more, but wondered what you guys think. I'm quite happy
> > to
> > > use SVN on my server for this, or is there a better place for this to
> > live?
> >
> > If it's ready to make even a simple work like adding @Stateless
> > annotation I'd file a jira report and include a patch that would be
> > committed to the repo. Let me/us know how we could help you out.
> >
> > Jacek
> >
> > --
> > Jacek Laskowski
> > http://www.JacekLaskowski.pl
> >
>
>
>
> --
> Thanks
> - Mohammad Nour
--
Thanks
- Mohammad Nour
Re: ejb-jar.xml to Annotations tool
Posted by Mohammad Nour El-Din <no...@gmail.com>.
Jonathan, you can find our JIRA here
http://issues.apache.org/jira/browse/openejb
On 9/19/07, Jacek Laskowski <ja...@laskowski.net.pl> wrote:
>
> On 9/18/07, Jonathan Gallimore <jg...@wav2.com> wrote:
>
> > I plan to do more, but wondered what you guys think. I'm quite happy to
> > use SVN on my server for this, or is there a better place for this to
> live?
>
> If it's ready to make even a simple work like adding @Stateless
> annotation I'd file a jira report and include a patch that would be
> committed to the repo. Let me/us know how we could help you out.
>
> Jacek
>
> --
> Jacek Laskowski
> http://www.JacekLaskowski.pl
>
--
Thanks
- Mohammad Nour
Re: ejb-jar.xml to Annotations tool
Posted by Jacek Laskowski <ja...@laskowski.net.pl>.
On 9/18/07, Jonathan Gallimore <jg...@wav2.com> wrote:
> I plan to do more, but wondered what you guys think. I'm quite happy to
> use SVN on my server for this, or is there a better place for this to live?
If it's ready to make even a simple work like adding @Stateless
annotation I'd file a jira report and include a patch that would be
committed to the repo. Let me/us know how we could help you out.
Jacek
--
Jacek Laskowski
http://www.JacekLaskowski.pl
Re: ejb-jar.xml to Annotations tool
Posted by Karan Malhi <ka...@gmail.com>.
> Karan, he is the man having all the fun on the documentation.
;)
--
Karan Singh Malhi
Re: ejb-jar.xml to Annotations tool
Posted by Mohammad Nour El-Din <no...@gmail.com>.
Hi Jonathan...
Welcome to our contributors list, look at this issue
http://issues.apache.org/jira/browse/OPENEJB-674, this is the one Karan
mentioned at the beginning of this thread, I will assign it to you, have
fun. And if you could add what you to our wiki area in the Developers and
Users spaces it would be more fun ;), for the documentation on wiki you can
consult Karan, he is the man having all the fun on the documentation. I hope
I could go on the right rhythm - this is another subject I will tell you
about later Jonathan :D .
On 9/20/07, Jonathan Gallimore <jg...@wav2.com> wrote:
>
>
> >> Definitely updating the source in a one-time conversion kind of a
> >> thing is most useful. For a command line tool it'd probably targeted
> >> at people not using eclipse or any individual IDE and would probably
> >> just spit out some sort of terse report (perhpas some stubbed out
> >> version of their class with the annotations in it) that wouldn't be a
> >> ready to deploy app but just an aid to either help them convert their
> >> app or something help them understand how xml and annotations relate.
> >>
> >>
> That sounds like a good approach to me - stubbing out the code that is
> updating the source at the moment and getting it to output what
> modification needs to be done should be fairly straighforward.
>
> >> In code we currently do the reverse to deploy a bean. We read in the
> >> ejb-jar.xml if you have one, then we scrape all your classes for
> >> annotations and fill out the ejb-jar tree we have in memory (it's a
> >> valid jaxb tree) respecting all of the overriding rules in the EJB
> >> 3.0 spec, then use that tree to deploy your app just as if it was a
> >> pure xml app with no annotations at all.
> >>
> >> 100% of our annotation processing work is done in this class http://
> >> svn.apache.org/repos/asf/openejb/trunk/openejb3/container/openejb-
> >> core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java
> >>
> >> For the core bit, we'd want something that did exactly what this
> >> does, but in reverse. We'd want to take an assumed to be complete
> >> ejb-jar.xml and build up the annotations. Except you can't
> >> instantiate annotations so we'd probably want to create some similar
> >> tree. The eclipse (or possibly an intellij) plugin could use that
> >> tree to update the source and the command line tool could format it
> >> as a report or something and spit it out to the console or a file.
> >> There's a sort of "java tree" set of objects in ASM (asm-tree.jar) we
> >> might be able to use -- haven't looked at it closely with this in
> >> mind. If that works, then the core tool would take our ejb-jar.xml
> >> jaxb tree and create a thin ASM tree with the annotations in it.
> >>
> Thanks for that David, that's very useful to know.
>
> >> I personally don't know anything about Eclipse plugins and how hard
> >> it would be to directly update the source. Anyone have any input on
> >> that? Don't want to come up with a core tool that is a super big
> >> pain for the "update the source" version -- which is certainly more
> >> intriguing.
> >>
> >
> >
> > >From my humble experience about Eclipse plugins, Editing Java source
> code
> > from the Eclipse plugin is an easy task - I don't know how to do it -
> but it
> > is not a problem cause you will use the JDT of Eclipse . And I believ
> > Jonathan can say more about .
> >
> The plugin as it stands already updates the source, although its only
> one annotation at a class level at the moment. Now that we've got
> started with it, it should be pretty trivial to expand the annotations
> we can add, and be able to add them to method declarations as well.
>
> The Eclipse JDT API is pretty easy to work with, essentially you use the
> JDT parser to parse a file, and then get the AST to "record" your
> modifications. Once your done modifying the tree you can get a set of
> modifications which you can apply to a buffer (this is all being done in
> this class:
>
> https://jrg.me.uk/annotations-plugin/trunk/org.apache.openejb.helper.annotation/src/main/java/org/apache/openejb/helper/annotation/JavaProjectAnnotationFacade.java
> ).
>
> Jon
>
--
Thanks
- Mohammad Nour
Re: ejb-jar.xml to Annotations tool
Posted by Jonathan Gallimore <jg...@wav2.com>.
>> Definitely updating the source in a one-time conversion kind of a
>> thing is most useful. For a command line tool it'd probably targeted
>> at people not using eclipse or any individual IDE and would probably
>> just spit out some sort of terse report (perhpas some stubbed out
>> version of their class with the annotations in it) that wouldn't be a
>> ready to deploy app but just an aid to either help them convert their
>> app or something help them understand how xml and annotations relate.
>>
>>
That sounds like a good approach to me - stubbing out the code that is
updating the source at the moment and getting it to output what
modification needs to be done should be fairly straighforward.
>> In code we currently do the reverse to deploy a bean. We read in the
>> ejb-jar.xml if you have one, then we scrape all your classes for
>> annotations and fill out the ejb-jar tree we have in memory (it's a
>> valid jaxb tree) respecting all of the overriding rules in the EJB
>> 3.0 spec, then use that tree to deploy your app just as if it was a
>> pure xml app with no annotations at all.
>>
>> 100% of our annotation processing work is done in this class http://
>> svn.apache.org/repos/asf/openejb/trunk/openejb3/container/openejb-
>> core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java
>>
>> For the core bit, we'd want something that did exactly what this
>> does, but in reverse. We'd want to take an assumed to be complete
>> ejb-jar.xml and build up the annotations. Except you can't
>> instantiate annotations so we'd probably want to create some similar
>> tree. The eclipse (or possibly an intellij) plugin could use that
>> tree to update the source and the command line tool could format it
>> as a report or something and spit it out to the console or a file.
>> There's a sort of "java tree" set of objects in ASM (asm-tree.jar) we
>> might be able to use -- haven't looked at it closely with this in
>> mind. If that works, then the core tool would take our ejb-jar.xml
>> jaxb tree and create a thin ASM tree with the annotations in it.
>>
Thanks for that David, that's very useful to know.
>> I personally don't know anything about Eclipse plugins and how hard
>> it would be to directly update the source. Anyone have any input on
>> that? Don't want to come up with a core tool that is a super big
>> pain for the "update the source" version -- which is certainly more
>> intriguing.
>>
>
>
> >From my humble experience about Eclipse plugins, Editing Java source code
> from the Eclipse plugin is an easy task - I don't know how to do it - but it
> is not a problem cause you will use the JDT of Eclipse . And I believ
> Jonathan can say more about .
>
The plugin as it stands already updates the source, although its only
one annotation at a class level at the moment. Now that we've got
started with it, it should be pretty trivial to expand the annotations
we can add, and be able to add them to method declarations as well.
The Eclipse JDT API is pretty easy to work with, essentially you use the
JDT parser to parse a file, and then get the AST to "record" your
modifications. Once your done modifying the tree you can get a set of
modifications which you can apply to a buffer (this is all being done in
this class:
https://jrg.me.uk/annotations-plugin/trunk/org.apache.openejb.helper.annotation/src/main/java/org/apache/openejb/helper/annotation/JavaProjectAnnotationFacade.java).
Jon
Re: ejb-jar.xml to Annotations tool
Posted by Mohammad Nour El-Din <no...@gmail.com>.
On 9/20/07, David Blevins <db...@visi.com> wrote:
>
>
> On Sep 19, 2007, at 2:37 AM, Jonathan Gallimore wrote:
>
> >>
> >> Gr8 work Jonathan, but if you please I have some comments, I code
> >> is really
> >> cool but it is tightly coupled to Eclipse, can we implement a
> >> common code
> >> that can be used from a command line tool for example, cause I
> >> think beside
> >> the need to have this done from eclipse we need to have it done
> >> from the CLI
> >> of OEJB by migrating the EJB 2.1 EJB to EJB 3.0 ones and maybe
> >> generating a
> >> new EJB Jar or even manipulating the class files on the fly. The
> >> Eclipse
> >> plug in can be good corner stone for an urgently needed OpenEJB
> >> Eclipse plug
> >> in .
> >>
> >
> > Thanks for the quick feedback!
> >
> > You're quite right, at the moment the JavaProjectAnnotationFacade
> > class is tightly coupled to the Eclipse JDT API, although you can
> > pass any implementation of IJavaProjectAnnotationFacade (ok,
> > probably not a great name thinking about it now...) to the
> > OpenEjbXmlConverter, so the mechanism to actually add the
> > annotations is reasonably well separated from the logic that works
> > out what to add.
> >
> > I agree it would be ace to make it work from the command line. I
> > guess I'd still expect it to work with the source rather than
> > modifying classes (otherwise if you edit your code, and recompile,
> > the annotations would be lost, wouldn't they?), so I was just
> > imagining that the command line version would just call the
> > OpenEjbXmlConverter part of the plugin and pointing at a workspace
> > and project, and still using the JDT, just without having Eclipse
> > actually running.
> >
> > I'm not against modifying class files on the fly, indeed I would
> > find it very interesting, although I personally think that adding
> > the annotations to the source is more useful.
>
> Definitely updating the source in a one-time conversion kind of a
> thing is most useful. For a command line tool it'd probably targeted
> at people not using eclipse or any individual IDE and would probably
> just spit out some sort of terse report (perhpas some stubbed out
> version of their class with the annotations in it) that wouldn't be a
> ready to deploy app but just an aid to either help them convert their
> app or something help them understand how xml and annotations relate.
>
> In code we currently do the reverse to deploy a bean. We read in the
> ejb-jar.xml if you have one, then we scrape all your classes for
> annotations and fill out the ejb-jar tree we have in memory (it's a
> valid jaxb tree) respecting all of the overriding rules in the EJB
> 3.0 spec, then use that tree to deploy your app just as if it was a
> pure xml app with no annotations at all.
>
> 100% of our annotation processing work is done in this class http://
> svn.apache.org/repos/asf/openejb/trunk/openejb3/container/openejb-
> core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java
>
> For the core bit, we'd want something that did exactly what this
> does, but in reverse. We'd want to take an assumed to be complete
> ejb-jar.xml and build up the annotations. Except you can't
> instantiate annotations so we'd probably want to create some similar
> tree. The eclipse (or possibly an intellij) plugin could use that
> tree to update the source and the command line tool could format it
> as a report or something and spit it out to the console or a file.
> There's a sort of "java tree" set of objects in ASM (asm-tree.jar) we
> might be able to use -- haven't looked at it closely with this in
> mind. If that works, then the core tool would take our ejb-jar.xml
> jaxb tree and create a thin ASM tree with the annotations in it.
>
> I personally don't know anything about Eclipse plugins and how hard
> it would be to directly update the source. Anyone have any input on
> that? Don't want to come up with a core tool that is a super big
> pain for the "update the source" version -- which is certainly more
> intriguing.
>From my humble experience about Eclipse plugins, Editing Java source code
from the Eclipse plugin is an easy task - I don't know how to do it - but it
is not a problem cause you will use the JDT of Eclipse . And I believ
Jonathan can say more about .
-David
>
>
--
Thanks
- Mohammad Nour
Re: ejb-jar.xml to Annotations tool
Posted by David Blevins <db...@visi.com>.
On Sep 19, 2007, at 2:37 AM, Jonathan Gallimore wrote:
>>
>> Gr8 work Jonathan, but if you please I have some comments, I code
>> is really
>> cool but it is tightly coupled to Eclipse, can we implement a
>> common code
>> that can be used from a command line tool for example, cause I
>> think beside
>> the need to have this done from eclipse we need to have it done
>> from the CLI
>> of OEJB by migrating the EJB 2.1 EJB to EJB 3.0 ones and maybe
>> generating a
>> new EJB Jar or even manipulating the class files on the fly. The
>> Eclipse
>> plug in can be good corner stone for an urgently needed OpenEJB
>> Eclipse plug
>> in .
>>
>
> Thanks for the quick feedback!
>
> You're quite right, at the moment the JavaProjectAnnotationFacade
> class is tightly coupled to the Eclipse JDT API, although you can
> pass any implementation of IJavaProjectAnnotationFacade (ok,
> probably not a great name thinking about it now...) to the
> OpenEjbXmlConverter, so the mechanism to actually add the
> annotations is reasonably well separated from the logic that works
> out what to add.
>
> I agree it would be ace to make it work from the command line. I
> guess I'd still expect it to work with the source rather than
> modifying classes (otherwise if you edit your code, and recompile,
> the annotations would be lost, wouldn't they?), so I was just
> imagining that the command line version would just call the
> OpenEjbXmlConverter part of the plugin and pointing at a workspace
> and project, and still using the JDT, just without having Eclipse
> actually running.
>
> I'm not against modifying class files on the fly, indeed I would
> find it very interesting, although I personally think that adding
> the annotations to the source is more useful.
Definitely updating the source in a one-time conversion kind of a
thing is most useful. For a command line tool it'd probably targeted
at people not using eclipse or any individual IDE and would probably
just spit out some sort of terse report (perhpas some stubbed out
version of their class with the annotations in it) that wouldn't be a
ready to deploy app but just an aid to either help them convert their
app or something help them understand how xml and annotations relate.
In code we currently do the reverse to deploy a bean. We read in the
ejb-jar.xml if you have one, then we scrape all your classes for
annotations and fill out the ejb-jar tree we have in memory (it's a
valid jaxb tree) respecting all of the overriding rules in the EJB
3.0 spec, then use that tree to deploy your app just as if it was a
pure xml app with no annotations at all.
100% of our annotation processing work is done in this class http://
svn.apache.org/repos/asf/openejb/trunk/openejb3/container/openejb-
core/src/main/java/org/apache/openejb/config/AnnotationDeployer.java
For the core bit, we'd want something that did exactly what this
does, but in reverse. We'd want to take an assumed to be complete
ejb-jar.xml and build up the annotations. Except you can't
instantiate annotations so we'd probably want to create some similar
tree. The eclipse (or possibly an intellij) plugin could use that
tree to update the source and the command line tool could format it
as a report or something and spit it out to the console or a file.
There's a sort of "java tree" set of objects in ASM (asm-tree.jar) we
might be able to use -- haven't looked at it closely with this in
mind. If that works, then the core tool would take our ejb-jar.xml
jaxb tree and create a thin ASM tree with the annotations in it.
I personally don't know anything about Eclipse plugins and how hard
it would be to directly update the source. Anyone have any input on
that? Don't want to come up with a core tool that is a super big
pain for the "update the source" version -- which is certainly more
intriguing.
-David
Re: ejb-jar.xml to Annotations tool
Posted by Jonathan Gallimore <jg...@wav2.com>.
>
> Gr8 work Jonathan, but if you please I have some comments, I code is really
> cool but it is tightly coupled to Eclipse, can we implement a common code
> that can be used from a command line tool for example, cause I think beside
> the need to have this done from eclipse we need to have it done from the CLI
> of OEJB by migrating the EJB 2.1 EJB to EJB 3.0 ones and maybe generating a
> new EJB Jar or even manipulating the class files on the fly. The Eclipse
> plug in can be good corner stone for an urgently needed OpenEJB Eclipse plug
> in .
>
Thanks for the quick feedback!
You're quite right, at the moment the JavaProjectAnnotationFacade class
is tightly coupled to the Eclipse JDT API, although you can pass any
implementation of IJavaProjectAnnotationFacade (ok, probably not a great
name thinking about it now...) to the OpenEjbXmlConverter, so the
mechanism to actually add the annotations is reasonably well separated
from the logic that works out what to add.
I agree it would be ace to make it work from the command line. I guess
I'd still expect it to work with the source rather than modifying
classes (otherwise if you edit your code, and recompile, the annotations
would be lost, wouldn't they?), so I was just imagining that the command
line version would just call the OpenEjbXmlConverter part of the plugin
and pointing at a workspace and project, and still using the JDT, just
without having Eclipse actually running.
I'm not against modifying class files on the fly, indeed I would find it
very interesting, although I personally think that adding the
annotations to the source is more useful.
> One more question, do you know a good reference to learn how to develop
> Eclipse plug ins, I have the *Addison Wesley* *The Java Developer's Guide to
> Eclipse* , but it is too huge and long, do you some concise tutorial which
> can help me do things like you do :) .
>
I don't have a "concise tutorial" as such, but in terms of books, I like
"Contributing to Eclipse, Principles, Patterns, and Plugins" by Erich
Gamma and Kent Beck
(http://www.amazon.com/Contributing-Eclipse-Principles-Patterns-Plugins/dp/0321205758).
I'm quite a fan of TDD, and this particular book has quite a lot of
detail on using the PDE JUnit in a test-driven way.
Cheers,
Jon
Re: ejb-jar.xml to Annotations tool
Posted by Mohammad Nour El-Din <no...@gmail.com>.
Gr8 work Jonathan, but if you please I have some comments, I code is really
cool but it is tightly coupled to Eclipse, can we implement a common code
that can be used from a command line tool for example, cause I think beside
the need to have this done from eclipse we need to have it done from the CLI
of OEJB by migrating the EJB 2.1 EJB to EJB 3.0 ones and maybe generating a
new EJB Jar or even manipulating the class files on the fly. The Eclipse
plug in can be good corner stone for an urgently needed OpenEJB Eclipse plug
in .
One more question, do you know a good reference to learn how to develop
Eclipse plug ins, I have the *Addison Wesley* *The Java Developer's Guide to
Eclipse* , but it is too huge and long, do you some concise tutorial which
can help me do things like you do :) .
On 9/19/07, Karan Malhi <ka...@gmail.com> wrote:
>
> > Currently, its extremely basic - it looks for session beans in
> > openejb-jar.xml, and adds a @Stateless annotation to the relevant class
> > (and it assumes the jndi-name for the session bean is the fully
> > qualified class name).
>
> Great, I will check it out.
>
> > I plan to do more, but wondered what you guys think. I'm quite happy to
> > use SVN on my server for this, or is there a better place for this to
> live?
>
> David or Jacek would be the best persons to answer this.
>
> Thanks !
> --
> Karan Singh Malhi
>
--
Thanks
- Mohammad Nour
Re: ejb-jar.xml to Annotations tool
Posted by Karan Malhi <ka...@gmail.com>.
> Currently, its extremely basic - it looks for session beans in
> openejb-jar.xml, and adds a @Stateless annotation to the relevant class
> (and it assumes the jndi-name for the session bean is the fully
> qualified class name).
Great, I will check it out.
> I plan to do more, but wondered what you guys think. I'm quite happy to
> use SVN on my server for this, or is there a better place for this to live?
David or Jacek would be the best persons to answer this.
Thanks !
--
Karan Singh Malhi
Re: ejb-jar.xml to Annotations tool
Posted by Jonathan Gallimore <jg...@wav2.com>.
I've had a bit of a stab at this (in its own plugin at the moment), and
I've made it available on my website
(http://www.jrg.me.uk/Projects/annotations.html) and in my SVN
repository (https://jrg.me.uk/annotations-plugin/trunk)
Currently, its extremely basic - it looks for session beans in
openejb-jar.xml, and adds a @Stateless annotation to the relevant class
(and it assumes the jndi-name for the session bean is the fully
qualified class name).
I plan to do more, but wondered what you guys think. I'm quite happy to
use SVN on my server for this, or is there a better place for this to live?
Cheers
Jon
Karan Malhi wrote:
> Jonathan,
>
> You can check it out from
> http://svn.apache.org/repos/asf/openejb/trunk/sandbox/openejb-eclipse-plugin.
>
> The only place I refer to geronimo is the classpath element in the
> serverdef. That does not add geronimo to the servers view, instead it
> just adds the jar file to the project targeted at the OpenEjb server.
> This jar file contains the ejb3.0-spec classes.
>
> I have zero experience in eclipse plugin development and this was my
> first attempt to create a plugin.
> You seem to be experienced with the eclipse plugin. Please feel free
> to make any changes to the plugin to make it better. Actually, we are
> totally open to you contributing your own code base from scratch.
> Anything which will give us a good,rich plugin would be great.
>
> Thanks a lot!!
>
>
> On 9/6/07, Jonathan Gallimore <jg...@wav2.com> wrote:
>
>> Sure thing. Have you made a start on specific plugin for this at all? The one
>> on the JIRA issue from Karan yesterday appeared to be adding Geronimo to the
>> Servers view? If not, I'm quite happy to make a start, and make some code
>> available.
>>
>> Jonathan
>>
>>
>> Gr8 Jonathan, and if you can transfer this knowledge to us it would be gr8
>>
>> On 9/5/07, Jonathan Gallimore <jg...@wav2.com> wrote:
>>
>>> Hey guys,
>>>
>>> I'd be interested in contributing to this piece of work, and I have some
>>> previous development experience with Eclipse plugins. Has anything been
>>> setup to check out?
>>>
>>> Cheers
>>>
>>> Jon
>>>
>>>
>> --
>> View this message in context: http://www.nabble.com/ejb-jar.xml-to-Annotations-tool-tf4325175.html#a12522132
>> Sent from the OpenEJB Dev mailing list archive at Nabble.com.
>>
>>
>>
>
>
>
Re: ejb-jar.xml to Annotations tool
Posted by Karan Malhi <ka...@gmail.com>.
Jonathan,
You can check it out from
http://svn.apache.org/repos/asf/openejb/trunk/sandbox/openejb-eclipse-plugin.
The only place I refer to geronimo is the classpath element in the
serverdef. That does not add geronimo to the servers view, instead it
just adds the jar file to the project targeted at the OpenEjb server.
This jar file contains the ejb3.0-spec classes.
I have zero experience in eclipse plugin development and this was my
first attempt to create a plugin.
You seem to be experienced with the eclipse plugin. Please feel free
to make any changes to the plugin to make it better. Actually, we are
totally open to you contributing your own code base from scratch.
Anything which will give us a good,rich plugin would be great.
Thanks a lot!!
On 9/6/07, Jonathan Gallimore <jg...@wav2.com> wrote:
>
> Sure thing. Have you made a start on specific plugin for this at all? The one
> on the JIRA issue from Karan yesterday appeared to be adding Geronimo to the
> Servers view? If not, I'm quite happy to make a start, and make some code
> available.
>
> Jonathan
>
>
> Gr8 Jonathan, and if you can transfer this knowledge to us it would be gr8
>
> On 9/5/07, Jonathan Gallimore <jg...@wav2.com> wrote:
> >
> >
> > Hey guys,
> >
> > I'd be interested in contributing to this piece of work, and I have some
> > previous development experience with Eclipse plugins. Has anything been
> > setup to check out?
> >
> > Cheers
> >
> > Jon
> >
>
> --
> View this message in context: http://www.nabble.com/ejb-jar.xml-to-Annotations-tool-tf4325175.html#a12522132
> Sent from the OpenEJB Dev mailing list archive at Nabble.com.
>
>
--
Karan Singh Malhi
Re: ejb-jar.xml to Annotations tool
Posted by Jonathan Gallimore <jg...@wav2.com>.
Sure thing. Have you made a start on specific plugin for this at all? The one
on the JIRA issue from Karan yesterday appeared to be adding Geronimo to the
Servers view? If not, I'm quite happy to make a start, and make some code
available.
Jonathan
Gr8 Jonathan, and if you can transfer this knowledge to us it would be gr8
On 9/5/07, Jonathan Gallimore <jg...@wav2.com> wrote:
>
>
> Hey guys,
>
> I'd be interested in contributing to this piece of work, and I have some
> previous development experience with Eclipse plugins. Has anything been
> setup to check out?
>
> Cheers
>
> Jon
>
--
View this message in context: http://www.nabble.com/ejb-jar.xml-to-Annotations-tool-tf4325175.html#a12522132
Sent from the OpenEJB Dev mailing list archive at Nabble.com.
Re: ejb-jar.xml to Annotations tool
Posted by Mohammad Nour El-Din <no...@gmail.com>.
Gr8 Jonathan, and if you can transfer this knowledge to us it would be gr8
On 9/5/07, Jonathan Gallimore <jg...@wav2.com> wrote:
>
>
> Hey guys,
>
> I'd be interested in contributing to this piece of work, and I have some
> previous development experience with Eclipse plugins. Has anything been
> setup to check out?
>
> Cheers
>
> Jon
>
>
>
> On Aug 28, 2007, at 3:01 AM, Mohammad Nour El-Din wrote:
>
> > gr8, we can start reading about Eclipse plugins together and start
> > doing the
> > simple idea u explained, I suggest we start reading how to extebd
> > the WST
> > first, I think Jeremy has sent an e-mail about that b4, I will
> > search for
> > this article and will send it back to you :) .
>
> I don't really have much interest in Eclipse, but I can certainly
> help on the core part of the tool that creates the annotation model
> from the xml.
>
> -David
>
>
>
> --
> View this message in context:
> http://www.nabble.com/ejb-jar.xml-to-Annotations-tool-tf4325175.html#a12498749
> Sent from the OpenEJB Dev mailing list archive at Nabble.com.
>
>
--
Thanks
- Mohammad Nour
Re: ejb-jar.xml to Annotations tool
Posted by Karan Malhi <ka...@gmail.com>.
Check this out : https://issues.apache.org/jira/browse/OPENEJB-674
On 9/5/07, Jonathan Gallimore <jg...@wav2.com> wrote:
>
> Hey guys,
>
> I'd be interested in contributing to this piece of work, and I have some
> previous development experience with Eclipse plugins. Has anything been
> setup to check out?
>
> Cheers
>
> Jon
>
>
>
> On Aug 28, 2007, at 3:01 AM, Mohammad Nour El-Din wrote:
>
> > gr8, we can start reading about Eclipse plugins together and start
> > doing the
> > simple idea u explained, I suggest we start reading how to extebd
> > the WST
> > first, I think Jeremy has sent an e-mail about that b4, I will
> > search for
> > this article and will send it back to you :) .
>
> I don't really have much interest in Eclipse, but I can certainly
> help on the core part of the tool that creates the annotation model
> from the xml.
>
> -David
>
>
>
> --
> View this message in context: http://www.nabble.com/ejb-jar.xml-to-Annotations-tool-tf4325175.html#a12498749
> Sent from the OpenEJB Dev mailing list archive at Nabble.com.
>
>
--
Karan Singh Malhi