[jira] [Commented] (TOMEE-2087) IvmContext.list() does not correctly list the context content

2017-07-19 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on TOMEE-2087:
---

Github user asfgit closed the pull request at:

https://github.com/apache/tomee/pull/88


> IvmContext.list() does not correctly list the context content
> -
>
> Key: TOMEE-2087
> URL: https://issues.apache.org/jira/browse/TOMEE-2087
> Project: TomEE
>  Issue Type: Bug
>Reporter: Svetlin Zarev
>Priority: Critical
> Attachments: sample.zip
>
>
> MyNamingEnumeration.gatherNodes() adds the wrong federated context entries in 
> the result set (related to TOMEE-2086 - it was indeed a typo, but we "fixed" 
> it with the wrong NameNode).
> Another issue is with MyNamingEnumeration.isMyChild() which considers entries 
> that are NOT children to the "parent" tree as such
> One more issue is that the wrong parentNode is passed as argument to 
> gatherNodes in case we are listing the context for any "IvmContext != this"
> To give an example:
> Expected context content:
> {code}
> ### Context: /module
> Name: TestEJB!org.example.TestEJB 
> Class=org.apache.openejb.assembler.classic.JndiBuilder$ContextualEjbLookup
>   [looking up: TestEJB!org.example.TestEJB]   [Value]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> Name: TestEJB 
> Class=org.apache.openejb.assembler.classic.JndiBuilder$ContextualEjbLookup
>   [looking up: TestEJB]   [Value]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> Name: ModuleName  Class=java.lang.String  [looking up: ModuleName]
> [Value]: 
> Name: env Class=org.apache.naming.NamingContext   [looking up: env]   
> [Value]: org.apache.naming.NamingContext@1bb2d0a8
> ### Context: /module/env
> Name: nameClass=java.lang.String  [looking up: name]  [Value]: 
> module-env
> {code} 
> Actual context content:
> {code}
> ### Context: /module
> Name: global  Class=org.apache.openejb.core.ivm.naming.IvmContext 
> [looking up: global]> Failed to lookup: global
> Name: dummy   Class=java.lang.String  [looking up: dummy] > Failed to 
> lookup: dummy
> Name: TestEJB!org.example.TestEJB 
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference 
> [looking up: TestEJB!org.example.TestEJB]   [Reference]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> Name: TestEJB 
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference 
> [looking up: TestEJB]   [Reference]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> Name: ModuleName  Class=java.lang.String  [looking up: ModuleName]
> [Value]: 
> Name: env Class=org.apache.openejb.core.ivm.naming.IvmContext 
> [looking up: env]   [Value]: IvmContext{mynode=}
> Name: TestEJB!org.example.TestEJB 
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference 
> [looking up: TestEJB!org.example.TestEJB]   [Reference]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> Name: TestEJB 
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference 
> [looking up: TestEJB]   [Reference]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> ### Context: /module/env
> Name: TestEJB!org.example.TestEJB 
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference 
> [looking up: TestEJB!org.example.TestEJB]   > Failed to lookup: 
> TestEJB!org.example.TestEJB
> Name: TestEJB 
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference 
> [looking up: TestEJB]   > Failed to lookup: TestEJB
> Name: nameClass=java.lang.String  [looking up: name]  [Value]: 
> module-env
> {code}
> Note the "failed too lookup..." messages - these are all objects that MUST 
> NOT be listed as part of that context.
> I'm attaching an application that reproduces the issue. 
> Requesting it like "http://localhost:8080/?ejb; will print tomee's naming tree
> Requesting it like "http://localhost:8080; will print tomcat's naming tree



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (TOMEE-2087) IvmContext.list() does not correctly list the context content

2017-07-19 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on TOMEE-2087:
---

Github user jeanouii commented on the issue:

https://github.com/apache/tomee/pull/88
  
Hi,

As discussed and agreed on the mailing list, I'll be merging this PR on 
master.
Thanks you very much for you contribution, code wise, but also on the 
mailing list.

JLouis




