OK, I'll try your suggestions. Now I'm facing build problems:
I checked out 3.1.1 snapshot, ran maven -Dassembly clean install, got two
issues:
1. File
openejb3\examples\injection-of-env-entry\target\classes\META-INF\ejb-jar.xml
contains wrong encoding (US-ASCII). As I understand, svn puts this line:
<!-- $Rev: 649752 $ $Date: 2008-04-19 06:59:15 +0300 (Št, 19 Bal 2008) $ -->
And as you see, at the end there is localized date with native language
(Lithuanian) character, this breaks US-ASCII encoding. Changing to UTF-8
solves the problem.
2. Build stopped with the error:
[INFO]
------------------------------------------------------------------------
[INFO] Building OpenEJB :: Assembly :: Tomcat :: Loader
[INFO] task-segment: [install]
[INFO]
------------------------------------------------------------------------
[INFO] [remote-resources:process {execution: default}]
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Compiling 4 source files to
D:\dev\proj\RRT\workspace\OpenEJBProject\openejb3\assembly\openejb-tomcat\op
enejb-tomcat-loader\target\cl
asses
[INFO] [dependency-report:report {execution: default}]
[INFO] [bundle:manifest {execution: bundle-manifest}]
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [surefire:test]
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] No Java test frameworks found
[INFO]
------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 22 minutes 16 seconds
[INFO] Finished at: Sat Jan 31 00:41:06 EET 2009
[INFO] Final Memory: 52M/63M
[INFO]
------------------------------------------------------------------------
Seems that some dependency is missing?
Regards,
Donatas
-----Original Message-----
From: David Blevins [mailto:[email protected]]
Sent: Thursday, January 29, 2009 12:28 AM
To: [email protected]
Subject: Re: Using OpenEJB in Eclipse RCP application
On Jan 27, 2009, at 10:38 AM, Donatas Ciuksys wrote:
> OK.
>
> I have an idea how I could make it run in Eclipse RCP environment,
> just need
> little your (devs) guidance. I have read the other thread about
> integration
> to OSGi, my goal is somewhat smaller:
>
> As I understand, OpenEJB does two things:
> 1. Scans classpath trying identify all the resources to be analysed
> (classes, archives, ...)
> 2. Analyses each found resource whether it is an EJB component
> (possibly JPA
> entity too, though this could be Hibernate's job)
> 3. Loads identified resources by classloader.loadClass() or similar
>
> Since we have problem with step 1, steps 2&3 do not start (obviously).
>
> In my scenario I do not need step 1, I could start with step 2
> providing
> exact class names (e.g. com.mycompany.MySessionBean) that are EJB
> components. Step 3 should succeed since I'm using Eclipse-
> BuddyPolicy (or I
> could even place the classes to the same bundle as OpenEJB itself).
>
> So my question is: is it possible, and in what source place should I
> look
> for, to skip the classpath scan and to just provide my list of class
> names?
>
> Thanks for your patience,
Thank *you* for your patience :) We definitely need some work on the
OSGi support.
Setting openejb.deployments.classpath=false will disable the classpath
scanning for modules, but it will still be active for looking for ejb
classes. That code should just issue a warning saying "Unable to
scrape for ..." and continue. If it doesn't we'll need to fix that.
Listing classes is best done in the ejb-jar.xml. At minimum you have
to specify the <ejb-name> and <ejb-class> elements for each ejb. We
currently will "scrape" your META-INF dir for all files rather than go
for each descriptor individually, but that isn't critical, we can
easily update that part to go directly at the files we are looking for
which should work with a "bundle:" URL.
You ok with testing out the 3.1.1 snapshot? Can publish one for you
if you need it.
-David
>
> Donatas
>
> -----Original Message-----
> From: Daniel S. Haischt [mailto:[email protected]]
> Sent: Monday, January 26, 2009 4:40 PM
> To: [email protected]
> Subject: Re: Using OpenEJB in Eclipse RCP application
>
> We can't simply copy & paste code from Hibernate cause it's a LGPLed
> project.
>
> 2009/1/26 Donatas Ciuksys <[email protected]>:
>> Hi Oliver,
>>
>> Thanks for straight answer. That will save my efforts to run it.
>>
>> Just for discussion:
>>
>> Hibernate (EntityManager) runs in OSGi, so it must have some
>> bundle://
>> protocol handling functionality, and it is open-source. Since the
>> problem
> is
>> the same (classpath scanning), is it possible/feasible to try to
>> find this
>> functionality, and to plug it into OpenEJB?
>>
>> Regards,
>> Donatas
>>
>> -----Original Message-----
>> From: Oliver Günther [mailto:[email protected]]
>> Sent: Monday, January 26, 2009 2:29 PM
>> To: [email protected]
>> Subject: Re: Using OpenEJB in Eclipse RCP application
>>
>> Hi,
>>
>> to make something long very short. OpenEJB does not run in an OSGi
>> environment (e.g. Eclipse RCP), neither local nor remote.
>>
>> The little bit longer one.
>> OpenEJB makes heavy usage of the of Resource (JAR) finding through
>> the
>> Classloader.
>> Eclipse (OSGi) uses different Classloaders, which do not support the
>> classic way of Resource finding.
>> The NullPointerException is caused by the OpenEJB, by getting an OSGI
>> Resource String
>> (e.g. Expects something like /home/OpenEJB/xxx.jar, gets :
>> bundle://42:22/ )
>>
>> You can overcome this by setting a special OpenEJB option, which
>> disables the classpath inspection.
>> But then you get completely stuck, if you try to let openejb start
>> you
>> EJBs, because it uses the same algorithm to find them.
>>
>> There is an ongoing thread about the OSGi integration, but the team
>> seams to have other priorities, so don't expect it to run
>> anytime soon.
>>
>> PS: Don't try to get it to run in remote mode. The OpenEJB client has
>> also some classloading issues, which will not work in Eclipse.
>>
>> -
>> Olli
>>
>>
>>
>
>
>