Re: testing for running OpenEJB server

2011-02-22 Thread joe

Hi,


If you are running it on a linux box, check this link.

http://stackoverflow.com/questions/2735926/how-to-capture-pid-of-a-linux-daemon-run-from-init-d


Hm i am looking for ease of use and in a more platform independet way.
I hoped for a feature directly supported by the container.

Currently i am thinking of writing two Java methods:

boolean isContainerRunning()

1. connect to ejbd port
2. if succesful: return true, otherwise false

boolean areEJBsInvocable()

1. invoke EJB method
2. if result is as expected return true, otherwise false


Would this be a reasonable approach?



Application discovery via the classpath

2011-02-22 Thread cristic83

Hi guys,

I have a package structure of my EJBs(sateless and MDBs) like this: test,
test.pdf and test.scheduling. The packages test.scheduling contains some
MDBs that I want to remove from being loaded into my container, so I wanted
to remove all the classes from the test.scheduling package but keep
everything else from the packages test, test.pdf and all other subpackages. 
In order to do so, I have been trying to use the including/excluding paths
approach as described here:
http://openejb.apache.org/3.0/application-discovery-via-the-classpath.html

The code I used looks like this:

Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,
"org.apache.openejb.client.LocalInitialContextFactory");
p.put("openejb.deployments.classpath.filter.descriptors", "true");//use
ejb-jar for ejbs discovery p.put("openejb.deployments.classpath.exclude",
"file:target/classes/test/pdf/");

This doesn't seem to work because I get the following warning:
WARN - Jar not loaded. classpath.ear.  No provider available for
resource-ref 'null' of type 'javax.jms.Destination' for
'MonthlyReportTrigger'.

MonthlyReportTrigger is one fo my MDBs from the test.scheduling package that
I expected to be excluded. 
After this, the code tries to lookup an ejb in the context which fails with
a NameNotFoundException exception.

