[jira] [Commented] (TOMEE-1532) EJB-references declared at superclasses residing in libraries aren't considered

2015-03-26 Thread Romain Manni-Bucau (JIRA)

[ 
https://issues.apache.org/jira/browse/TOMEE-1532?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14382645#comment-14382645
 ] 

Romain Manni-Bucau commented on TOMEE-1532:
---

Snapshot already has it. We try to work on the release when xbean release will 
be GA ie next week if all is fine.

> EJB-references declared at superclasses residing in libraries aren't 
> considered
> ---
>
> Key: TOMEE-1532
> URL: https://issues.apache.org/jira/browse/TOMEE-1532
> Project: TomEE
>  Issue Type: Bug
>Affects Versions: 1.7.1
>Reporter: Barnabas Bodnar
> Attachments: no-ejb-ref-from-superclass.zip
>
>
> EJB-references (both injected and via JNDI) declared at a superclass of an 
> EJB are ignored by TomEE 1.7.1, if the superclass resides in a library-module.
> Application-servers from the JBoss7-family, as well as Oracle Weblogic 12 and 
> IBM Websphere 8 set such EJB-references correctly.
> The attached application demonstrates this behavior: the startup-singleton 
> "ReferencingEJB" has a locally declared reference to "EJB2" and inherits 
> references to "EJB1" declared in the superclass "EJBSuperclass" residing in a 
> library-module. The availability of the EJB-references is checked in a 
> post-construct-method and produces the following output:
> {noformat}
> ===
> Local injected EJB-reference: set
> Local EJB-reference in the JNDI-context: set
> Inherited injected EJB-reference: not set
> Inherited EJB-reference in the JNDI-context: not set
> ===
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (TOMEE-1532) EJB-references declared at superclasses residing in libraries aren't considered

2015-03-26 Thread Barnabas Bodnar (JIRA)

[ 
https://issues.apache.org/jira/browse/TOMEE-1532?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14382459#comment-14382459
 ] 

Barnabas Bodnar commented on TOMEE-1532:


Thank you for the information. 
Is there an estimated deadline for releasing the TomeEE-version including xbean 
v4.2?


> EJB-references declared at superclasses residing in libraries aren't 
> considered
> ---
>
> Key: TOMEE-1532
> URL: https://issues.apache.org/jira/browse/TOMEE-1532
> Project: TomEE
>  Issue Type: Bug
>Affects Versions: 1.7.1
>Reporter: Barnabas Bodnar
> Attachments: no-ejb-ref-from-superclass.zip
>
>
> EJB-references (both injected and via JNDI) declared at a superclass of an 
> EJB are ignored by TomEE 1.7.1, if the superclass resides in a library-module.
> Application-servers from the JBoss7-family, as well as Oracle Weblogic 12 and 
> IBM Websphere 8 set such EJB-references correctly.
> The attached application demonstrates this behavior: the startup-singleton 
> "ReferencingEJB" has a locally declared reference to "EJB2" and inherits 
> references to "EJB1" declared in the superclass "EJBSuperclass" residing in a 
> library-module. The availability of the EJB-references is checked in a 
> post-construct-method and produces the following output:
> {noformat}
> ===
> Local injected EJB-reference: set
> Local EJB-reference in the JNDI-context: set
> Inherited injected EJB-reference: not set
> Inherited EJB-reference in the JNDI-context: not set
> ===
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


buildbot success in ASF Buildbot on tomee-trunk-ubuntu

2015-03-26 Thread buildbot
The Buildbot has detected a restored build on builder tomee-trunk-ubuntu while 
building tomee. Full details are available at:
http://ci.apache.org/builders/tomee-trunk-ubuntu/builds/1010

Buildbot URL: http://ci.apache.org/

Buildslave for this Build: hemera_ubuntu

Build Reason: The SingleBranchScheduler scheduler named 
'on-tomee-trunk-ubuntu-commit' triggered this build
Build Source Stamp: [branch master] 547bd0dab405d74aaee2a47e0830aac9f25d8727
Blamelist: Romain Manni-Bucau 

Build succeeded!

Sincerely,
 -The Buildbot





buildbot failure in ASF Buildbot on tomee-trunk-ubuntu

2015-03-26 Thread buildbot
The Buildbot has detected a new failure on builder tomee-trunk-ubuntu while 
building tomee. Full details are available at:
http://ci.apache.org/builders/tomee-trunk-ubuntu/builds/1009

Buildbot URL: http://ci.apache.org/

Buildslave for this Build: hemera_ubuntu

Build Reason: The SingleBranchScheduler scheduler named 
'on-tomee-trunk-ubuntu-commit' triggered this build
Build Source Stamp: [branch master] bf22e8980bf8430cc7fbe0a83f9a4e84a3269699
Blamelist: Romain Manni-Bucau 

BUILD FAILED: failed test

Sincerely,
 -The Buildbot





tomee git commit: openejb.jpa.query.wrap-no-tx flag to control wrapping or not of not jta queries from jta entity manager

2015-03-26 Thread rmannibucau
Repository: tomee
Updated Branches:
  refs/heads/master bf22e8980 -> 547bd0dab


openejb.jpa.query.wrap-no-tx flag to control wrapping or not of not jta queries 
from jta entity manager


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/547bd0da
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/547bd0da
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/547bd0da

Branch: refs/heads/master
Commit: 547bd0dab405d74aaee2a47e0830aac9f25d8727
Parents: bf22e89
Author: Romain Manni-Bucau 
Authored: Thu Mar 26 14:00:48 2015 +0100
Committer: Romain Manni-Bucau 
Committed: Thu Mar 26 14:00:48 2015 +0100

--
 .../openejb/persistence/JtaEntityManager.java   |  9 +++-
 .../openejb/persistence/JtaQueryTest.java   | 45 
 2 files changed, 44 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tomee/blob/547bd0da/container/openejb-core/src/main/java/org/apache/openejb/persistence/JtaEntityManager.java
