[jira] [Updated] (TOMEE-1156) upgrade deltaspike examples to v0.6
[ https://issues.apache.org/jira/browse/TOMEE-1156?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Gerhard Petracek updated TOMEE-1156: Attachment: TOMEE-1156.patch upgrade deltaspike examples to v0.6 --- Key: TOMEE-1156 URL: https://issues.apache.org/jira/browse/TOMEE-1156 Project: TomEE Issue Type: Documentation Reporter: Gerhard Petracek Priority: Minor Attachments: TOMEE-1156.patch -- This message was sent by Atlassian JIRA (v6.2#6252)
svn commit: r1582816 - /tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/util/classloader/URLClassLoaderFirst.java
Author: jlmonteiro Date: Fri Mar 28 16:38:57 2014 New Revision: 1582816 URL: http://svn.apache.org/r1582816 Log: Do add . (dot) cause otherwise it matches to much things Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/util/classloader/URLClassLoaderFirst.java Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/util/classloader/URLClassLoaderFirst.java URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/util/classloader/URLClassLoaderFirst.java?rev=1582816r1=1582815r2=1582816view=diff == --- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/util/classloader/URLClassLoaderFirst.java (original) +++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/util/classloader/URLClassLoaderFirst.java Fri Mar 28 16:38:57 2014 @@ -260,16 +260,16 @@ public class URLClassLoaderFirst extends if (apache.startsWith(geronimo.)) { return true; } -if (apache.startsWith(coyote)) { +if (apache.startsWith(coyote.)) { return true; } if (apache.startsWith(webbeans.)) { return true; } -if (apache.startsWith(log4j) SKIP_LOG4J) { +if (apache.startsWith(log4j.) SKIP_LOG4J) { return true; } -if (apache.startsWith(catalina)) { +if (apache.startsWith(catalina.)) { return true; } if (apache.startsWith(jasper.)) { @@ -282,7 +282,7 @@ public class URLClassLoaderFirst extends return true; } // if (apache.startsWith(jsp)) return true; // precompiled jsp have to be loaded from the webapp -if (apache.startsWith(naming)) { +if (apache.startsWith(naming.)) { return true; } if (apache.startsWith(taglibs.)) { @@ -297,37 +297,40 @@ public class URLClassLoaderFirst extends final String commons = apache.substring(commons..length()); // don't stop on commons package since we don't bring all commons -if (commons.startsWith(beanutils)) { +if (commons.startsWith(beanutils.)) { return true; } -if (commons.startsWith(cli)) { +if (commons.startsWith(cli.)) { return true; } -if (commons.startsWith(codec)) { +if (commons.startsWith(codec.)) { return true; } -if (commons.startsWith(collections)) { +if (commons.startsWith(collections.)) { return true; } -if (commons.startsWith(dbcp)) { +if (commons.startsWith(dbcp.)) { return true; } -if (commons.startsWith(digester)) { +if (commons.startsWith(digester.)) { return true; } -if (commons.startsWith(jocl)) { +if (commons.startsWith(jocl.)) { return true; } -if (commons.startsWith(lang)) { +if (commons.startsWith(lang.)) { // openjpa return true; } -if (commons.startsWith(logging)) { +if (commons.startsWith(lang3.)) { // us +return true; +} +if (commons.startsWith(logging.)) { return false; } -if (commons.startsWith(pool)) { +if (commons.startsWith(pool.)) { return true; } -if (commons.startsWith(net) SKIP_COMMONS_NET) { +if (commons.startsWith(net.) SKIP_COMMONS_NET) { return true; } @@ -338,7 +341,7 @@ public class URLClassLoaderFirst extends // we bring only myfaces-impl (+api but that's javax) // mainly inspired from a comparison with tomahawk packages final String myfaces = name.substring(myfaces..length()); -if (myfaces.startsWith(shared)) { +if (myfaces.startsWith(shared.)) { return true; }
svn commit: r1582815 - /tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ReadDescriptors.java
Author: jlmonteiro Date: Fri Mar 28 16:38:29 2014 New Revision: 1582815 URL: http://svn.apache.org/r1582815 Log: Don't break the exception chain, otherwise it becomes hard to identify an issue Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ReadDescriptors.java Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ReadDescriptors.java URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ReadDescriptors.java?rev=1582815r1=1582814r2=1582815view=diff == --- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ReadDescriptors.java (original) +++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/config/ReadDescriptors.java Fri Mar 28 16:38:29 2014 @@ -597,11 +597,11 @@ public class ReadDescriptors implements } return EjbJarXml.unmarshal(new ByteArrayInputStream(content.getBytes())); } catch (final SAXException e) { -throw new OpenEJBException(Cannot parse the ejb-jar.xml); // file: + url.toExternalForm(), e); +throw new OpenEJBException(Cannot parse the ejb-jar.xml, e); // file: + url.toExternalForm(), e); } catch (final IOException e) { -throw new OpenEJBException(Cannot read the ejb-jar.xml); // file: + url.toExternalForm(), e); +throw new OpenEJBException(Cannot read the ejb-jar.xml, e); // file: + url.toExternalForm(), e); } catch (final Exception e) { -throw new OpenEJBException(Encountered error parsing the ejb-jar.xml); // file: + url.toExternalForm(), e); +throw new OpenEJBException(Encountered error parsing the ejb-jar.xml, e); // file: + url.toExternalForm(), e); } }
buildbot success in ASF Buildbot on tomee-1.6.0.1-deploy
The Buildbot has detected a restored build on builder tomee-1.6.0.1-deploy while building ASF Buildbot. Full details are available at: http://ci.apache.org/builders/tomee-1.6.0.1-deploy/builds/4 Buildbot URL: http://ci.apache.org/ Buildslave for this Build: hemera_ubuntu Build Reason: The Nightly scheduler named 'tomee-1.6.0.1-deploy' triggered this build Build Source Stamp: [branch tomee/tomee/branches/tomee-1.6.0.1] HEAD Blamelist: Build succeeded! sincerely, -The Buildbot
svn commit: r1582955 - in /tomee/tomee/trunk/container/openejb-core/src: main/java/org/apache/openejb/Injector.java main/java/org/apache/openejb/OpenEjbContainer.java test/java/org/apache/openejb/Open
Author: dblevins Date: Sat Mar 29 04:44:19 2014 New Revision: 1582955 URL: http://svn.apache.org/r1582955 Log: Move injection logic to central place -- should reuse a little more here Added: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/Injector.java (with props) Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/OpenEjbContainer.java tomee/tomee/trunk/container/openejb-core/src/test/java/org/apache/openejb/OpenEjbContainerTest.java Added: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/Injector.java URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/Injector.java?rev=1582955view=auto == --- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/Injector.java (added) +++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/Injector.java Sat Mar 29 04:44:19 2014 @@ -0,0 +1,143 @@ +/* + * 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; + +import org.apache.openejb.api.LocalClient; +import org.apache.openejb.core.Operation; +import org.apache.openejb.core.ThreadContext; +import org.apache.openejb.loader.SystemInstance; +import org.apache.openejb.spi.ContainerSystem; +import org.apache.openejb.util.LogCategory; +import org.apache.openejb.util.Logger; +import org.apache.webbeans.inject.OWBInjector; + +/** + * Extracted from the OpenEjbContainer class + */ +public class Injector { + +private static Logger logger = null; // initialized lazily to get the logging config from properties + +public static T T inject(final T object) { + +assert object != null; + +final Class? clazz = object.getClass(); + +final BeanContext context = resolve(clazz); + +if (context != null) { // found the test class directly +final InjectionProcessor processor = new InjectionProcessor(object, context.getInjections(), context.getJndiContext()); +cdiInjections(context, object); +try { +return (T) processor.createInstance(); +} catch (final OpenEJBException e) { +throw new InjectionException(clazz.getName(), e); +} +} else if (!isAnnotatedLocalClient(clazz)) { // nothing to do +throw new NoInjectionMetaDataException(clazz.getName()); +} + +// the test class was not found in beans (OpenEJB ran from parent) but was annotated @LocalClient +try { +final InjectionProcessor? processor = ClientInjections.clientInjector(object); +cdiInjections(null, object); +return (T) processor.createInstance(); +} catch (final OpenEJBException e) { +throw new NoInjectionMetaDataException(Injection failed, e); +} +} + +private static T void cdiInjections(final BeanContext context, final T object) { +ThreadContext oldContext = null; +if (context != null) { +final ThreadContext callContext = new ThreadContext(context, null, Operation.INJECTION); +oldContext = ThreadContext.enter(callContext); +} +try { + OWBInjector.inject(context.getWebBeansContext().getBeanManagerImpl(), object, null); +} catch (final Throwable t) { +logger().warning(an error occured while injecting the class ' + object.getClass().getName() + ': + t.getMessage()); +} finally { +if (context != null) { +ThreadContext.exit(oldContext); +} +} +} + +private static boolean isAnnotatedLocalClient(final Class? clazz) { +Class? current = clazz; +while (current != null current != Object.class) { +if (current.getAnnotation(LocalClient.class) != null) { +return true; +} +current = current.getSuperclass(); +} +return false; +} + +private static BeanContext resolve(Class? clazz) { + +final ContainerSystem containerSystem =