Can you point me the right direction to go?(google didn't help ).
 
-- 
View this message in context: 
http://openejb.979440.n4.nabble.com/Application-discovery-via-the-classpath-tp3318799p3318799.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


obtaining the principal from a client certificate

2011-02-22 Thread vlad.balan

Does openejb support obtaining the principal from a client certificate?

-- 
View this message in context: 
http://openejb.979440.n4.nabble.com/obtaining-the-principal-from-a-client-certificate-tp3318825p3318825.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Re: NoClassDefFoundError: Could not fully load class

2011-02-22 Thread Thiago Veronezi
You can mount it from the source code...
check the "Building" section of this page for more info (assemble option):
http://openejb.apache.org/source-code.html

[]s,
Thiago.

On Tue, Feb 22, 2011 at 3:27 AM, Nicola Dellisanti <
nicola.dellisa...@gmail.com> wrote:

> Hi Jon,
>
> Ok for TommEE bundled (Tomcat/OpenEJB bundle) based on OpenEJB
> 3.2-SNAPSHOT.
> How can I get it?
>
> N.
>
> 2011/2/18 Jonathan Gallimore 
>
> > I think Jean-Louis or David will be able to give a better answer, but if
> I
> > remember correctly our current trunk branch (3.2-SNAPSHOT) has JPA 2.0
> > support, but it isn't 3.1.x. 3.2 isn't officially released yet, but it
> might
> > be worth giving a snapshot a go. Please let us know how you get on if you
> > do.
> >
> > I can build you a TomEE bundle (Tomcat/OpenEJB bundle) based on OpenEJB
> > 3.2-SNAPSHOT for you to try deploying your app on if that's any use.
> >
> > Hope that helps.
> >
> > Jon
> >
> >
> > On 18/02/2011 10:04, Nicola Dellisanti wrote:
> >
> >> Hi,
> >>
> >> I had the error "NoClassDefFoundError: Could not fully load class" and I
> >> saw
> >> in
> >>
> >>
> >>
> http://www.opensubscriber.com/message/users@openejb.apache.org/13758726.html
> >> that Jpa 2.0 is not supported by OpenEJB. It's true again today? I have
> to
> >> use JPA 1.0 in OpenEJB 3.1.4 ?
> >> I do not have @ManagedBean annotation for my managed-bean
> >>
> >> I have my ejb in a jar (under webapp), and I have my web application in
> a
> >> war file (under webapp).
> >> My tomcat version is 6.0.32
> >> My OpenEjB version is 3.1.4
> >> I use eclipselink 2.1
> >>
> >> this is my catalina.log
> >> 18-feb-2011 10.50.54 org.apache.catalina.core.AprLifecycleListener init
> >> INFO: Loaded APR based Apache Tomcat Native library 1.1.20.
> >> 18-feb-2011 10.50.54 org.apache.catalina.core.AprLifecycleListener init
> >> INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters
> >> [false], random [true].
> >> 18-feb-2011 10.51.00 org.apache.coyote.http11.Http11AprProtocol init
> >> INFO: Initializing Coyote HTTP/1.1 on http-8080
> >> 18-feb-2011 10.51.00 org.apache.coyote.ajp.AjpAprProtocol init
> >> INFO: Initializing Coyote AJP/1.3 on ajp-8009
> >> 18-feb-2011 10.51.00 org.apache.catalina.startup.Catalina load
> >> INFO: Initialization processed in 6663 ms
> >> 18-feb-2011 10.51.00 org.apache.catalina.core.StandardService start
> >> INFO: Starting service Catalina
> >> 18-feb-2011 10.51.00 org.apache.catalina.core.StandardEngine start
> >> INFO: Starting Servlet Engine: Apache Tomcat/6.0.32
> >> 18-feb-2011 10.51.00 org.apache.catalina.startup.HostConfig
> >> deployDescriptor
> >> INFO: Deploying configuration descriptor host-manager.xml
> >> 18-feb-2011 10.51.02 org.apache.catalina.startup.HostConfig
> >> deployDescriptor
> >> INFO: Deploying configuration descriptor manager.xml
> >> 18-feb-2011 10.51.02 org.apache.catalina.startup.HostConfig
> >> deployDescriptor
> >> INFO: Deploying configuration descriptor openejb.xml
> >> 18-feb-2011 10.51.03 org.apache.catalina.startup.HostConfig
> >> deployDescriptor
> >> INFO: Deploying configuration descriptor test.xml
> >> 18-feb-2011 10.51.03 org.apache.catalina.startup.HostConfig
> >> deployDescriptor
> >> AVVERTENZA: A docBase C:\Programmi\apache-tomcat-6.0.32\webapps\DBTest
> >> inside the host appBase has been specified, and will be ignored
> >> 18-feb-2011 10.51.06 org.apache.catalina.startup.HostConfig
> >> deployDescriptor
> >> GRAVE: Error deploying configuration descriptor test.xml
> >> java.lang.NoClassDefFoundError: Could not fully load class:
> >> it.het.richtest.testbackingbean.TestBackingBean
> >>  due to:it/het/richtest/ejb/RichTestEJB
> >>  in classLoader:
> >> org.apache.openejb.core.TempClassLoader@1791620
> >>  at org.apache.xbean.finder.ClassFinder.(ClassFinder.java:161)
> >>  at
> >>
> >>
> org.apache.openejb.config.AnnotationDeployer$ProcessAnnotatedBeans.createInheritedClassFinder(AnnotationDeployer.java:3240)
> >>  at
> >>
> >>
> org.apache.openejb.config.AnnotationDeployer$ProcessAnnotatedBeans.deploy(AnnotationDeployer.java:1028)
> >>  at
> >>
> >>
> org.apache.openejb.config.AnnotationDeployer.deploy(AnnotationDeployer.java:206)
> >>  at
> >>
> >>
> org.apache.openejb.tomcat.catalina.TomcatWebAppBuilder.createWebModule(TomcatWebAppBuilder.java:662)
> >>  at
> >>
> >>
> org.apache.openejb.tomcat.catalina.TomcatWebAppBuilder.loadApplication(TomcatWebAppBuilder.java:541)
> >>  at
> >>
> >>
> org.apache.openejb.tomcat.catalina.TomcatWebAppBuilder.start(TomcatWebAppBuilder.java:242)
> >>  at
> >>
> >>
> org.apache.openejb.tomcat.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:58)
> >>  at
> >>
> >>
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
> >>  at
> >>
> org.apache.catalina.core.StandardContext.start(StandardContext.java:4611)
> >>  at
> >>
> >>
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBas

