Re: Problem with Dates in web service

2009-05-25 Thread David Blevins
Seems like a bug in the jaxb ri.  I guess from where you're at now  
what I'd recommend is to see if you can replicate the issue in a test  
case that doesn't use OpenEJB or web services (CXF).


Maybe create a JAXB class, 'MyDocument' or something, that has a  
single field of type Date2 then create a test case that does a simple  
JAXBContext.newInstance(MyDocument.class) and then attempts to  
marshall and unmarshall an instance of MyDocument using the  
jaxbContext.  That should allow you to get right to the issue and  
potentially rule out anything OpenEJB or CXF related.


If it still fails then I'd send your test case to the JAXB RI as a bug  
report.


-David

On May 25, 2009, at 8:51 PM, Maaku wrote:



This is getting frustrating, I'm trying to create a web service  
which returns

a custom date.

I've extended java.util.Date and I'm getting

com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl$5 cannot  
be cast

to com.sun.xml.bind.v2.model.impl.ClassInfoImpl

At first, I thought it was because of the fields/methods that I have  
but
then I tried removing all fields and methods and it still gives the  
same

exception

*my class
@WebService (
   portName = "TestWebServicePort",
   serviceName = "TestWebService",
   targetNamespace = "http://xxx.com/wsdl";,
   endpointInterface = "com.xxx.TestWebService")
@Stateless
public class TestServiceBean implements TestWebService {
 public Date2 getDate() {
return null;
 }
}
@WebService (targetNamespace = "http://xxx.com/wsdl";)
public interface TestWebService {

   public Date2 getDate();

}

public class Date2 extends Date implements Serializable {
}

Without this Date2 my web service is working ok.


Found a similar problem but i can't just use java.util.Date
http://www.ibm.com/developerworks/forums/thread.jspa?threadID=248225&tstart=0

Any help will be much appreciated

--
View this message in context: 
http://www.nabble.com/Problem-with-Dates-in-web-service-tp23716455p23716455.html
Sent from the OpenEJB User mailing list archive at Nabble.com.






Re: building MDB with Eclipse using openEJB embeded in Tomcat

2009-05-25 Thread Mho

Thank you. That worked.  I appreciate your help.

Best regards
Mho


Mho wrote:
> 
> Hello,
> I am new to openEJB and Eclipse. I am not new to Tomcat.
> I am porting an application that used to run under JBOSS and it appears
> that openEJB/Tomcat should be just a great environment.
> 
> I am using Eclipse with WTP and have successfully loaded up Tomcat with
> OpenEJB and now I am trying to bring on line the MDB.
> 
> What I can't figure out is where I would put the XML that describes the
> queue for the MDB For example in JBOSS I would have a file that would look
> like 
> 
>name="jboss.mq.destination:service=Queue,name=myqueueName">
>  optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager
>   
> 
> Any help would be appreciated
> Thanks
> Mho
> 

-- 
View this message in context: 
http://www.nabble.com/building-MDB-with-Eclipse-using-openEJB-embeded-in-Tomcat-tp23715480p23716581.html
Sent from the OpenEJB User mailing list archive at Nabble.com.



Re: building MDB with Eclipse using openEJB embeded in Tomcat

2009-05-25 Thread David Blevins


On May 25, 2009, at 8:37 PM, Mho wrote:



Thank you that explanation makes sense.

I added those and then found out that ejb.jar (or at least the copy  
that I

could find) does not include javax.ejb.MessageDriven or
javax.ejb.ActivationConfigProperty.

I found ejb-3_0-api.jar at
http://java.sun.com/products/ejb/docs.html under 3.0 Final release  
(download

class files) --> ejb-3_0-fr-api.zip
and that zip file expands into ejb-3_0-api.jar that includes those  
class
files and makes the compiler happy. However by all rights this  
qualifies as

beeing burried deep and I am wondering if I am really lost.

Is there a place where the appropriate libraries for ejb 3.0 are kept?


The javaee-api-5.0-1.jar in our distribution contains that and all the  
other Java EE 5 libraries.


Can also pull it down from here:

 
http://repo2.maven.org/maven2/org/apache/openejb/javaee-api/5.0-1/javaee-api-5.0-1.jar

-David




David Blevins wrote:



On May 25, 2009, at 6:15 PM, Mho wrote:



Hello,
I am new to openEJB and Eclipse. I am not new to Tomcat.
I am porting an application that used to run under JBOSS and it
appears that
openEJB/Tomcat should be just a great environment.

I am using Eclipse with WTP and have successfully loaded up Tomcat
with
OpenEJB and now I am trying to bring on line the MDB.

What I can't figure out is where I would put the XML that describes
the
queue for the MDB For example in JBOSS I would have a file that
would look
like


  jboss.mq:service=DestinationManager


There are a couple options for specifying the queue name for an MDB.

The first is to name the MDB after the queue and we will  
automatically
hook the bean up to the queue with that name.  So if the queue name  
is

"DestinationManager", it'd be like so:

   @MessageDriven
   public class DestinationManager implements MessageListener {
  //...
   }

or ...

   @MessageDriven(name = "DestinationManager")
   public class MyMdbBean implements MessageListener {
  //...
   }

The other option is to use an ActivationConfig like so:

   @MessageDriven(activationConfig = {
 @ActivationConfigProperty(propertyName="destinationType",
propertyValue = "javax.jms.Queue"),
 @ActivationConfigProperty(propertyName="destination",
propertyValue = "DestinationManager")})
   public class MyMdbBean implements MessageListener {
  //...
   }

Hope this helps!


-David





--
View this message in context: 
http://www.nabble.com/building-MDB-with-Eclipse-using-openEJB-embeded-in-Tomcat-tp23715480p23716386.html
Sent from the OpenEJB User mailing list archive at Nabble.com.






Problem with Dates in web service

2009-05-25 Thread Maaku

This is getting frustrating, I'm trying to create a web service which returns
a custom date.

I've extended java.util.Date and I'm getting 

com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl$5 cannot be cast
to com.sun.xml.bind.v2.model.impl.ClassInfoImpl

At first, I thought it was because of the fields/methods that I have but
then I tried removing all fields and methods and it still gives the same
exception

*my class
@WebService (
portName = "TestWebServicePort",
serviceName = "TestWebService",
targetNamespace = "http://xxx.com/wsdl";,
endpointInterface = "com.xxx.TestWebService")
@Stateless
public class TestServiceBean implements TestWebService {
  public Date2 getDate() {
return null;
  }
}
@WebService (targetNamespace = "http://xxx.com/wsdl";)
public interface TestWebService {

public Date2 getDate();

}

public class Date2 extends Date implements Serializable {
}

Without this Date2 my web service is working ok.


Found a similar problem but i can't just use java.util.Date
http://www.ibm.com/developerworks/forums/thread.jspa?threadID=248225&tstart=0

Any help will be much appreciated

-- 
View this message in context: 
http://www.nabble.com/Problem-with-Dates-in-web-service-tp23716455p23716455.html
Sent from the OpenEJB User mailing list archive at Nabble.com.



Re: building MDB with Eclipse using openEJB embeded in Tomcat

2009-05-25 Thread Mho

Thank you that explanation makes sense.

I added those and then found out that ejb.jar (or at least the copy that I
could find) does not include javax.ejb.MessageDriven or
javax.ejb.ActivationConfigProperty. 

I found ejb-3_0-api.jar at 
http://java.sun.com/products/ejb/docs.html under 3.0 Final release (download
class files) --> ejb-3_0-fr-api.zip 
and that zip file expands into ejb-3_0-api.jar that includes those class
files and makes the compiler happy. However by all rights this qualifies as
beeing burried deep and I am wondering if I am really lost.

Is there a place where the appropriate libraries for ejb 3.0 are kept?
 
Thanks again for your help.
Mho


