Re: Could not auto-map to resource problem when using EJB annotations only

2009-05-06 Thread fmeili



Rex Wang-2 wrote:
 
 yes, Frank
 
 attachment is the improved demo based on your requirement and David's
 suggestion. I have tested it.
 
 HTH
 
 Rex
  
 

Hi Rex,

thanks a lot for your work and help. This works great! So I'm simply able to
define it in the geronimo-application.xml. Now I'm able to deploy the same
EAR in different application server implementations - great! I didn't find
this hint in the Geronimo documentation.

Thanks and Greetings,
 Frank:jumping:
-- 
View this message in context: 
http://www.nabble.com/%22Could-not-auto-map-to-resource%22-problem-when-using-EJB-annotations-only-tp23316686s134p23408531.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.



Re: Could not auto-map to resource problem when using EJB annotations only

2009-05-05 Thread fmeili



Rex Wang-2 wrote:
 
 Hi Frank, sorry for the confusing, it can not be added to the
 application.xml, but should be added to the web.xml / ejb-jar.xml...
 
 here is an example in attachment.
 
 HTH
 
 rex.
 

Hi Rex,

thanks for your answer. But this, I think, is the problem. My EAR consits
out of 40 EJB's and 25 WAR's and all are using the @Resource injection for
the database. Til now I don't have descriptors for the EJB's (no
ejb-jar.xml) - I thought they are no longer neccessary in JEE5. And the
deployment descriptors of the WAR's (web.xml) only contains the
servlet-mappings. (This EAR file can successfully deployed in JBoss and in
GlassFish without modifications.)

To be able to deploy this in Geronimo do I really need to add 40 new
openejb-jar.xml, 40 new ejb-jar.xml and 25 new geronimo-web.xml files
- and also change 25 web.xml files to place the resource-ref tag? Is
there no way to just use injection without specifying it in all descriptors?
Maybe there is a way to define a jdbc resource globally in Geronimo to use
in with injection?

Thanks,
 Frank
-- 
View this message in context: 
http://www.nabble.com/%22Could-not-auto-map-to-resource%22-problem-when-using-EJB-annotations-only-tp23316686s134p23382575.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.



Re: Could not auto-map to resource problem when using EJB annotations only

2009-05-04 Thread fmeili



Rex Wang-2 wrote:
 
 hi frank
 
 This should be add to the application.xml(not geronimo-application.xml),
 coz
 it is NOT Geronimo specific. It is the JEE specific.
 resource-ref
res-ref-namejdbc/__mes/res-ref-name
res-typejavax.sql.DataSource/res-type
res-authContainer/res-auth
res-sharing-scopeShareable/res-sharing-scope
 /resource-ref
 
 HTH
 
 Rex
 


Hi Rex,

thanks for the answer. But when I add this to the application.xml I get an
error, that this element is not allowed here. After looking to the 
http://java.sun.com/xml/ns/javaee/application_5.xsd I couldn't find any hint
about the resource-ref tag inside the application.xml.

I couldn't find any hint about the resource-ref inside an application.xml
even not in the JaveEE5 specification.

Have you tried this?

Thanks,
 Frank

-- 
View this message in context: 
http://www.nabble.com/%22Could-not-auto-map-to-resource%22-problem-when-using-EJB-annotations-only-tp23316686s134p23368822.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.



EAR bundle dir classpath issue

2008-08-14 Thread fmeili

Hi,

I've try to build an EAR with the default lib/ bundle directory without
using the manifes Class-Path entry in all WAR's which references the jar
files in the lib/ directory. This EAR should be standard JEE5 compliant and
should be deployable without any change in Geronimo 2.1.2 and GlassFish
(latest Version).

Now I found a difference in how to access the jar files located in the EARs
lib/ directory from within an WAR module.

In Geronimo I have to use:
getClass().getClassLoader().getResourceAsStream(lib/sample.jar)
to get the jar file content.

In GlassFish I have to use:
getClass().getClassLoader().getResourceAsStream(sample.jar)
notice - without the lib/ prefix.

As far as I understand the JEE5 specification (section 8.2.1 Bundled
Libraries), all JAR-Files in the EARs lib/ directory should be available in
all (also WAR) Modules classloaders. So I think the lib/ prefix should not
be specified.

I've tried to workaround this problem by specifying the lib directory in the
WAR manifest entry with the following entry:
ClassPath: lib/

But this results in an deployment error in Geronimo with the following
message:

15:20:13,170 ERROR [DirectoryHotDeployer] Unable to deploy: Manifest class
path
entries must end with the .jar extension (J2EE 1.4 Section 8.2): module=../
org.apache.geronimo.common.DeploymentException: Manifest class path entries
must
 end with the .jar extension (J2EE 1.4 Section 8.2): module=../
at
org.apache.geronimo.deployment.DeploymentContext.addManifestClassPath
(DeploymentContext.java:419)
...

I think this is definitely an error because the JEE5 specification section
8.2.1 explicitely allows directories in manifest Class-Path entries.

So it seems the workaround didn't work, too.

Do I make something wrong?

If not, do I have a chance to generate an generic EAR file (with the same
source code) with bundled lib/ directory usage from WAR modules, which is
deployable under Geronimo and GlassFish?

Thanks,
 Frank

-- 
View this message in context: 
http://www.nabble.com/EAR-bundle-dir-classpath-issue-tp18982334s134p18982334.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.