Re: NoClassDefFoundError: Could not fully load class

2011-02-22 Thread Jonathan Gallimore
I've got a fairly recent TomEE Tomcat 7 build here:
http://people.apache.org/~jgallimore/tomee7/

I'll upload a build of the latest trunk later on.

Jon

On Tue, Feb 22, 2011 at 12:32 PM, Thiago Veronezi wrote:

> You can mount it from the source code...
> check the "Building" section of this page for more info (assemble option):
> http://openejb.apache.org/source-code.html
>
> []s,
> Thiago.
>
> On Tue, Feb 22, 2011 at 3:27 AM, Nicola Dellisanti <
> nicola.dellisa...@gmail.com> wrote:
>
> > Hi Jon,
> >
> > Ok for TommEE bundled (Tomcat/OpenEJB bundle) based on OpenEJB
> > 3.2-SNAPSHOT.
> > How can I get it?
> >
> > N.
> >
> > 2011/2/18 Jonathan Gallimore 
> >
> > > I think Jean-Louis or David will be able to give a better answer, but
> if
> > I
> > > remember correctly our current trunk branch (3.2-SNAPSHOT) has JPA 2.0
> > > support, but it isn't 3.1.x. 3.2 isn't officially released yet, but it
> > might
> > > be worth giving a snapshot a go. Please let us know how you get on if
> you
> > > do.
> > >
> > > I can build you a TomEE bundle (Tomcat/OpenEJB bundle) based on OpenEJB
> > > 3.2-SNAPSHOT for you to try deploying your app on if that's any use.
> > >
> > > Hope that helps.
> > >
> > > Jon
> > >
> > >
> > > On 18/02/2011 10:04, Nicola Dellisanti wrote:
> > >
> > >> Hi,
> > >>
> > >> I had the error "NoClassDefFoundError: Could not fully load class" and
> I
> > >> saw
> > >> in
> > >>
> > >>
> > >>
> >
> http://www.opensubscriber.com/message/users@openejb.apache.org/13758726.html
> > >> that Jpa 2.0 is not supported by OpenEJB. It's true again today? I
> have
> > to
> > >> use JPA 1.0 in OpenEJB 3.1.4 ?
> > >> I do not have @ManagedBean annotation for my managed-bean
> > >>
> > >> I have my ejb in a jar (under webapp), and I have my web application
> in
> > a
> > >> war file (under webapp).
> > >> My tomcat version is 6.0.32
> > >> My OpenEjB version is 3.1.4
> > >> I use eclipselink 2.1
> > >>
> > >> this is my catalina.log
> > >> 18-feb-2011 10.50.54 org.apache.catalina.core.AprLifecycleListener
> init
> > >> INFO: Loaded APR based Apache Tomcat Native library 1.1.20.
> > >> 18-feb-2011 10.50.54 org.apache.catalina.core.AprLifecycleListener
> init
> > >> INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters
> > >> [false], random [true].
> > >> 18-feb-2011 10.51.00 org.apache.coyote.http11.Http11AprProtocol init
> > >> INFO: Initializing Coyote HTTP/1.1 on http-8080
> > >> 18-feb-2011 10.51.00 org.apache.coyote.ajp.AjpAprProtocol init
> > >> INFO: Initializing Coyote AJP/1.3 on ajp-8009
> > >> 18-feb-2011 10.51.00 org.apache.catalina.startup.Catalina load
> > >> INFO: Initialization processed in 6663 ms
> > >> 18-feb-2011 10.51.00 org.apache.catalina.core.StandardService start
> > >> INFO: Starting service Catalina
> > >> 18-feb-2011 10.51.00 org.apache.catalina.core.StandardEngine start
> > >> INFO: Starting Servlet Engine: Apache Tomcat/6.0.32
> > >> 18-feb-2011 10.51.00 org.apache.catalina.startup.HostConfig
> > >> deployDescriptor
> > >> INFO: Deploying configuration descriptor host-manager.xml
> > >> 18-feb-2011 10.51.02 org.apache.catalina.startup.HostConfig
> > >> deployDescriptor
> > >> INFO: Deploying configuration descriptor manager.xml
> > >> 18-feb-2011 10.51.02 org.apache.catalina.startup.HostConfig
> > >> deployDescriptor
> > >> INFO: Deploying configuration descriptor openejb.xml
> > >> 18-feb-2011 10.51.03 org.apache.catalina.startup.HostConfig
> > >> deployDescriptor
> > >> INFO: Deploying configuration descriptor test.xml
> > >> 18-feb-2011 10.51.03 org.apache.catalina.startup.HostConfig
> > >> deployDescriptor
> > >> AVVERTENZA: A docBase C:\Programmi\apache-tomcat-6.0.32\webapps\DBTest
> > >> inside the host appBase has been specified, and will be ignored
> > >> 18-feb-2011 10.51.06 org.apache.catalina.startup.HostConfig
> > >> deployDescriptor
> > >> GRAVE: Error deploying configuration descriptor test.xml
> > >> java.lang.NoClassDefFoundError: Could not fully load class:
> > >> it.het.richtest.testbackingbean.TestBackingBean
> > >>  due to:it/het/richtest/ejb/RichTestEJB
> > >>  in classLoader:
> > >> org.apache.openejb.core.TempClassLoader@1791620
> > >>  at org.apache.xbean.finder.ClassFinder.(ClassFinder.java:161)
> > >>  at
> > >>
> > >>
> >
> org.apache.openejb.config.AnnotationDeployer$ProcessAnnotatedBeans.createInheritedClassFinder(AnnotationDeployer.java:3240)
> > >>  at
> > >>
> > >>
> >
> org.apache.openejb.config.AnnotationDeployer$ProcessAnnotatedBeans.deploy(AnnotationDeployer.java:1028)
> > >>  at
> > >>
> > >>
> >
> org.apache.openejb.config.AnnotationDeployer.deploy(AnnotationDeployer.java:206)
> > >>  at
> > >>
> > >>
> >
> org.apache.openejb.tomcat.catalina.TomcatWebAppBuilder.createWebModule(TomcatWebAppBuilder.java:662)
> > >>  at
> > >>
> > >>
> >
> org.apache.openejb.tomcat.catalina.TomcatWebAppBuilder.loadApplication(TomcatWebAppBuilder.java:541)
> > >>  at
> > >>
> > >>
> >
> org.apache.openejb