David Blevins wrote:
> 
> 
> On May 25, 2009, at 6:15 PM, Mho wrote:
> 
>>
>> Hello,
>> I am new to openEJB and Eclipse. I am not new to Tomcat.
>> I am porting an application that used to run under JBOSS and it  
>> appears that
>> openEJB/Tomcat should be just a great environment.
>>
>> I am using Eclipse with WTP and have successfully loaded up Tomcat  
>> with
>> OpenEJB and now I am trying to bring on line the MDB.
>>
>> What I can't figure out is where I would put the XML that describes  
>> the
>> queue for the MDB For example in JBOSS I would have a file that  
>> would look
>> like
>>
>>
>>jboss.mq:service=DestinationManager
> 
> There are a couple options for specifying the queue name for an MDB.
> 
> The first is to name the MDB after the queue and we will automatically  
> hook the bean up to the queue with that name.  So if the queue name is  
> "DestinationManager", it'd be like so:
> 
> @MessageDriven
> public class DestinationManager implements MessageListener {
>//...
> }
> 
> or ...
> 
> @MessageDriven(name = "DestinationManager")
> public class MyMdbBean implements MessageListener {
>//...
> }
> 
> The other option is to use an ActivationConfig like so:
> 
> @MessageDriven(activationConfig = {
>   @ActivationConfigProperty(propertyName="destinationType",  
> propertyValue = "javax.jms.Queue"),
>   @ActivationConfigProperty(propertyName="destination",  
> propertyValue = "DestinationManager")})
> public class MyMdbBean implements MessageListener {
>//...
> }
> 
> Hope this helps!
> 
> 
> -David
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/building-MDB-with-Eclipse-using-openEJB-embeded-in-Tomcat-tp23715480p23716386.html
Sent from the OpenEJB User mailing list archive at Nabble.com.



Re: building MDB with Eclipse using openEJB embeded in Tomcat

2009-05-25 Thread David Blevins


On May 25, 2009, at 6:15 PM, Mho wrote:



Hello,
I am new to openEJB and Eclipse. I am not new to Tomcat.
I am porting an application that used to run under JBOSS and it  
appears that

openEJB/Tomcat should be just a great environment.

I am using Eclipse with WTP and have successfully loaded up Tomcat  
with

OpenEJB and now I am trying to bring on line the MDB.

What I can't figure out is where I would put the XML that describes  
the
queue for the MDB For example in JBOSS I would have a file that  
would look

like


   jboss.mq:service=DestinationManager


There are a couple options for specifying the queue name for an MDB.

The first is to name the MDB after the queue and we will automatically  
hook the bean up to the queue with that name.  So if the queue name is  
"DestinationManager", it'd be like so:


   @MessageDriven
   public class DestinationManager implements MessageListener {
  //...
   }

or ...

   @MessageDriven(name = "DestinationManager")
   public class MyMdbBean implements MessageListener {
  //...
   }

The other option is to use an ActivationConfig like so:

   @MessageDriven(activationConfig = {
 @ActivationConfigProperty(propertyName="destinationType",  
propertyValue = "javax.jms.Queue"),
 @ActivationConfigProperty(propertyName="destination",  
propertyValue = "DestinationManager")})

   public class MyMdbBean implements MessageListener {
  //...
   }

Hope this helps!


-David



Re: building MDB with Eclipse using openEJB embeded in Tomcat

2009-05-25 Thread Mho

Sorry it looks like the mailer ate my XML script.
 what I meant to say was the JBOSS deployment descriptor looked like 
>server>
  < mbean code="org.jboss.mq.server.jmx.Queue"
 name="jboss.mq.destination:service=Queue,name=fclient">
jboss.mq:service=DestinationManager
  


Mho

Mho wrote:
> 
> Hello,
> I am new to openEJB and Eclipse. I am not new to Tomcat.
> I am porting an application that used to run under JBOSS and it appears
> that openEJB/Tomcat should be just a great environment.
> 
> I am using Eclipse with WTP and have successfully loaded up Tomcat with
> OpenEJB and now I am trying to bring on line the MDB.
> 
> What I can't figure out is where I would put the XML that describes the
> queue for the MDB For example in JBOSS I would have a file that would look
> like 
> 
>name="jboss.mq.destination:service=Queue,name=myqueueName">
>  optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager
>   
> 
> Any help would be appreciated
> Thanks
> Mho
> 

-- 
View this message in context: 
http://www.nabble.com/building-MDB-with-Eclipse-using-openEJB-embeded-in-Tomcat-tp23715480p23715582.html
Sent from the OpenEJB User mailing list archive at Nabble.com.



building MDB with Eclipse using openEJB embeded in Tomcat

2009-05-25 Thread Mho

Hello,
I am new to openEJB and Eclipse. I am not new to Tomcat.
I am porting an application that used to run under JBOSS and it appears that
openEJB/Tomcat should be just a great environment.

