Problem with OpenEJB

2009-07-14 Thread krishna kishore
Hi,

While working with openEJB, I am getting javax.ejb package not found error
though I placed the corresponding jars in the class path.Can you please help
me out in this regards?



I am importing javax.ejb.Remote and javax.ejb.Stateless.





Regards

kishore


OpenEJB and Seam integration

2009-07-14 Thread recursion

Are there any thoughts in this direction in the community members ? 

Regards,

recursion.
-- 
View this message in context: 
http://www.nabble.com/OpenEJB-and-Seam-integration-tp24478402p24478402.html
Sent from the OpenEJB User mailing list archive at Nabble.com.



Re: Problem with OpenEJB

2009-07-14 Thread Jonathan Gallimore
Hi,

These classes should be in our javaee-api-5.0-2.jar - it sounds like this is
missing from your classpath somehow. Are you seeing an error at compile time
or runtime?

Jon

On Tue, Jul 14, 2009 at 7:12 AM, krishna kishore
wrote:

> Hi,
>
> While working with openEJB, I am getting javax.ejb package not found error
> though I placed the corresponding jars in the class path.Can you please
> help
> me out in this regards?
>
>
>
> I am importing javax.ejb.Remote and javax.ejb.Stateless.
>
>
>
>
>
> Regards
>
> kishore
>


Re: MDB to listen to Tibco JMS

2009-07-14 Thread DimasOwl

hi, David
that is the problem as I don't have any files

I will try to  talk with guys from Tibco support if they could provide such
file.
-- 
View this message in context: 
http://www.nabble.com/MDB-to-listen-to-Tibco-JMS-tp24369433p24485446.html
Sent from the OpenEJB User mailing list archive at Nabble.com.



Re: Unit testing code containing DirContext resource injection

2009-07-14 Thread Allan Lykke Christensen

Hi David,

Thanks for your response.  I realised that I was trying to over- 
engineer my code by having dynamic binding and look-up of objects  
using JNDI. It was not needed for the purpose of my application.  
Instead I've gone back to using a Resource Adapter for connecting to a  
Java Content Repository (JCR). Specifically, I'm using the Jackrabbit  
Content Repository. A JCA component was already provided (although a  
pain to install on Mac because of filename case issues) and I've  
managed to install it on GlassFish. This got me back to my original  
test case. Using the Resource Adapter (JCA 1.0), requires me to set-up  
a a Connector connection pool and resource which I bound to a JNDI  
name. The repository would then be available using the following DI:


@Resource(mappedName="jcr/repository",  
type=javax.jcr.Repository.class) private Repository rep;


But how do I tell OpenEJB about the resource so that I can add my own  
dummy repository before running my tests? Is it possible?


Thanks,
 Allan

On 14/07/2009, at 01.15, David Blevins wrote:



On Jul 9, 2009, at 12:41 AM, Allan Lykke Christensen wrote:

public ContentService getRepository(String jndiName) throws  
NamingException {

  Context ctx = new InitialContext();
  ContentService cs = (ContentService) ctx.lookup(jndiName);
  return cs;
}


In my unit test I  bind some "ContentService" objects to the  
InitialContext


@Test
public void testGetRepository() {
  Properties p = new Properties();
  p.setProperty(Context.INITIAL_CONTEXT_FACTORY,  
"org.apache.openejb.client.LocalInitialContextFactory");

  InitialContext initialContext = new InitialContext(p);
  initialContext.bind("cs/MyObject", new ContentService("Something  
something"));


  ContentFacadeLocal bean = (ContentFacadeLocal)  
getInitialContext().lookup(BEAN_INTERFACE);

  try {
  ContentService cs = bean.getRepository("cs/MyObject");
  assertNotNull(cs);
  } catch (NamingException ex) {
  fail(ex.getMessage());
  }
}

When I run the test a NamingException is thrown with the message  
"javax.naming.NoInitialContextException: Need to specify class name  
in environment or system property, or as an applet parameter, or in  
an application resource file:  java.naming.factory.initial"


Hi Allen,

Hmm.. I'm not sure I know how to advise.  Binding things into JNDI  
and looking them up inside beans is definitely non-compliant and not  
portable.  It can be done in OpenEJB with certain limitations, but I  
wouldn't go there as my first choice.  How exactly do you setup and  
use this ContentService in your application when run outside  
OpenEJB?  Who normally creates these ContentService objects?


In terms of simplicity, not having things injected and instead  
looking them up doesn't really change anything from a setup  
perspective.  Injection is really just syntactic sugar over JNDI, a  
JNDI lookup is still done under the covers in exactly the same way  
as if you were to look it up in the bean.


Looking forward to your feedback.

-David