MDB with quartz and jms

2011-02-22 Thread cristic83

Hi guys,

I want to use OpenEJb to test an  MDB which implements the quartz Job
interface and also uses a jms Queue and Connection Factory. I have looked
into the mdb and quartz-ra examples from the openEJB project and placed the
ra.xml file that is used into the quartz-ra example into the folder
src/test/resources/META-INF. When I ran my test case I got the following
output into the log:

INFO: OpenWebBeans Container is starting...
Feb 22, 2011 4:56:59 PM org.apache.webbeans.plugins.PluginLoader
startApplication
INFO: Adding OpenWebBeansPlugin : [CdiPlugin]
Feb 22, 2011 4:56:59 PM org.apache.openejb.cdi.BeansDeployer
startApplication
INFO: All injection points were validated successfully.
Feb 22, 2011 4:56:59 PM org.apache.openejb.cdi.OpenEJBLifecycle initialize
INFO: OpenWebBeans Container has started, it took [181] ms.

ERROR - Application could not be deployed:  classpath.ear
org.apache.openejb.OpenEJBException: Creating application failed:
classpath.ear: Error deploying 'MailSender'.  Exception: class
org.apache.openejb.OpenEJBException: Unable to create activation spec: No
setter found for the activation spec properties: [dLQMaxResent]: Unable to
create activation spec: No setter found for the activation spec properties:
[dLQMaxResent]

...

Caused by: org.apache.openejb.OpenEJBException: Error deploying
'MailSender'.  Exception: class org.apache.openejb.OpenEJBException: Unable
to create activation spec: No setter found for the activation spec
properties: [dLQMaxResent]: Unable to create activation spec: No setter
found for the activation spec properties: [dLQMaxResent]
at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:665)
... 45 more

Also, if instead of a jms Queue I use a Destination in my MDB I get the
following error:

WARN - Jar not loaded. classpath.ear.  No provider available for
resource-ref 'null' of type 'javax.jms.Destination' for
'MonthlyReportTrigger'.
org.apache.openejb.OpenEJBException: No provider available for resource-ref
'null' of type 'javax.jms.Destination' for 'MonthlyReportTrigger'.