I am using Eclipse with WTP and have successfully loaded up Tomcat with
OpenEJB and now I am trying to bring on line the MDB.

What I can't figure out is where I would put the XML that describes the
queue for the MDB For example in JBOSS I would have a file that would look
like 

  
jboss.mq:service=DestinationManager
  

Any help would be appreciated
Thanks
Mho
-- 
View this message in context: 
http://www.nabble.com/building-MDB-with-Eclipse-using-openEJB-embeded-in-Tomcat-tp23715480p23715480.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Re: How to log in EJB

2009-05-25 Thread David Blevins


On May 24, 2009, at 8:19 AM, siegfried wrote:

When I run "mvn test" on the openejb examples I see lots of logging.  
Is
there a way for EJB log entries to appear mixed in with the client  
side log
entries that appear when I run the unit tests? That would be nice.  
If not,

how would I observe the log output?


Not sure I have a clear picture of what you need.

The way things are setup by default, all the examples run with OpenEJB  
embedded in the vm of the unit test and all the log output goes to the  
console with all the other maven log messages.  So all log output  
should be visible in the build output (which I guess is the client  
technically as everything runs in the same VM).


Is there something different that you would like?  Sure we can find a  
way to do what you need if we can get a better picture of what you're  
after.


-David



Re: Module with moduleId "hello.jar" does not exist.

2009-05-25 Thread David Blevins


On May 23, 2009, at 4:08 PM, siegfried wrote:


I can deploy just fine now -- at leaset with the hello world
example. To undeploy, however, I have to stop the server and delete
the jar file manually which is tedious!


When you run the deploy command it should print out the module Id of  
the app.  That's the name you use when undeploying.


For an app called "hello.jar" the module ID will be "hello".  Give  
'openejb undeploy hello' a try.


-David



Re: Database configuration on web application startup

2009-05-25 Thread Luis Fernando Planella Gonzalez
Yes, that should solve my problem.
In this case, the application name would be the servlet context path?
Another question: when the application is deployed in the server root url, 
which would be the app name? ROOT?
Anyway, since this seems a small addition to an already existing heuristic, and 
is generally useful (not only for my case), I've registered an issue at 
https://issues.apache.org/jira/browse/OPENEJB-1027

Luis Fernando Planella Gonzalez
lfpg@gmail.com
http://freeit.inf.br


Em Sexta-feira 22 Maio 2009, às 18:09:09, David Blevins escreveu:
> 
> On May 22, 2009, at 11:13 AM, Luis Fernando Planella Gonzalez wrote:
> 
> > * Several instances of the same application may be deployed in the  
> > same server. So, even that the user could create a data source in  
> > tomcat/conf/openejb.xml, he would have to change each application  
> > instance's META-INF/persistence.xml, which is packed inside a jar,  
> > inside another war. So, this is the showstopper. If weren't for  
> > this, it wouldn't be that bad to make the user set the data source  
> > in the tomcat file.
> 
> Still reading the email, but just wanted to post some initial thoughts  
> on this point.  We already don't require you to explicitly set the  
> data source names in the persistence.xml and will fill them in  
> automatically in some situations.  Our current "guessing" algorithm  
> wouldn't help you, but we might be able to beef it up to allow for  
> more kinds of matching.   Recently Karsten had a very similar  
> situation involving multiple persistence units and datasources to  
> match each:
> 
>
> http://www.nabble.com/Using-Multiple-PersistenceUnits-tp23520311p23534955.html
> 
> I suggest there that we might be able to improve the datasource  
> matching we do for persistence.xml files to look for data sources that  
> use the persistence unit name when looking for them by the name listed  
> fails.  That won't work for you as you have the same application  
> deployed several times and would need different datasources for each.  
> So as another fallback strategy we could maybe match my application  
> name.
> 
> The algorithm for resolving the datasources for a persistence unit  
> would then look like this:
> 
>Look for a datasource whose name matches:
>1. the name set in  or 
>2. the name of the persistence-unit
>3. the name of the module name (i.e. war, ejb-jar, etc.)
>4. the name of the app name (i.e. ear)
> 
> Then you could simply leave the   source> blank and configure a datasource for each application in your  
> openejb.xml file.
> 
> Would something like that work for you?  Seems like it would be a good  
> first step towards what you ultimately want and also a good solution  
> for Karsten.
> 
> -David
> 
>