--
diff --git 
a/container/openejb-core/src/main/java/org/apache/openejb/persistence/JtaEntityManager.java
 
b/container/openejb-core/src/main/java/org/apache/openejb/persistence/JtaEntityManager.java
index 5151885..1dfb8b8 100644
--- 
a/container/openejb-core/src/main/java/org/apache/openejb/persistence/JtaEntityManager.java
+++ 
b/container/openejb-core/src/main/java/org/apache/openejb/persistence/JtaEntityManager.java
@@ -18,6 +18,7 @@
 package org.apache.openejb.persistence;
 
 import org.apache.openejb.OpenEJBRuntimeException;
+import org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory;
 import org.apache.openejb.core.ivm.IntraVmArtifact;
 import org.apache.openejb.util.LogCategory;
 import org.apache.openejb.util.Logger;
@@ -72,6 +73,7 @@ public class JtaEntityManager implements EntityManager, 
Serializable {
 private final boolean extended;
 private final String unitName;
 private final Logger logger;
+private final boolean wrapNoTxQueries;
 
 public JtaEntityManager(final JtaEntityManagerRegistry registry, final 
EntityManagerFactory entityManagerFactory, final Map properties, final String 
unitName) {
 this(unitName, registry, entityManagerFactory, properties, false);
@@ -90,6 +92,9 @@ public class JtaEntityManager implements EntityManager, 
Serializable {
 this.properties = properties;
 this.extended = extended;
 logger = unitName == null ? baseLogger : 
baseLogger.getChildLogger(unitName);
+final String wrapConfig = 
ReloadableEntityManagerFactory.class.isInstance(entityManagerFactory) ?
+
ReloadableEntityManagerFactory.class.cast(entityManagerFactory).getUnitProperties().getProperty("openejb.jpa.query.wrap-no-tx",
 "true") : "true";
+this.wrapNoTxQueries = wrapConfig == null || 
"true".equalsIgnoreCase(wrapConfig);
 }
 
 EntityManager getEntityManager() {
@@ -320,14 +325,14 @@ public class JtaEntityManager implements EntityManager, 
Serializable {
 }
 
 private Query proxyIfNoTx(final Method method, final Object... args) {
-if (!extended && !isTransactionActive()) {
+if (wrapNoTxQueries && !extended && !isTransactionActive()) {
 return new JtaQuery(getEntityManager(), this, method, args);
 }
 return createQuery(Query.class, getEntityManager(), method, args);
 }
 
 private  TypedQuery typedProxyIfNoTx(final Method method, final 
Object... args) {
-if (!extended && !isTransactionActive()) {
+if (wrapNoTxQueries && !extended && !isTransactionActive()) {
 return new JtaTypedQuery(getEntityManager(), this, method, 
args);
 }
 return createQuery(TypedQuery.class, getEntityManager(), method, args);

http://git-wip-us.apache.org/repos/asf/tomee/blob/547bd0da/container/openejb-core/src/test/java/org/apache/openejb/persistence/JtaQueryTest.java
--
diff --git 
a/container/openejb-core/src/test/java/org/apache/openejb/persistence/JtaQueryTest.java
 
b/container/openejb-core/src/test/java/org/apache/openejb/persistence/JtaQueryTest.java
index c286225..0706aa2 100644
--- 
a/container/openejb-core/src/test/java/org/apache/openejb/persistence/JtaQueryTest.java
+++ 
b/container/openejb-core/src/test/java/org/apache/openejb/persistence/JtaQueryTest.java
@@ -16,10 +16,12 @@
  */
 package org.apache.openejb.persistence;
 
+import org.apache.openejb.jee.jpa.unit.Persistence;
 import org.apache.openejb.jee.jpa.unit.PersistenceUnit;
 import org.apache.openejb.junit.ApplicationComposer;
 import org.apache.openejb.testing.Module;
 import org.apache.openejb.util.reflection.Reflections;
+import org.apache.openjpa.persistence.QueryImpl;
 impo

tomee git commit: openejb.jpa.query.wrap-no-tx flag to control wrapping or not of not jta queries from jta entity manager

2015-03-26 Thread rmannibucau
Repository: tomee
Updated Branches:
  refs/heads/tomee-1.7.x 5d57a556c -> d7b4a7bba


openejb.jpa.query.wrap-no-tx flag to control wrapping or not of not jta queries 
from jta entity manager


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/d7b4a7bb
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/d7b4a7bb
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/d7b4a7bb

Branch: refs/heads/tomee-1.7.x
Commit: d7b4a7bba2df6d5b8d513f5a38c259c78f2e0656
Parents: 5d57a55
Author: Romain Manni-Bucau 
Authored: Thu Mar 26 14:00:32 2015 +0100
Committer: Romain Manni-Bucau 
Committed: Thu Mar 26 14:00:32 2015 +0100

--
 .../org/apache/openejb/persistence/JtaEntityManager.java| 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tomee/blob/d7b4a7bb/container/openejb-core/src/main/java/org/apache/openejb/persistence/JtaEntityManager.java
--
diff --git 
a/container/openejb-core/src/main/java/org/apache/openejb/persistence/JtaEntityManager.java
 
b/container/openejb-core/src/main/java/org/apache/openejb/persistence/JtaEntityManager.java
index 5151885..1dfb8b8 100644
--- 
a/container/openejb-core/src/main/java/org/apache/openejb/persistence/JtaEntityManager.java
+++ 
b/container/openejb-core/src/main/java/org/apache/openejb/persistence/JtaEntityManager.java
@@ -18,6 +18,7 @@
 package org.apache.openejb.persistence;
 
 import org.apache.openejb.OpenEJBRuntimeException;
+import org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory;
 import org.apache.openejb.core.ivm.IntraVmArtifact;
 import org.apache.openejb.util.LogCategory;
 import org.apache.openejb.util.Logger;
@@ -72,6 +73,7 @@ public class JtaEntityManager implements EntityManager, 
Serializable {
 private final boolean extended;
 private final String unitName;
 private final Logger logger;
+private final boolean wrapNoTxQueries;
 
 public JtaEntityManager(final JtaEntityManagerRegistry registry, final 
EntityManagerFactory entityManagerFactory, final Map properties, final String 
unitName) {
 this(unitName, registry, entityManagerFactory, properties, false);
@@ -90,6 +92,9 @@ public class JtaEntityManager implements EntityManager, 
Serializable {
 this.properties = properties;
 this.extended = extended;
 logger = unitName == null ? baseLogger : 
baseLogger.getChildLogger(unitName);
+final String wrapConfig = 
ReloadableEntityManagerFactory.class.isInstance(entityManagerFactory) ?
+
ReloadableEntityManagerFactory.class.cast(entityManagerFactory).getUnitProperties().getProperty("openejb.jpa.query.wrap-no-tx",
 "true") : "true";
+this.wrapNoTxQueries = wrapConfig == null || 
"true".equalsIgnoreCase(wrapConfig);
 }
 
 EntityManager getEntityManager() {
@@ -320,14 +325,14 @@ public class JtaEntityManager implements EntityManager, 
Serializable {
 }
 
 private Query proxyIfNoTx(final Method method, final Object... args) {
-if (!extended && !isTransactionActive()) {
+if (wrapNoTxQueries && !extended && !isTransactionActive()) {
 return new JtaQuery(getEntityManager(), this, method, args);
 }
 return createQuery(Query.class, getEntityManager(), method, args);
 }
 
 private  TypedQuery typedProxyIfNoTx(final Method method, final 
Object... args) {
-if (!extended && !isTransactionActive()) {
+if (wrapNoTxQueries && !extended && !isTransactionActive()) {
 return new JtaTypedQuery(getEntityManager(), this, method, 
args);
 }
 return createQuery(TypedQuery.class, getEntityManager(), method, args);



[jira] [Updated] (OPENEJB-2112) 'Tweaks' to a (native) query are lost when running without a tx

2015-03-26 Thread Romain Manni-Bucau (JIRA)

 [ 
https://issues.apache.org/jira/browse/OPENEJB-2112?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Romain Manni-Bucau updated OPENEJB-2112:

Fix Version/s: 4.7.2

> 'Tweaks' to a (native) query are lost when running without a tx
> ---
>
> Key: OPENEJB-2112
> URL: https://issues.apache.org/jira/browse/OPENEJB-2112
> Project: OpenEJB
>  Issue Type: Bug
>  Components: ejb31
>Affects Versions: 4.7.1
>Reporter: gui
>Assignee: Romain Manni-Bucau
> Fix For: 4.7.2, 5.0.0-Milestone-1
>
>
> I'm trying to upgrade from 4.5.1
> In our code, we create a nativeQuery and add some hibernate specific stuff:
> {code}
> Query query = entityManager.createNativeQuery(queryString);
> SQLQuery hibernateQuery = query.unwrap(SQLQuery.class);
> hibernateQuery.addScalar("device_pk", new LongType());
> query.getResultList()
> {code}
> However , 4.7.1 fails on this code. Since there is no tx active (on purpose) 
> the JtaQuery wrapper insists on creating a new Query object during 
> getResltLIst, loosing the customization. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


tomee git commit: OPENEJB-2112 if unwrap was called on the query don't recreate the query - backport

2015-03-26 Thread rmannibucau
Repository: tomee
Updated Branches:
  refs/heads/tomee-1.7.x 98aacf6a7 -> 5d57a556c


OPENEJB-2112 if unwrap was called on the query don't recreate the query - 
backport


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/5d57a556
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/5d57a556
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/5d57a556

Branch: refs/heads/tomee-1.7.x
Commit: 5d57a556cff1f70d43e9195e28a91ab51ead3245
Parents: 98aacf6
Author: Romain Manni-Bucau 
Authored: Thu Mar 26 13:46:01 2015 +0100
Committer: Romain Manni-Bucau 
Committed: Thu Mar 26 13:46:01 2015 +0100

--
 .../main/java/org/apache/openejb/persistence/JtaQuery.java  | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/tomee/blob/5d57a556/container/openejb-core/src/main/java/org/apache/openejb/persistence/JtaQuery.java
--
diff --git 
a/container/openejb-core/src/main/java/org/apache/openejb/persistence/JtaQuery.java
 
b/container/openejb-core/src/main/java/org/apache/openejb/persistence/JtaQuery.java
index 6eea5c3..c1b0017 100644
--- 
a/container/openejb-core/src/main/java/org/apache/openejb/persistence/JtaQuery.java
+++ 
b/container/openejb-core/src/main/java/org/apache/openejb/persistence/JtaQuery.java
@@ -43,6 +43,7 @@ public class JtaQuery implements Query {
 private final JtaEntityManager jtaEntityManager;
 private final Collection appliedOperations = new 
ArrayList();
 
+private boolean unwrap;
 private boolean underTx;
 private Query query;
 
@@ -56,7 +57,9 @@ public class JtaQuery implements Query {
 }
 
 private void createQuery() {
-query = jtaEntityManager.createQuery(queryType(), entityManager, 
method, args);
+if (!unwrap) {
+query = jtaEntityManager.createQuery(queryType(), entityManager, 
method, args);
+}
 if (!underTx) {
 for (final QueryOperation op : appliedOperations) {
 query = op.apply(query);
@@ -397,6 +400,10 @@ public class JtaQuery implements Query {
  * @see javax.persistence.Query#unwrap(java.lang.Class)
  */
 public  T unwrap(final Class cls) {
+unwrap = true;
+if (getClass() == cls) {
+return cls.cast(this);
+}
 return query.unwrap(cls);
 }
 }



[jira] [Resolved] (OPENEJB-2112) 'Tweaks' to a (native) query are lost when running without a tx

2015-03-26 Thread Romain Manni-Bucau (JIRA)

 [ 
https://issues.apache.org/jira/browse/OPENEJB-2112?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Romain Manni-Bucau resolved OPENEJB-2112.
-
   Resolution: Fixed
Fix Version/s: 5.0.0-Milestone-1
 Assignee: Romain Manni-Bucau

> 'Tweaks' to a (native) query are lost when running without a tx
> ---
>
> Key: OPENEJB-2112
> URL: https://issues.apache.org/jira/browse/OPENEJB-2112
> Project: OpenEJB
>  Issue Type: Bug
>  Components: ejb31
>Affects Versions: 4.7.1
>Reporter: gui
>Assignee: Romain Manni-Bucau
> Fix For: 5.0.0-Milestone-1
>
>
> I'm trying to upgrade from 4.5.1
> In our code, we create a nativeQuery and add some hibernate specific stuff:
> {code}
> Query query = entityManager.createNativeQuery(queryString);
> SQLQuery hibernateQuery = query.unwrap(SQLQuery.class);
> hibernateQuery.addScalar("device_pk", new LongType());
> query.getResultList()
> {code}
> However , 4.7.1 fails on this code. Since there is no tx active (on purpose) 
> the JtaQuery wrapper insists on creating a new Query object during 
> getResltLIst, loosing the customization. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


tomee git commit: OPENEJB-2112 if unwrap was called on the query don't recreate the query

2015-03-26 Thread rmannibucau
Repository: tomee
Updated Branches:
  refs/heads/master 849292df6 -> bf22e8980


OPENEJB-2112 if unwrap was called on the query don't recreate the query


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/bf22e898
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/bf22e898
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/bf22e898

Branch: refs/heads/master
Commit: bf22e8980bf8430cc7fbe0a83f9a4e84a3269699
Parents: 849292d
Author: Romain Manni-Bucau 
Authored: Thu Mar 26 12:41:48 2015 +0100
Committer: Romain Manni-Bucau 
Committed: Thu Mar 26 12:41:48 2015 +0100

--
 .../apache/openejb/persistence/JtaQuery.java| 13 -
 .../openejb/persistence/JtaQueryTest.java   | 56 
 2 files changed, 67 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tomee/blob/bf22e898/container/openejb-core/src/main/java/org/apache/openejb/persistence/JtaQuery.java
--
diff --git 
a/container/openejb-core/src/main/java/org/apache/openejb/persistence/JtaQuery.java
 
b/container/openejb-core/src/main/java/org/apache/openejb/persistence/JtaQuery.java
index 6eea5c3..2336f45 100644
--- 
a/container/openejb-core/src/main/java/org/apache/openejb/persistence/JtaQuery.java
+++ 
b/container/openejb-core/src/main/java/org/apache/openejb/persistence/JtaQuery.java
@@ -44,6 +44,7 @@ public class JtaQuery implements Query {
 private final Collection appliedOperations = new 
ArrayList();
 
 private boolean underTx;
+private boolean unwrap;
 private Query query;
 
 public JtaQuery(final EntityManager entityManager, final JtaEntityManager 
jtaEntityManager, final Method method, final Object... args) {
@@ -55,13 +56,16 @@ public class JtaQuery implements Query {
 createQuery();
 }
 
-private void createQuery() {
-query = jtaEntityManager.createQuery(queryType(), entityManager, 
method, args);
+private Query createQuery() {
+if (!unwrap) {
+query = jtaEntityManager.createQuery(queryType(), entityManager, 
method, args);
+}
 if (!underTx) {
 for (final QueryOperation op : appliedOperations) {
 query = op.apply(query);
 }
 }
+return query;
 }
 
 protected Class queryType() {
@@ -397,6 +401,11 @@ public class JtaQuery implements Query {
  * @see javax.persistence.Query#unwrap(java.lang.Class)
  */
 public  T unwrap(final Class cls) {
+unwrap = true;
+
+if (getClass() == cls) {
+return cls.cast(this);
+}
 return query.unwrap(cls);
 }
 }

http://git-wip-us.apache.org/repos/asf/tomee/blob/bf22e898/container/openejb-core/src/test/java/org/apache/openejb/persistence/JtaQueryTest.java
--
diff --git 
a/container/openejb-core/src/test/java/org/apache/openejb/persistence/JtaQueryTest.java
 
b/container/openejb-core/src/test/java/org/apache/openejb/persistence/JtaQueryTest.java
new file mode 100644
index 000..c286225
--- /dev/null
+++ 
b/container/openejb-core/src/test/java/org/apache/openejb/persistence/JtaQueryTest.java
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.openejb.persistence;
+
+import org.apache.openejb.jee.jpa.unit.PersistenceUnit;
+import org.apache.openejb.junit.ApplicationComposer;
+import org.apache.openejb.testing.Module;
+import org.apache.openejb.util.reflection.Reflections;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.Query;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+
+@RunWith(ApplicationComposer.class)
+public class JtaQueryTest {
+@Module
+public PersistenceUnit unit() {
+final PersistenceUnit persistenceUnit = new PersistenceUnit();
+persiste

[jira] [Commented] (OPENEJB-2112) 'Tweaks' to a (native) query are lost when running without a tx

2015-03-26 Thread gui (JIRA)

[ 
https://issues.apache.org/jira/browse/OPENEJB-2112?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14381707#comment-14381707
 ] 

gui commented on OPENEJB-2112:
--

TOMEE-798 causes this issue

> 'Tweaks' to a (native) query are lost when running without a tx
> ---
>
> Key: OPENEJB-2112
> URL: https://issues.apache.org/jira/browse/OPENEJB-2112
> Project: OpenEJB
>  Issue Type: Bug
>  Components: ejb31
>Affects Versions: 4.7.1
>Reporter: gui
>
> I'm trying to upgrade from 4.5.1
> In our code, we create a nativeQuery and add some hibernate specific stuff:
> {code}
> Query query = entityManager.createNativeQuery(queryString);
> SQLQuery hibernateQuery = query.unwrap(SQLQuery.class);
> hibernateQuery.addScalar("device_pk", new LongType());
> query.getResultList()
> {code}
> However , 4.7.1 fails on this code. Since there is no tx active (on purpose) 
> the JtaQuery wrapper insists on creating a new Query object during 
> getResltLIst, loosing the customization. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Comment Edited] (OPENEJB-2112) 'Tweaks' to a (native) query are lost when running without a tx

2015-03-26 Thread gui (JIRA)

[ 
https://issues.apache.org/jira/browse/OPENEJB-2112?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14381707#comment-14381707
 ] 

gui edited comment on OPENEJB-2112 at 3/26/15 11:03 AM:


Fix for TOMEE-798 causes this issue


was (Author: janssk1):
TOMEE-798 causes this issue

> 'Tweaks' to a (native) query are lost when running without a tx
> ---
>
> Key: OPENEJB-2112
> URL: https://issues.apache.org/jira/browse/OPENEJB-2112
> Project: OpenEJB
>  Issue Type: Bug
>  Components: ejb31
>Affects Versions: 4.7.1
>Reporter: gui
>
> I'm trying to upgrade from 4.5.1
> In our code, we create a nativeQuery and add some hibernate specific stuff:
> {code}
> Query query = entityManager.createNativeQuery(queryString);
> SQLQuery hibernateQuery = query.unwrap(SQLQuery.class);
> hibernateQuery.addScalar("device_pk", new LongType());
> query.getResultList()
> {code}
> However , 4.7.1 fails on this code. Since there is no tx active (on purpose) 
> the JtaQuery wrapper insists on creating a new Query object during 
> getResltLIst, loosing the customization. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (OPENEJB-2112) 'Tweaks' to a (native) query are lost when running without a tx

2015-03-26 Thread gui (JIRA)
gui created OPENEJB-2112:


 Summary: 'Tweaks' to a (native) query are lost when running 
without a tx
 Key: OPENEJB-2112
 URL: https://issues.apache.org/jira/browse/OPENEJB-2112
 Project: OpenEJB
  Issue Type: Bug
  Components: ejb31
Affects Versions: 4.7.1
Reporter: gui


I'm trying to upgrade from 4.5.1
In our code, we create a nativeQuery and add some hibernate specific stuff:
{code}
Query query = entityManager.createNativeQuery(queryString);
SQLQuery hibernateQuery = query.unwrap(SQLQuery.class);
hibernateQuery.addScalar("device_pk", new LongType());
query.getResultList()

{code}
However , 4.7.1 fails on this code. Since there is no tx active (on purpose) 
the JtaQuery wrapper insists on creating a new Query object during 
getResltLIst, loosing the customization. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (TOMEE-1533) Tomee - with invalid url-pattern - No naming context bound to this class loader

2015-03-26 Thread Romain Manni-Bucau (JIRA)

[ 
https://issues.apache.org/jira/browse/TOMEE-1533?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14381608#comment-14381608
 ] 

Romain Manni-Bucau commented on TOMEE-1533:
---

Hi

do you have the previous error, this one should be only a consequence

> Tomee -  with invalid url-pattern - No naming context 
> bound to this class loader
> -
>
> Key: TOMEE-1533
> URL: https://issues.apache.org/jira/browse/TOMEE-1533
> Project: TomEE
>  Issue Type: Bug
>Affects Versions: 1.7.1
> Environment: Windows 7, JDK 1.7.0_72, 64bit
>Reporter: Apache Fan
>
> Specifying an "invalid" url-pattern in web.xml's  causes 
> not expressive exception.
> Valid: *.jsp
> Invalid: /*.jsp
> The exception received does not indicate what could be the problem, it should 
> be improved:
> {noformat}
> 2015-03-26 09:57:34 WARNING org.apache.catalina.deploy.NamingResources 
> cleanUp() | Failed to retrieve JNDI naming context for container 
> [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/projectscope]]
>  so no cleanup was performed for that container
> javax.naming.NamingException: No naming context bound to this class loader
>   at 
> org.apache.naming.ContextBindings.getClassLoader(ContextBindings.java:350)
>   at 
> org.apache.catalina.deploy.NamingResources.cleanUp(NamingResources.java:985)
>   at 
> org.apache.catalina.deploy.NamingResources.stopInternal(NamingResources.java:968)
>   at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
>   at 
> org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5702)
>   at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
>   at 
> org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:272)
>   at 
> org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:1041)
>   at 
> org.apache.tomee.catalina.TomcatWebAppBuilder.undeploy(TomcatWebAppBuilder.java:1524)
>   at 
> org.apache.tomee.catalina.TomcatWebAppBuilder.undeploy(TomcatWebAppBuilder.java:1505)
>   at 
> org.apache.tomee.catalina.TomcatWebAppBuilder.undeployWebApps(TomcatWebAppBuilder.java:747)
>   at 
> org.apache.openejb.assembler.classic.Assembler.destroyApplication(Assembler.java:1668)
>   at 
> org.apache.openejb.assembler.classic.Assembler.destroyApplication(Assembler.java:1526)
>   at 
> org.apache.openejb.assembler.classic.Assembler.destroy(Assembler.java:1367)
>   at org.apache.openejb.OpenEJB.destroy(OpenEJB.java:266)
>   at org.apache.tomee.catalina.TomcatLoader.destroy(TomcatLoader.java:400)
>   at 
> org.apache.tomee.catalina.TomcatWebAppBuilder.afterStop(TomcatWebAppBuilder.java:1981)
>   at 
> org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:157)
>   at 
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
>   at 
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
>   at 
> org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
>   at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:252)
>   at 
> org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:272)
>   at org.apache.catalina.startup.Catalina.start(Catalina.java:693)
>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>   at java.lang.reflect.Method.invoke(Unknown Source)
>   at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:321)
>   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)
> {noformat}
> Sample web.xml:
> {noformat}
> 
> 
>   The secured web pages
>   /*.jsp
> 
> 
>CN=x,,OU=z,DC=a,DC=com
> 
> 
> CONFIDENTIAL
> 
>   
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (TOMEE-1533) Tomee - with invalid url-pattern - No naming context bound to this class loader

2015-03-26 Thread Apache Fan (JIRA)
Apache Fan created TOMEE-1533:
-

 Summary: Tomee -  with invalid url-pattern - 
No naming context bound to this class loader
 Key: TOMEE-1533
 URL: https://issues.apache.org/jira/browse/TOMEE-1533
 Project: TomEE
  Issue Type: Bug
Affects Versions: 1.7.1
 Environment: Windows 7, JDK 1.7.0_72, 64bit
Reporter: Apache Fan


Specifying an "invalid" url-pattern in web.xml's  causes 
not expressive exception.

Valid: *.jsp
Invalid: /*.jsp

The exception received does not indicate what could be the problem, it should 
be improved:

{noformat}
2015-03-26 09:57:34 WARNING org.apache.catalina.deploy.NamingResources 
cleanUp() | Failed to retrieve JNDI naming context for container 
[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/projectscope]]
 so no cleanup was performed for that container
javax.naming.NamingException: No naming context bound to this class loader
at 
org.apache.naming.ContextBindings.getClassLoader(ContextBindings.java:350)
at 
org.apache.catalina.deploy.NamingResources.cleanUp(NamingResources.java:985)
at 
org.apache.catalina.deploy.NamingResources.stopInternal(NamingResources.java:968)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
at 
org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5702)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
at 
org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:272)
at 
org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:1041)
at 
org.apache.tomee.catalina.TomcatWebAppBuilder.undeploy(TomcatWebAppBuilder.java:1524)
at 
org.apache.tomee.catalina.TomcatWebAppBuilder.undeploy(TomcatWebAppBuilder.java:1505)
at 
org.apache.tomee.catalina.TomcatWebAppBuilder.undeployWebApps(TomcatWebAppBuilder.java:747)
at 
org.apache.openejb.assembler.classic.Assembler.destroyApplication(Assembler.java:1668)
at 
org.apache.openejb.assembler.classic.Assembler.destroyApplication(Assembler.java:1526)
at 
org.apache.openejb.assembler.classic.Assembler.destroy(Assembler.java:1367)
at org.apache.openejb.OpenEJB.destroy(OpenEJB.java:266)
at org.apache.tomee.catalina.TomcatLoader.destroy(TomcatLoader.java:400)
at 
org.apache.tomee.catalina.TomcatWebAppBuilder.afterStop(TomcatWebAppBuilder.java:1981)
at 
org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:157)
at 
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at 
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at 
org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:252)
at 
org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:272)
at org.apache.catalina.startup.Catalina.start(Catalina.java:693)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:321)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)
{noformat}

Sample web.xml:
{noformat}


  The secured web pages
  /*.jsp


   CN=x,,OU=z,DC=a,DC=com


CONFIDENTIAL

  
{noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Resolved] (TOMEE-1531) TomEE 2 + Mojarra 2.2.10 NPE when navigating into a flow

2015-03-26 Thread Romain Manni-Bucau (JIRA)

 [ 
https://issues.apache.org/jira/browse/TOMEE-1531?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Romain Manni-Bucau resolved TOMEE-1531.
---
   Resolution: Fixed
Fix Version/s: 2.0.0-Milestone-1
 Assignee: Romain Manni-Bucau

this needs an openwebbeans upgrade (ie redeployment of owb snapshot + tomee 
redeployment as well) but it is fixed using both snapshots up to date

> TomEE 2 + Mojarra 2.2.10 NPE when navigating into a flow
> 
>
> Key: TOMEE-1531
> URL: https://issues.apache.org/jira/browse/TOMEE-1531
> Project: TomEE
>  Issue Type: Bug
>Affects Versions: 2.0.0
>Reporter: Roger Ripley
>Assignee: Romain Manni-Bucau
> Fix For: 2.0.0-Milestone-1
>
>
> On the latest snapshot of TomEE 2, switching out MyFaces for Mojarra 2.2.10, 
> you get a NullPointerException when trying to navigate into a JSF flow.  I'm 
> using the example here: http://www.byteslounge.com/tutorials/jsf-flow-example 
> with the required change of making OrderBean passivatible by having it 
> implement Serializable.
> This is the stack trace:
> java.lang.NullPointerException
>   com.sun.faces.flow.FlowCDIContext.get(FlowCDIContext.java:451)
>   
> org.apache.webbeans.context.CustomPassivatingContextImpl.get(CustomPassivatingContextImpl.java:46)
>   
> org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler.getContextualInstance(NormalScopedBeanInterceptorHandler.java:100)
>   
> org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler.get(NormalScopedBeanInterceptorHandler.java:70)
>   
> com.byteslounge.flow.order.OrderBean$$OwbNormalScopeProxy0.getItemCount(com/byteslounge/flow/order/OrderBean.java)
>   sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>   
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>   
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>   java.lang.reflect.Method.invoke(Method.java:483)
>   javax.el.BeanELResolver.getValue(BeanELResolver.java:97)
>   
> com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
>   
> com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
>   org.apache.el.parser.AstValue.getValue(AstValue.java:167)
>   org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:184)
>   
> org.apache.webbeans.el22.WrappedValueExpression.getValue(WrappedValueExpression.java:70)
>   
> com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109)
>   
> javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:194)
>   
> javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:182)
>   javax.faces.component.UIOutput.getValue(UIOutput.java:174)
>   javax.faces.component.UIInput.getValue(UIInput.java:291)
>   
> com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:205)
>   
> com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:355)
>   
> com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:164)
>   
> javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919)
>   javax.faces.component.UIComponent.encodeAll(UIComponent.java:1863)
>   javax.faces.render.Renderer.encodeChildren(Renderer.java:176)
>   
> javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:889)
>   javax.faces.component.UIComponent.encodeAll(UIComponent.java:1856)
>   javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
>   javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
>   
> com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:456)
>   
> com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:133)
>   
> javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337)
>   
> com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
>   com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
>   com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
>   javax.faces.webapp.FacesServlet.service(FacesServlet.java:647)
>   org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
>   
> org.apache.openejb.server.httpd.WebBeansFilter.doFilter(WebBeansFilter.java:51)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (TOMEE-1021) Allow read JSF 2.2 faces-config.xml files

2015-03-26 Thread Romain Manni-Bucau (JIRA)

[ 
https://issues.apache.org/jira/browse/TOMEE-1021?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14381555#comment-14381555
 ] 

Romain Manni-Bucau commented on TOMEE-1021:
---

well 2.0 should let it be now even if not read/parsed. 1.7 doesnt

> Allow read JSF 2.2 faces-config.xml files
> -
>
> Key: TOMEE-1021
> URL: https://issues.apache.org/jira/browse/TOMEE-1021
> Project: TomEE
>  Issue Type: Improvement
>Reporter: Leonardo Uribe
> Fix For: 1.7.0
>
>
> Hi
> I'm working on MyFaces 2.2.x, and on the way I have found that Tomee doesn't 
> allow faces-config.xml files in JSF 2.2 format. Since the spec was out some 
> months ago, it would be great if you guys can allow this so I can test 
> MyFaces 2.2.x + Tomee just changing the jars. 
> Here is the exception I have:
> org.apache.catalina.LifecycleException: Failed to start component 
> [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
>   at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
>   at 
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
>   at 
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
>   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
>   at 
> org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1113)
>   at 
> org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1671)
>   at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
>   at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
>   at java.util.concurrent.FutureTask.run(FutureTask.java:166)
>   at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>   at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>   at java.lang.Thread.run(Thread.java:724)
> Caused by: org.apache.tomee.catalina.TomEERuntimeException: 
> org.apache.openejb.OpenEJBException: Cannot unmarshall the faces 
> configuration file: Unexpected element 
> {http://xmlns.jcp.org/xml/ns/javaee}flow-definition, expected 
> [{http://java.sun.com/xml/ns/javaee}application, 
> {http://java.sun.com/xml/ns/javaee}ordering, 
> {http://java.sun.com/xml/ns/javaee}absolute-ordering, 
> {http://java.sun.com/xml/ns/javaee}factory, 
> {http://java.sun.com/xml/ns/javaee}component, 
> {http://java.sun.com/xml/ns/javaee}converter, 
> {http://java.sun.com/xml/ns/javaee}managed-bean, 
> {http://java.sun.com/xml/ns/javaee}name, 
> {http://java.sun.com/xml/ns/javaee}navigation-rule, 
> {http://java.sun.com/xml/ns/javaee}referenced-bean, 
> {http://java.sun.com/xml/ns/javaee}render-kit, 
> {http://java.sun.com/xml/ns/javaee}lifecycle, 
> {http://java.sun.com/xml/ns/javaee}validator, 
> {http://java.sun.com/xml/ns/javaee}behavior, 
> {http://java.sun.com/xml/ns/javaee}faces-config-extension]
>   at 
> org.apache.tomee.catalina.TomcatWebAppBuilder.loadApplication(TomcatWebAppBuilder.java:1953)
>   at 
> org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1025)
>   at 
> org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:985)
>   at 
> org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:127)
>   at 
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
>   at 
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
>   at 
> org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5322)
>   at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
>   ... 11 more
> Caused by: org.apache.openejb.OpenEJBException: Cannot unmarshall the faces 
> configuration file: : Unexpected element 
> {http://xmlns.jcp.org/xml/ns/javaee}flow-definition, expected 
> [{http://java.sun.com/xml/ns/javaee}application, 
> {http://java.sun.com/xml/ns/javaee}ordering, 
> {http://java.sun.com/xml/ns/javaee}absolute-ordering, 
> {http://java.sun.com/xml/ns/javaee}factory, 
> {http://java.sun.com/xml/ns/javaee}component, 
> {http://java.sun.com/xml/ns/javaee}converter, 
> {http://java.sun.com/xml/ns/javaee}managed-bean, 
> {http://java.sun.com/xml/ns/javaee}name, 
> {http://java.sun.com/xml/ns/javaee}navigation-rule, 
> {http://java.sun.com/xml/ns/javaee}referenced-bean, 
> {http://java.sun.com/xml/ns/javaee}render-kit, 
> {http://java.sun.com/xml/ns/javaee}lifecycle, 
> {http://java.sun.com/xml/ns/javaee}validator, 
> {http://java.sun.com/xml/ns/javaee}behavior, 
> {http://java.sun.com/xml/ns/javaee}faces-config-extension]
>   at 
> org.apache.openejb.config.ReadDescriptors.readFacesConfig(ReadDescriptors.java:824)
>   a

[1/2] tomee git commit: TOMEE-1530 try to guess app ctx if not found from class

2015-03-26 Thread rmannibucau
Repository: tomee
Updated Branches:
  refs/heads/master 9c6a31497 -> 849292df6


TOMEE-1530 try to guess app ctx if not found from class


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/f24db560
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/f24db560
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/f24db560

Branch: refs/heads/master
Commit: f24db560b815ccd3f8c1964fb04934ec754481b7
Parents: 9c6a314
Author: Romain Manni-Bucau 
Authored: Wed Mar 25 11:35:27 2015 +0100
Committer: Romain Manni-Bucau 
Committed: Wed Mar 25 11:35:27 2015 +0100

--
 .../arquillian/common/enrichment/OpenEJBEnricher.java   | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tomee/blob/f24db560/arquillian/arquillian-common/src/main/java/org/apache/openejb/arquillian/common/enrichment/OpenEJBEnricher.java
--
diff --git 
a/arquillian/arquillian-common/src/main/java/org/apache/openejb/arquillian/common/enrichment/OpenEJBEnricher.java
 
b/arquillian/arquillian-common/src/main/java/org/apache/openejb/arquillian/common/enrichment/OpenEJBEnricher.java
index 6cea677..aa7eb7e 100644
--- 
a/arquillian/arquillian-common/src/main/java/org/apache/openejb/arquillian/common/enrichment/OpenEJBEnricher.java
+++ 
b/arquillian/arquillian-common/src/main/java/org/apache/openejb/arquillian/common/enrichment/OpenEJBEnricher.java
@@ -27,6 +27,7 @@ import org.apache.openejb.core.ThreadContext;
 import org.apache.openejb.core.WebContext;
 import org.apache.openejb.loader.SystemInstance;
 import org.apache.openejb.spi.ContainerSystem;
+import org.apache.openejb.util.AppFinder;
 import org.apache.webbeans.annotation.AnyLiteral;
 import org.apache.webbeans.annotation.DefaultLiteral;
 import org.apache.webbeans.config.WebBeansContext;
@@ -61,11 +62,15 @@ public final class OpenEJBEnricher {
 // no-op
 }
 
-public static void enrich(final Object testInstance, final AppContext ctx) 
{
+public static void enrich(final Object testInstance, final AppContext 
appCtx) {
 // don't rely on arquillian since this enrichment should absolutely be 
done before the following ones
 new MockitoEnricher().enrich(testInstance);
+AppContext ctx = appCtx;
 if (ctx == null) {
-return;
+ctx = 
AppFinder.findAppContextOrWeb(Thread.currentThread().getContextClassLoader(), 
AppFinder.AppContextTransformer.INSTANCE);
+if (ctx == null) {
+return;
+}
 }
 
 final BeanContext context = 
SystemInstance.get().getComponent(ContainerSystem.class).getBeanContext(ctx.getId()
 + "_" + testInstance.getClass().getName());



[2/2] tomee git commit: TOMEE-1021 fully tolerate faces-config.xml ee namespace even when unknown while we don't upgrade our model

2015-03-26 Thread rmannibucau
TOMEE-1021 fully tolerate faces-config.xml ee namespace even when unknown while 
we don't upgrade our model


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/849292df
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/849292df
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/849292df

Branch: refs/heads/master
Commit: 849292df65394762a97cb47e3276715433a3116d
Parents: f24db56
Author: Romain Manni-Bucau 
Authored: Thu Mar 26 09:23:40 2015 +0100
Committer: Romain Manni-Bucau 
Committed: Thu Mar 26 09:23:40 2015 +0100

--
 .../org/apache/openejb/jee/FacesConfig$JAXB.java |  2 +-
 .../src/test/resources/a-faces-config-22.xml | 15 ++-
 2 files changed, 15 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/tomee/blob/849292df/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/FacesConfig$JAXB.java
--
diff --git 
a/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/FacesConfig$JAXB.java
 
b/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/FacesConfig$JAXB.java
index e5d1554..3d5c320 100644
--- 
a/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/FacesConfig$JAXB.java
+++ 
b/container/openejb-jee-accessors/src/main/java/org/apache/openejb/jee/FacesConfig$JAXB.java
@@ -336,7 +336,7 @@ public class FacesConfig$JAXB
 }
 }
 facesConfigExtension.add(facesConfigExtensionItem);
-} else if (("flow-definition" == elementReader.getLocalName()) && 
("http://java.sun.com/xml/ns/javaee"; == elementReader.getNamespaceURI())) {
+} else if ("http://java.sun.com/xml/ns/javaee"; == 
elementReader.getNamespaceURI()) {
 // just here ATM to not prevent users to get JSF 2.2 feature 
because we can't read it
 // TODO:  read it if we need it (= classes to add to 
injectable classes, other file to parse to find them etc...)
 } else {

http://git-wip-us.apache.org/repos/asf/tomee/blob/849292df/container/openejb-jee-accessors/src/test/resources/a-faces-config-22.xml
--
diff --git 
a/container/openejb-jee-accessors/src/test/resources/a-faces-config-22.xml 
b/container/openejb-jee-accessors/src/test/resources/a-faces-config-22.xml
index f388a26..1731a63 100644
--- a/container/openejb-jee-accessors/src/test/resources/a-faces-config-22.xml
+++ b/container/openejb-jee-accessors/src/test/resources/a-faces-config-22.xml
@@ -20,7 +20,10 @@
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
   xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
   
http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd";>
-
+  
+com.foo.Bar
+com.foo.Dummy
+  
   
 UnknownButSuperResolver
 
@@ -52,4 +55,14 @@
   
 
   
+  
+myLetters
+/portal/letter/letterList.xhtml
+
+  
+type
+LETTER
+  
+
+  
 



[jira] [Commented] (TOMEE-1532) EJB-references declared at superclasses residing in libraries aren't considered

2015-03-26 Thread Romain Manni-Bucau (JIRA)

[ 
https://issues.apache.org/jira/browse/TOMEE-1532?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14381540#comment-14381540
 ] 

Romain Manni-Bucau commented on TOMEE-1532:
---

Hi

we are in the process of release xbean (v4.2) to upgrade it for tomee. This 
should fix it.

> EJB-references declared at superclasses residing in libraries aren't 
> considered
> ---
>
> Key: TOMEE-1532
> URL: https://issues.apache.org/jira/browse/TOMEE-1532
> Project: TomEE
>  Issue Type: Bug
>Affects Versions: 1.7.1
>Reporter: Barnabas Bodnar
> Attachments: no-ejb-ref-from-superclass.zip
>
>
> EJB-references (both injected and via JNDI) declared at a superclass of an 
> EJB are ignored by TomEE 1.7.1, if the superclass resides in a library-module.
> Application-servers from the JBoss7-family, as well as Oracle Weblogic 12 and 
> IBM Websphere 8 set such EJB-references correctly.
> The attached application demonstrates this behavior: the startup-singleton 
> "ReferencingEJB" has a locally declared reference to "EJB2" and inherits 
> references to "EJB1" declared in the superclass "EJBSuperclass" residing in a 
> library-module. The availability of the EJB-references is checked in a 
> post-construct-method and produces the following output:
> {noformat}
> ===
> Local injected EJB-reference: set
> Local EJB-reference in the JNDI-context: set
> Inherited injected EJB-reference: not set
> Inherited EJB-reference in the JNDI-context: not set
> ===
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)