> IvmContext.list() does not correctly list the context content
> -
>
> Key: TOMEE-2087
> URL: https://issues.apache.org/jira/browse/TOMEE-2087
> Project: TomEE
>  Issue Type: Bug
>Reporter: Svetlin Zarev
>Priority: Critical
> Attachments: sample.zip
>
>
> MyNamingEnumeration.gatherNodes() adds the wrong federated context entries in 
> the result set (related to TOMEE-2086 - it was indeed a typo, but we "fixed" 
> it with the wrong NameNode).
> Another issue is with MyNamingEnumeration.isMyChild() which considers entries 
> that are NOT children to the "parent" tree as such
> One more issue is that the wrong parentNode is passed as argument to 
> gatherNodes in case we are listing the context for any "IvmContext != this"
> To give an example:
> Expected context content:
> {code}
> ### Context: /module
> Name: TestEJB!org.example.TestEJB 
> Class=org.apache.openejb.assembler.classic.JndiBuilder$ContextualEjbLookup
>   [looking up: TestEJB!org.example.TestEJB]   [Value]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> Name: TestEJB 
> Class=org.apache.openejb.assembler.classic.JndiBuilder$ContextualEjbLookup
>   [looking up: TestEJB]   [Value]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> Name: ModuleName  Class=java.lang.String  [looking up: ModuleName]
> [Value]: 
> Name: env Class=org.apache.naming.NamingContext   [looking up: env]   
> [Value]: org.apache.naming.NamingContext@1bb2d0a8
> ### Context: /module/env
> Name: nameClass=java.lang.String  [looking up: name]  [Value]: 
> module-env
> {code} 
> Actual context content:
> {code}
> ### Context: /module
> Name: global  Class=org.apache.openejb.core.ivm.naming.IvmContext 
> [looking up: global]> Failed to lookup: global
> Name: dummy   Class=java.lang.String  [looking up: dummy] > Failed to 
> lookup: dummy
> Name: TestEJB!org.example.TestEJB 
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference 
> [looking up: TestEJB!org.example.TestEJB]   [Reference]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> Name: TestEJB 
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference 
> [looking up: TestEJB]   [Reference]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> Name: ModuleName  Class=java.lang.String  [looking up: ModuleName]
> [Value]: 
> Name: env Class=org.apache.openejb.core.ivm.naming.IvmContext 
> [looking up: env]   [Value]: IvmContext{mynode=}
> Name: TestEJB!org.example.TestEJB 
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference 
> [looking up: TestEJB!org.example.TestEJB]   [Reference]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> Name: TestEJB 
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference 
> [looking up: TestEJB]   [Reference]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> ### Context: /module/env
> Name: TestEJB!org.example.TestEJB 
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference 
> [looking up: TestEJB!org.example.TestEJB]   > Failed to lookup: 
> TestEJB!org.example.TestEJB
> Name: TestEJB 
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference 
> [looking up: TestEJB]   > Failed to lookup: TestEJB
> Name: nameClass=java.lang.String  [looking up: name]  [Value]: 
> module-env
> {code}
> Note the "failed too lookup..." messages - these are all objects that MUST 
> NOT be listed as part of that context.
> I'm attaching an application that reproduces the issue. 
> Requesting it like "http://localhost:8080/?ejb; will print tomee's naming tree
> Requesting it like "http://localhost:8080; will print tomcat's naming tree



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (TOMEE-2087) IvmContext.list() does not correctly list the context content

2017-07-14 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on TOMEE-2087:
---

Github user SvetlinZarev commented on a diff in the pull request:

https://github.com/apache/tomee/pull/88#discussion_r127458469
  
--- Diff: 
arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/naming/IvmContextTest.java
 ---
