whoops! ok, all fixed now.
On Jun 17, 2008, at 5:12 PM, Karan Malhi wrote:
I am getting the following errors on running
mvn -Dassemble clean install -Dmaven.test.skip=true
[INFO] Building OpenEJB :: Container :: Core
[INFO] task-segment: [clean, install]
[INFO]
------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Deleting directory
/home/karan/projects/oss/openejb3/container/openejb-core/target
[INFO] [remote-resources:process {execution: default}]
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [dependency:copy {execution: copy}]
[INFO] Configured Artifact:
org.apache.openejb:openejb-javaagent:3.1-SNAPSHOT:jar
[INFO] Copying openejb-javaagent-3.1-SNAPSHOT.jar to
/home/karan/projects/oss/openejb3/container/openejb-core/target/
openejb-javaagent-3.1-SNAPSHOT.jar
[INFO] [compiler:compile]
[INFO] Compiling 485 source files to
/home/karan/projects/oss/openejb3/container/openejb-core/target/
classes
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] Compilation failure
/home/karan/projects/oss/openejb3/container/openejb-core/src/main/
java/org/apache/openejb/config/OutputGeneratedDescriptors.java:[73,27]
<T>marshal(java.lang.Class<T>,java.lang.Object) in
org.apache.openejb.jee.jpa.JpaJaxbUtil cannot be applied to
(java
.lang
.Class
<
org
.apache
.openejb
.jee
.jpa
.EntityMappings
>
,org
.apache.openejb.jee.jpa.EntityMappings,java.io.BufferedOutputStream)
/home/karan/projects/oss/openejb3/container/openejb-core/src/main/
java/org/apache/openejb/config/OutputGeneratedDescriptors.java:[73,27]
<T>marshal(java.lang.Class<T>,java.lang.Object) in
org.apache.openejb.jee.jpa.JpaJaxbUtil cannot be applied to
(java
.lang
.Class
<
org
.apache
.openejb
.jee
.jpa
.EntityMappings
>
,org
.apache.openejb.jee.jpa.EntityMappings,java.io.BufferedOutputStream)
On Tue, Jun 17, 2008 at 7:28 PM, <[EMAIL PROTECTED]> wrote:
Author: dblevins
Date: Tue Jun 17 16:28:01 2008
New Revision: 668874
URL: http://svn.apache.org/viewvc?rev=668874&view=rev
Log:
Write the cmp mappings when openejb.descriptors.output is set to true
Modified:
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/
apache/openejb/config/OutputGeneratedDescriptors.java
Modified:
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/
apache/openejb/config/OutputGeneratedDescriptors.java
URL:
http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/config/OutputGeneratedDescriptors.java?rev=668874&r1=668873&r2=668874&view=diff
=
=
=
=
=
=
=
=
=
=====================================================================
---
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/
apache/openejb/config/OutputGeneratedDescriptors.java
(original)
+++
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/
apache/openejb/config/OutputGeneratedDescriptors.java
Tue Jun 17 16:28:01 2008
@@ -20,6 +20,8 @@
import org.apache.openejb.loader.SystemInstance;
import org.apache.openejb.jee.EjbJar;
import org.apache.openejb.jee.JaxbJavaee;
+import org.apache.openejb.jee.jpa.JpaJaxbUtil;
+import org.apache.openejb.jee.jpa.EntityMappings;
import org.apache.openejb.jee.oejb3.JaxbOpenejbJar3;
import org.apache.openejb.jee.oejb3.OpenejbJar;
import org.apache.openejb.util.LogCategory;
@@ -29,10 +31,8 @@
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
+import java.io.IOException;
-/**
- * @version $Rev$ $Date$
- */
public class OutputGeneratedDescriptors implements DynamicDeployer {
private static final Logger logger =
Logger.getInstance(LogCategory.OPENEJB_STARTUP_CONFIG,
"org.apache.openejb.util.resources");
private static final String OUTPUT_DESCRIPTORS =
"openejb.descriptors.output";
@@ -40,6 +40,11 @@
public AppModule deploy(AppModule appModule) throws
OpenEJBException {
boolean output =
SystemInstance.get().getProperty(OUTPUT_DESCRIPTORS,
"false").equalsIgnoreCase("true");
+ if (output && appModule.getCmpMappings() != null){
+
+ writeGenratedCmpMappings(appModule);
+ }
+
for (EjbModule ejbModule : appModule.getEjbModules()) {
output =
ejbModule
.getOpenejbJar().getProperties().getProperty(OUTPUT_DESCRIPTORS,
output+"").equalsIgnoreCase("true");
@@ -58,6 +63,22 @@
return appModule;
}
+ private void writeGenratedCmpMappings(AppModule appModule) {
+ try {
+ File tempFile =
File.createTempFile("openejb-cmp-generated-orm-", ".xml");
+ FileOutputStream fout = new FileOutputStream(tempFile);
+ BufferedOutputStream out = new
BufferedOutputStream(fout);
+
+ try {
+ JpaJaxbUtil.marshal(EntityMappings.class,
appModule.getCmpMappings(), out);
+ } catch (JAXBException e) {
+ } finally{
+ out.close();
+ }
+ } catch (IOException e) {
+ }
+ }
+
private void writeOpenejbJar(EjbModule ejbModule) {
try {
OpenejbJar openejbJar = ejbModule.getOpenejbJar();
--
Karan Singh Malhi