Can you tell me what am I missing in order to make this work?
-- 
View this message in context: 
http://openejb.979440.n4.nabble.com/MDB-with-quartz-and-jms-tp3319390p3319390.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Re: testing for running OpenEJB server

2011-02-22 Thread Thiago Veronezi
Hmmm... this way you could get bad results if your server is running on
another port.
I've found another way to check of running VMs... It can help you to find
what you want...


public void runningVMs() throws MonitorException, URISyntaxException {
MonitoredHost monitoredHost = MonitoredHost.getMonitoredHost("localhost");
  Set activeVms = monitoredHost.activeVms();
  for (int psId : activeVms)
  {
 MonitoredVm monitoredVm = monitoredHost.getMonitoredVm(new
VmIdentifier(String.valueOf(psId)));
 String mainClass = MonitoredVmUtil.mainClass(monitoredVm, false);
 System.out.println(mainClass + " [" + psId + "]");
  }
}
***


  com.sun
  tools
  1.4.2
  system
  c:/dev/jdk1.6.0_24/lib/tools.jar




[]s,
Thiago


On Tue, Feb 22, 2011 at 3:25 AM, joe  wrote:

> Hi,
>
>
>  If you are running it on a linux box, check this link.
>>
>>
>> http://stackoverflow.com/questions/2735926/how-to-capture-pid-of-a-linux-daemon-run-from-init-d
>>
>
> Hm i am looking for ease of use and in a more platform independet way.
> I hoped for a feature directly supported by the container.
>
> Currently i am thinking of writing two Java methods:
>
> boolean isContainerRunning()
>
> 1. connect to ejbd port
> 2. if succesful: return true, otherwise false
>
> boolean areEJBsInvocable()
>
> 1. invoke EJB method
> 2. if result is as expected return true, otherwise false
>
>
> Would this be a reasonable approach?
>
>


Re: testing for running OpenEJB server

2011-02-22 Thread Thiago Veronezi
ps.: from http://jroller.com/ethdsy/entry/list_the_running_vms

On Tue, Feb 22, 2011 at 12:31 PM, Thiago Veronezi wrote:

> Hmmm... this way you could get bad results if your server is running on
> another port.
> I've found another way to check of running VMs... It can help you to find
> what you want...
>
>
> 
>  public void runningVMs() throws MonitorException, URISyntaxException {
> MonitoredHost monitoredHost = MonitoredHost.getMonitoredHost("localhost");
>   Set activeVms = monitoredHost.activeVms();
>   for (int psId : activeVms)
>   {
>  MonitoredVm monitoredVm = monitoredHost.getMonitoredVm(new
> VmIdentifier(String.valueOf(psId)));
>  String mainClass = MonitoredVmUtil.mainClass(monitoredVm, false);
>  System.out.println(mainClass + " [" + psId + "]");
>   }
> }
> ***
>
> 
>   com.sun
>   tools
>   1.4.2
>   system
>   c:/dev/jdk1.6.0_24/lib/tools.jar
> 
>
>
>
> []s,
> Thiago
>
>
> On Tue, Feb 22, 2011 at 3:25 AM, joe  wrote:
>
>> Hi,
>>
>>
>>  If you are running it on a linux box, check this link.
>>>
>>>
>>> http://stackoverflow.com/questions/2735926/how-to-capture-pid-of-a-linux-daemon-run-from-init-d
>>>
>>
>> Hm i am looking for ease of use and in a more platform independet way.
>> I hoped for a feature directly supported by the container.
>>
>> Currently i am thinking of writing two Java methods:
>>
>> boolean isContainerRunning()
>>
>> 1. connect to ejbd port
>> 2. if succesful: return true, otherwise false
>>
>> boolean areEJBsInvocable()
>>
>> 1. invoke EJB method
>> 2. if result is as expected return true, otherwise false
>>
>>
>> Would this be a reasonable approach?
>>
>>
>


Starting OpenEJB as Java application in Eclipse

2011-02-22 Thread Neo Larkin

Hi,
 
I am trying to start the openejb container as an embedded server. I want to run 
it as a java application in Eclipse without using the server runtime.
 
Do I use the org.apache.openejb.cli.Bootstrap class?
 
Thanks