@@ -0,0 +1,67 @@
+/*
+ * 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.arquillian.tests.naming;
+
+import org.apache.openejb.arquillian.tests.Runner;
+import org.apache.ziplock.JarLocation;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.ClassLoaderAsset;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import javax.ejb.EJB;
+import java.util.logging.Logger;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+@RunWith(Arquillian.class)
+public class IvmContextTest {
+private static final Logger logger = 
Logger.getLogger(IvmContextTest.class.getName());
+private static final String TEST_NAME = 
IvmContextTest.class.getSimpleName();
+private static final String RESOURCE_EJB_JAR_XML = "ejb-jar.xml";
+private static final String CONTENT_LOCATION_EJB_JAR_XML = 
"org/apache/openejb/arquillian/tests/naming/list-context-ejbjar.xml";
+
+@EJB
+NamingBean namingBean;
--- End diff --

No, I will make it private


> IvmContext.list() does not correctly list the context content
> -
>
> Key: TOMEE-2087
> URL: https://issues.apache.org/jira/browse/TOMEE-2087
> Project: TomEE
>  Issue Type: Bug
>Reporter: Svetlin Zarev
>Priority: Critical
> Attachments: sample.zip
>
>
> MyNamingEnumeration.gatherNodes() adds the wrong federated context entries in 
> the result set (related to TOMEE-2086 - it was indeed a typo, but we "fixed" 
> it with the wrong NameNode).
> Another issue is with MyNamingEnumeration.isMyChild() which considers entries 
> that are NOT children to the "parent" tree as such
> One more issue is that the wrong parentNode is passed as argument to 
> gatherNodes in case we are listing the context for any "IvmContext != this"
> To give an example:
> Expected context content:
> {code}
> ### Context: /module
> Name: TestEJB!org.example.TestEJB 
> Class=org.apache.openejb.assembler.classic.JndiBuilder$ContextualEjbLookup
>   [looking up: TestEJB!org.example.TestEJB]   [Value]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> Name: TestEJB 
> Class=org.apache.openejb.assembler.classic.JndiBuilder$ContextualEjbLookup
>   [looking up: TestEJB]   [Value]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> Name: ModuleName  Class=java.lang.String  [looking up: ModuleName]
> [Value]: 
> Name: env Class=org.apache.naming.NamingContext   [looking up: env]   
> [Value]: org.apache.naming.NamingContext@1bb2d0a8
> ### Context: /module/env
> Name: nameClass=java.lang.String  [looking up: name]  [Value]: 
> module-env
> {code} 
> Actual context content:
> {code}
> ### Context: /module
> Name: global  Class=org.apache.openejb.core.ivm.naming.IvmContext 
> [looking up: global]> Failed to lookup: global
> Name: dummy   Class=java.lang.String  [looking up: dummy] > Failed to 
> lookup: dummy
> Name: TestEJB!org.example.TestEJB 
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference 
> [looking up: TestEJB!org.example.TestEJB]   [Reference]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> Name: TestEJB 

[jira] [Commented] (TOMEE-2087) IvmContext.list() does not correctly list the context content

2017-07-14 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on TOMEE-2087:
---

Github user otaviojava commented on a diff in the pull request:

https://github.com/apache/tomee/pull/88#discussion_r127457343
  
--- Diff: 
arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/naming/NamingBean.java
 ---
@@ -0,0 +1,136 @@
+/*
+ * 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.arquillian.tests.naming;
+
+import org.apache.openejb.core.interceptor.Interceptor;
+import org.apache.openejb.core.ivm.naming.SystemComponentReference;
+
+import javax.ejb.LocalBean;
+import javax.ejb.Stateless;
+import javax.naming.*;
+import java.io.ByteArrayOutputStream;
+import java.io.PrintWriter;
+import java.io.UnsupportedEncodingException;
+import java.nio.charset.StandardCharsets;
+import java.util.HashMap;
+import java.util.Map;
+
+@Stateless
+@LocalBean
+public class NamingBean {
+private interface ListOperation {
+NamingEnumeration execute(Context 
context, String address) throws NamingException;
+}
+
+public void verifyContextList() throws NamingException {
+verifyContextListInternal(new ListOperation() {
+@Override
+public NamingEnumeration execute(Context 
context, String address) throws NamingException {
+return context.list(address);
+}
+});
+}
+
+public void verifyContextListBindings() throws NamingException {
+verifyContextListInternal(new ListOperation() {
+@Override
+public NamingEnumeration execute(Context context, 
String address) throws NamingException {
+return context.listBindings(address);
+}
+});
+}
+
+private void verifyContextListInternal(ListOperation listOperation) 
throws NamingException {
+final ByteArrayOutputStream buffer = new ByteArrayOutputStream();
+final PrintWriter logSink = new PrintWriter(buffer);
+
+final InitialContext ctx = new InitialContext();
+final boolean hasErrors = listContext(ctx, "", listOperation, 
logSink);
+logSink.flush();
+
+if (hasErrors) {
+throw new IllegalStateException("Failed to lookup some of the 
listed entries:\n" + getPrintedJndiTree(buffer));
+}
+}
+
+private String getPrintedJndiTree(ByteArrayOutputStream buffer) {
+try {
+return buffer.toString("utf-8");
--- End diff --

Maybe a constant.
:warning: `buffer.toString(StandardCharsets.UTF_8.name());`


https://docs.oracle.com/javase/7/docs/api/java/nio/charset/StandardCharsets.html#UTF_8


> IvmContext.list() does not correctly list the context content
> -
>
> Key: TOMEE-2087
> URL: https://issues.apache.org/jira/browse/TOMEE-2087
> Project: TomEE
>  Issue Type: Bug
>Reporter: Svetlin Zarev
>Priority: Critical
> Attachments: sample.zip
>
>
> MyNamingEnumeration.gatherNodes() adds the wrong federated context entries in 
> the result set (related to TOMEE-2086 - it was indeed a typo, but we "fixed" 
> it with the wrong NameNode).
> Another issue is with MyNamingEnumeration.isMyChild() which considers entries 
> that are NOT children to the "parent" tree as such
> One more issue is that the wrong parentNode is passed as argument to 
> gatherNodes in case we are listing the context for any "IvmContext != this"
> To give an example:
> Expected context content:
> {code}
> ### Context: /module
> Name: TestEJB!org.example.TestEJB 
> 

[jira] [Commented] (TOMEE-2087) IvmContext.list() does not correctly list the context content

2017-07-14 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on TOMEE-2087:
---

Github user otaviojava commented on a diff in the pull request:

https://github.com/apache/tomee/pull/88#discussion_r127456747
  
--- Diff: 
arquillian/arquillian-tomee-tests/arquillian-tomee-webprofile-tests/src/test/java/org/apache/openejb/arquillian/tests/naming/IvmContextTest.java
 ---
@@ -0,0 +1,67 @@
+/*
+ * 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.arquillian.tests.naming;
+
+import org.apache.openejb.arquillian.tests.Runner;
+import org.apache.ziplock.JarLocation;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.ClassLoaderAsset;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import javax.ejb.EJB;
+import java.util.logging.Logger;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+@RunWith(Arquillian.class)
+public class IvmContextTest {
+private static final Logger logger = 
Logger.getLogger(IvmContextTest.class.getName());
+private static final String TEST_NAME = 
IvmContextTest.class.getSimpleName();
+private static final String RESOURCE_EJB_JAR_XML = "ejb-jar.xml";
+private static final String CONTENT_LOCATION_EJB_JAR_XML = 
"org/apache/openejb/arquillian/tests/naming/list-context-ejbjar.xml";
+
+@EJB
+NamingBean namingBean;
--- End diff --

Is there any problem, if namingBean be a private attribute?


> IvmContext.list() does not correctly list the context content
> -
>
> Key: TOMEE-2087
> URL: https://issues.apache.org/jira/browse/TOMEE-2087
> Project: TomEE
>  Issue Type: Bug
>Reporter: Svetlin Zarev
>Priority: Critical
> Attachments: sample.zip
>
>
> MyNamingEnumeration.gatherNodes() adds the wrong federated context entries in 
> the result set (related to TOMEE-2086 - it was indeed a typo, but we "fixed" 
> it with the wrong NameNode).
> Another issue is with MyNamingEnumeration.isMyChild() which considers entries 
> that are NOT children to the "parent" tree as such
> One more issue is that the wrong parentNode is passed as argument to 
> gatherNodes in case we are listing the context for any "IvmContext != this"
> To give an example:
> Expected context content:
> {code}
> ### Context: /module
> Name: TestEJB!org.example.TestEJB 
> Class=org.apache.openejb.assembler.classic.JndiBuilder$ContextualEjbLookup
>   [looking up: TestEJB!org.example.TestEJB]   [Value]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> Name: TestEJB 
> Class=org.apache.openejb.assembler.classic.JndiBuilder$ContextualEjbLookup
>   [looking up: TestEJB]   [Value]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> Name: ModuleName  Class=java.lang.String  [looking up: ModuleName]
> [Value]: 
> Name: env Class=org.apache.naming.NamingContext   [looking up: env]   
> [Value]: org.apache.naming.NamingContext@1bb2d0a8
> ### Context: /module/env
> Name: nameClass=java.lang.String  [looking up: name]  [Value]: 
> module-env
> {code} 
> Actual context content:
> {code}
> ### Context: /module
> Name: global  Class=org.apache.openejb.core.ivm.naming.IvmContext 
> [looking up: global]> Failed to lookup: global
> Name: dummy   Class=java.lang.String  [looking up: dummy] > Failed to 
> lookup: dummy
> Name: TestEJB!org.example.TestEJB 
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference 
> [looking up: TestEJB!org.example.TestEJB]   [Reference]: 
> 

[jira] [Commented] (TOMEE-2087) IvmContext.list() does not correctly list the context content

2017-07-10 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on TOMEE-2087:
---

GitHub user SvetlinZarev opened a pull request:

https://github.com/apache/tomee/pull/88

TOMEE-2087 IvmContext.list() does not correctly list the context content

* MyNamingEnumeration.gatherNodes() adds the wrong federated context 
entries in the result set (related to TOMEE-2086 - it was indeed a typo, but we 
"fixed" it with the wrong NameNode).

* MyNamingEnumeration.isMyChild() considers entries that are NOT children 
to the "parent" tree as such

* Wrong parentNode is passed as argument to gatherNodes in case we are 
listing the context for any "IvmContext != this

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/SvetlinZarev/tomee tomee-2087

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/tomee/pull/88.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #88


commit f575f1c4bd227cc2d3f54fe4d779319fb1bc40b8
Author: Svetlin Zarev 
Date:   2017-07-09T14:23:51Z

Fix TOMEE-2087 - Correctly list the IvmContext content

commit 52c72b628d9a8985f213222824cc391c7d7db2f8
Author: Svetlin Zarev 
Date:   2017-07-10T09:37:16Z

Implement basic test which verifies if the listed entries can be looked up




> IvmContext.list() does not correctly list the context content
> -
>
> Key: TOMEE-2087
> URL: https://issues.apache.org/jira/browse/TOMEE-2087
> Project: TomEE
>  Issue Type: Bug
>Reporter: Svetlin Zarev
>Priority: Critical
> Attachments: sample.zip
>
>
> MyNamingEnumeration.gatherNodes() adds the wrong federated context entries in 
> the result set (related to TOMEE-2086 - it was indeed a typo, but we "fixed" 
> it with the wrong NameNode).
> Another issue is with MyNamingEnumeration.isMyChild() which considers entries 
> that are NOT children to the "parent" tree as such
> One more issue is that the wrong parentNode is passed as argument to 
> gatherNodes in case we are listing the context for any "IvmContext != this"
> To give an example:
> Expected context content:
> {code}
> ### Context: /module
> Name: TestEJB!org.example.TestEJB 
> Class=org.apache.openejb.assembler.classic.JndiBuilder$ContextualEjbLookup
>   [looking up: TestEJB!org.example.TestEJB]   [Value]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> Name: TestEJB 
> Class=org.apache.openejb.assembler.classic.JndiBuilder$ContextualEjbLookup
>   [looking up: TestEJB]   [Value]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> Name: ModuleName  Class=java.lang.String  [looking up: ModuleName]
> [Value]: 
> Name: env Class=org.apache.naming.NamingContext   [looking up: env]   
> [Value]: org.apache.naming.NamingContext@1bb2d0a8
> ### Context: /module/env
> Name: nameClass=java.lang.String  [looking up: name]  [Value]: 
> module-env
> {code} 
> Actual context content:
> {code}
> ### Context: /module
> Name: global  Class=org.apache.openejb.core.ivm.naming.IvmContext 
> [looking up: global]> Failed to lookup: global
> Name: dummy   Class=java.lang.String  [looking up: dummy] > Failed to 
> lookup: dummy
> Name: TestEJB!org.example.TestEJB 
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference 
> [looking up: TestEJB!org.example.TestEJB]   [Reference]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> Name: TestEJB 
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference 
> [looking up: TestEJB]   [Reference]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> Name: ModuleName  Class=java.lang.String  [looking up: ModuleName]
> [Value]: 
> Name: env Class=org.apache.openejb.core.ivm.naming.IvmContext 
> [looking up: env]   [Value]: IvmContext{mynode=}
> Name: TestEJB!org.example.TestEJB 
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference 
> [looking up: TestEJB!org.example.TestEJB]   [Reference]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> Name: TestEJB 
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference 
> [looking up: TestEJB]   [Reference]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> ### Context: /module/env
> Name: TestEJB!org.example.TestEJB 
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference 
> [looking up: TestEJB!org.example.TestEJB]   > Failed to lookup: 
> 

[jira] [Commented] (TOMEE-2087) IvmContext.list() does not correctly list the context content

2017-07-10 Thread Romain Manni-Bucau (JIRA)

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

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

A thread on the list is always good, in particular for this area which is not 
that known (some words on why it broke and how you fixed it would be awesome). 
I approved the PR on github - you can mention it - so anyone can apply it once 
the mail hit the list. Thanks a lot for the hard work.

> IvmContext.list() does not correctly list the context content
> -
>
> Key: TOMEE-2087
> URL: https://issues.apache.org/jira/browse/TOMEE-2087
> Project: TomEE
>  Issue Type: Bug
>Reporter: Svetlin Zarev
>Priority: Critical
> Attachments: sample.zip
>
>
> MyNamingEnumeration.gatherNodes() adds the wrong federated context entries in 
> the result set (related to TOMEE-2086 - it was indeed a typo, but we "fixed" 
> it with the wrong NameNode).
> Another issue is with MyNamingEnumeration.isMyChild() which considers entries 
> that are NOT children to the "parent" tree as such
> One more issue is that the wrong parentNode is passed as argument to 
> gatherNodes in case we are listing the context for any "IvmContext != this"
> To give an example:
> Expected context content:
> {code}
> ### Context: /module
> Name: TestEJB!org.example.TestEJB 
> Class=org.apache.openejb.assembler.classic.JndiBuilder$ContextualEjbLookup
>   [looking up: TestEJB!org.example.TestEJB]   [Value]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> Name: TestEJB 
> Class=org.apache.openejb.assembler.classic.JndiBuilder$ContextualEjbLookup
>   [looking up: TestEJB]   [Value]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> Name: ModuleName  Class=java.lang.String  [looking up: ModuleName]
> [Value]: 
> Name: env Class=org.apache.naming.NamingContext   [looking up: env]   
> [Value]: org.apache.naming.NamingContext@1bb2d0a8
> ### Context: /module/env
> Name: nameClass=java.lang.String  [looking up: name]  [Value]: 
> module-env
> {code} 
> Actual context content:
> {code}
> ### Context: /module
> Name: global  Class=org.apache.openejb.core.ivm.naming.IvmContext 
> [looking up: global]> Failed to lookup: global
> Name: dummy   Class=java.lang.String  [looking up: dummy] > Failed to 
> lookup: dummy
> Name: TestEJB!org.example.TestEJB 
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference 
> [looking up: TestEJB!org.example.TestEJB]   [Reference]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> Name: TestEJB 
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference 
> [looking up: TestEJB]   [Reference]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> Name: ModuleName  Class=java.lang.String  [looking up: ModuleName]
> [Value]: 
> Name: env Class=org.apache.openejb.core.ivm.naming.IvmContext 
> [looking up: env]   [Value]: IvmContext{mynode=}
> Name: TestEJB!org.example.TestEJB 
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference 
> [looking up: TestEJB!org.example.TestEJB]   [Reference]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> Name: TestEJB 
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference 
> [looking up: TestEJB]   [Reference]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> ### Context: /module/env
> Name: TestEJB!org.example.TestEJB 
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference 
> [looking up: TestEJB!org.example.TestEJB]   > Failed to lookup: 
> TestEJB!org.example.TestEJB
> Name: TestEJB 
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference 
> [looking up: TestEJB]   > Failed to lookup: TestEJB
> Name: nameClass=java.lang.String  [looking up: name]  [Value]: 
> module-env
> {code}
> Note the "failed too lookup..." messages - these are all objects that MUST 
> NOT be listed as part of that context.
> I'm attaching an application that reproduces the issue. 
> Requesting it like "http://localhost:8080/?ejb; will print tomee's naming tree
> Requesting it like "http://localhost:8080; will print tomcat's naming tree



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (TOMEE-2087) IvmContext.list() does not correctly list the context content

2017-07-10 Thread Svetlin Zarev (JIRA)

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

Svetlin Zarev commented on TOMEE-2087:
--

Hi, my tests passed. Should I open a thread in the mailing list ? 

> IvmContext.list() does not correctly list the context content
> -
>
> Key: TOMEE-2087
> URL: https://issues.apache.org/jira/browse/TOMEE-2087
> Project: TomEE
>  Issue Type: Bug
>Reporter: Svetlin Zarev
>Priority: Critical
> Attachments: sample.zip
>
>
> MyNamingEnumeration.gatherNodes() adds the wrong federated context entries in 
> the result set (related to TOMEE-2086 - it was indeed a typo, but we "fixed" 
> it with the wrong NameNode).
> Another issue is with MyNamingEnumeration.isMyChild() which considers entries 
> that are NOT children to the "parent" tree as such
> One more issue is that the wrong parentNode is passed as argument to 
> gatherNodes in case we are listing the context for any "IvmContext != this"
> To give an example:
> Expected context content:
> {code}
> ### Context: /module
> Name: TestEJB!org.example.TestEJB 
> Class=org.apache.openejb.assembler.classic.JndiBuilder$ContextualEjbLookup
>   [looking up: TestEJB!org.example.TestEJB]   [Value]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> Name: TestEJB 
> Class=org.apache.openejb.assembler.classic.JndiBuilder$ContextualEjbLookup
>   [looking up: TestEJB]   [Value]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> Name: ModuleName  Class=java.lang.String  [looking up: ModuleName]
> [Value]: 
> Name: env Class=org.apache.naming.NamingContext   [looking up: env]   
> [Value]: org.apache.naming.NamingContext@1bb2d0a8
> ### Context: /module/env
> Name: nameClass=java.lang.String  [looking up: name]  [Value]: 
> module-env
> {code} 
> Actual context content:
> {code}
> ### Context: /module
> Name: global  Class=org.apache.openejb.core.ivm.naming.IvmContext 
> [looking up: global]> Failed to lookup: global
> Name: dummy   Class=java.lang.String  [looking up: dummy] > Failed to 
> lookup: dummy
> Name: TestEJB!org.example.TestEJB 
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference 
> [looking up: TestEJB!org.example.TestEJB]   [Reference]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> Name: TestEJB 
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference 
> [looking up: TestEJB]   [Reference]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> Name: ModuleName  Class=java.lang.String  [looking up: ModuleName]
> [Value]: 
> Name: env Class=org.apache.openejb.core.ivm.naming.IvmContext 
> [looking up: env]   [Value]: IvmContext{mynode=}
> Name: TestEJB!org.example.TestEJB 
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference 
> [looking up: TestEJB!org.example.TestEJB]   [Reference]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> Name: TestEJB 
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference 
> [looking up: TestEJB]   [Reference]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> ### Context: /module/env
> Name: TestEJB!org.example.TestEJB 
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference 
> [looking up: TestEJB!org.example.TestEJB]   > Failed to lookup: 
> TestEJB!org.example.TestEJB
> Name: TestEJB 
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference 
> [looking up: TestEJB]   > Failed to lookup: TestEJB
> Name: nameClass=java.lang.String  [looking up: name]  [Value]: 
> module-env
> {code}
> Note the "failed too lookup..." messages - these are all objects that MUST 
> NOT be listed as part of that context.
> I'm attaching an application that reproduces the issue. 
> Requesting it like "http://localhost:8080/?ejb; will print tomee's naming tree
> Requesting it like "http://localhost:8080; will print tomcat's naming tree



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (TOMEE-2087) IvmContext.list() does not correctly list the context content

2017-07-10 Thread Romain Manni-Bucau (JIRA)

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

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

Ok, let me know when you are done and will apply it. Thanks Svetlin!

> IvmContext.list() does not correctly list the context content
> -
>
> Key: TOMEE-2087
> URL: https://issues.apache.org/jira/browse/TOMEE-2087
> Project: TomEE
>  Issue Type: Bug
>Reporter: Svetlin Zarev
>Priority: Critical
> Attachments: sample.zip
>
>
> MyNamingEnumeration.gatherNodes() adds the wrong federated context entries in 
> the result set (related to TOMEE-2086 - it was indeed a typo, but we "fixed" 
> it with the wrong NameNode).
> Another issue is with MyNamingEnumeration.isMyChild() which considers entries 
> that are NOT children to the "parent" tree as such
> One more issue is that the wrong parentNode is passed as argument to 
> gatherNodes in case we are listing the context for any "IvmContext != this"
> To give an example:
> Expected context content:
> {code}
> ### Context: /module
> Name: TestEJB!org.example.TestEJB 
> Class=org.apache.openejb.assembler.classic.JndiBuilder$ContextualEjbLookup
>   [looking up: TestEJB!org.example.TestEJB]   [Value]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> Name: TestEJB 
> Class=org.apache.openejb.assembler.classic.JndiBuilder$ContextualEjbLookup
>   [looking up: TestEJB]   [Value]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> Name: ModuleName  Class=java.lang.String  [looking up: ModuleName]
> [Value]: 
> Name: env Class=org.apache.naming.NamingContext   [looking up: env]   
> [Value]: org.apache.naming.NamingContext@1bb2d0a8
> ### Context: /module/env
> Name: nameClass=java.lang.String  [looking up: name]  [Value]: 
> module-env
> {code} 
> Actual context content:
> {code}
> ### Context: /module
> Name: global  Class=org.apache.openejb.core.ivm.naming.IvmContext 
> [looking up: global]> Failed to lookup: global
> Name: dummy   Class=java.lang.String  [looking up: dummy] > Failed to 
> lookup: dummy
> Name: TestEJB!org.example.TestEJB 
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference 
> [looking up: TestEJB!org.example.TestEJB]   [Reference]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> Name: TestEJB 
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference 
> [looking up: TestEJB]   [Reference]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> Name: ModuleName  Class=java.lang.String  [looking up: ModuleName]
> [Value]: 
> Name: env Class=org.apache.openejb.core.ivm.naming.IvmContext 
> [looking up: env]   [Value]: IvmContext{mynode=}
> Name: TestEJB!org.example.TestEJB 
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference 
> [looking up: TestEJB!org.example.TestEJB]   [Reference]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> Name: TestEJB 
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference 
> [looking up: TestEJB]   [Reference]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> ### Context: /module/env
> Name: TestEJB!org.example.TestEJB 
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference 
> [looking up: TestEJB!org.example.TestEJB]   > Failed to lookup: 
> TestEJB!org.example.TestEJB
> Name: TestEJB 
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference 
> [looking up: TestEJB]   > Failed to lookup: TestEJB
> Name: nameClass=java.lang.String  [looking up: name]  [Value]: 
> module-env
> {code}
> Note the "failed too lookup..." messages - these are all objects that MUST 
> NOT be listed as part of that context.
> I'm attaching an application that reproduces the issue. 
> Requesting it like "http://localhost:8080/?ejb; will print tomee's naming tree
> Requesting it like "http://localhost:8080; will print tomcat's naming tree



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (TOMEE-2087) IvmContext.list() does not correctly list the context content

2017-07-09 Thread Svetlin Zarev (JIRA)

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

Svetlin Zarev commented on TOMEE-2087:
--

Here are the necessary changes to fix the list() operation, but I'd still need 
to run my tests in order to make sure I didn't break something.

https://github.com/apache/tomee/compare/master...SvetlinZarev:tomee-2087?diff=unified=tomee-2087

> IvmContext.list() does not correctly list the context content
> -
>
> Key: TOMEE-2087
> URL: https://issues.apache.org/jira/browse/TOMEE-2087
> Project: TomEE
>  Issue Type: Bug
>Reporter: Svetlin Zarev
>Priority: Critical
> Attachments: sample.zip
>
>
> MyNamingEnumeration.gatherNodes() adds the wrong federated context entries in 
> the result set (related to TOMEE-2086 - it was indeed a typo, but we "fixed" 
> it with the wrong NameNode).
> The other issue is with MyNamingEnumeration.isMyChild() which considers 
> entries that are NOT children to the "parent" tree as such
> To give an example:
> Expected context content:
> {code}
> ### Context: /module
> Name: TestEJB!org.example.TestEJB 
> Class=org.apache.openejb.assembler.classic.JndiBuilder$ContextualEjbLookup
>   [looking up: TestEJB!org.example.TestEJB]   [Value]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> Name: TestEJB 
> Class=org.apache.openejb.assembler.classic.JndiBuilder$ContextualEjbLookup
>   [looking up: TestEJB]   [Value]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> Name: ModuleName  Class=java.lang.String  [looking up: ModuleName]
> [Value]: 
> Name: env Class=org.apache.naming.NamingContext   [looking up: env]   
> [Value]: org.apache.naming.NamingContext@1bb2d0a8
> ### Context: /module/env
> Name: nameClass=java.lang.String  [looking up: name]  [Value]: 
> module-env
> {code} 
> Actual context content:
> {code}
> ### Context: /module
> Name: global  Class=org.apache.openejb.core.ivm.naming.IvmContext 
> [looking up: global]> Failed to lookup: global
> Name: dummy   Class=java.lang.String  [looking up: dummy] > Failed to 
> lookup: dummy
> Name: TestEJB!org.example.TestEJB 
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference 
> [looking up: TestEJB!org.example.TestEJB]   [Reference]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> Name: TestEJB 
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference 
> [looking up: TestEJB]   [Reference]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> Name: ModuleName  Class=java.lang.String  [looking up: ModuleName]
> [Value]: 
> Name: env Class=org.apache.openejb.core.ivm.naming.IvmContext 
> [looking up: env]   [Value]: IvmContext{mynode=}
> Name: TestEJB!org.example.TestEJB 
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference 
> [looking up: TestEJB!org.example.TestEJB]   [Reference]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> Name: TestEJB 
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference 
> [looking up: TestEJB]   [Reference]: 
> proxy=org.example.TestEJB;deployment=ROOT//TestEJB;pk=null
> ### Context: /module/env
> Name: TestEJB!org.example.TestEJB 
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference 
> [looking up: TestEJB!org.example.TestEJB]   > Failed to lookup: 
> TestEJB!org.example.TestEJB
> Name: TestEJB 
> Class=org.apache.openejb.core.ivm.naming.BusinessLocalBeanReference 
> [looking up: TestEJB]   > Failed to lookup: TestEJB
> Name: nameClass=java.lang.String  [looking up: name]  [Value]: 
> module-env
> {code}
> Note the "failed too lookup..." messages - these are all objects that MUST 
> NOT be listed as part of that context.
> I'm attaching an application that reproduces the issue. 
> Requesting it like "http://localhost:8080/?ejb; will print tomee's naming tree
> Requesting it like "http://localhost:8080; will print tomcat's naming tree



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)