With mvn you can just override it in src/test/resources i think. Changing classes with mocks in this file should be enough.
If you can spend some time sharing a project reproducing it we can dig into your config issue Le 12 août 2014 17:51, "Chambery, Todd" <[email protected]> a écrit : > Still no love. > > But your suggestion to look at the ejb-jar.xml led me to a reasonable > workaround: deleting the > > <ejb-name>Management</ejb-name> > > bean definition from the ejb-jar.xml within the .jar. > > I'd prefer the exclude method so I don't have to ask others to muck around > with their lib jars, but this works for me. > > Thanks for all the help! > > Todd > > -----Original Message----- > From: Romain Manni-Bucau [mailto:[email protected]] > Sent: Monday, August 11, 2014 4:42 PM > To: [email protected] > Subject: Re: How to exclude jar from module search? > > Ok now I get a bit more the issue. > > Maybe try: > > openejb.exclude-include.order=exclude since default include is .* > > > Romain Manni-Bucau > Twitter: @rmannibucau > Blog: http://rmannibucau.wordpress.com/ > LinkedIn: http://fr.linkedin.com/in/rmannibucau > Github: https://github.com/rmannibucau > > > 2014-08-11 20:18 GMT+02:00 Chambery, Todd <[email protected] > >: > > It do: > > > > <?xml version="1.0" encoding="UTF-8"?> > > <!-- xxxxxx ltext.jar xxxxxx --> > > <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise > JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd"> > > <ejb-jar id="ejb-jar_ID"> > > <enterprise-beans> > > <session id="Session_1"> > > <ejb-name>LocalizableTextTESTAPPHome</ejb-name> > > > <home>com.ibm.websphere.i18n.localizabletext.LocalizableTextResourceAccessorHome</home> > > > <remote>com.ibm.websphere.i18n.localizabletext.LocalizableTextResourceAccessor</remote> > > > <ejb-class>com.ibm.websphere.i18n.localizabletext.LocalizableTextResourceAccessorBean</ejb-class> > > <session-type>Stateless</session-type> > > <transaction-type>Container</transaction-type> > > </session> > > </enterprise-beans> > > <assembly-descriptor id="AssemblyDescriptor_1"> > > <container-transaction id="MethodTransaction_1"> > > <method id="MethodElement_1"> > > <ejb-name>LocalizableTextTESTAPPHome</ejb-name> > > <method-name>*</method-name> > > </method> > > <trans-attribute>Supports</trans-attribute> > > </container-transaction> > > </assembly-descriptor> > > <!-- xxxxxx mejb.jar xxxxxx --> > > <description>Provides interoperable access to WebSphere > administrative functions as specified in the J2EE Management Specification, > a part of J2EE 1.4 (JSR 77).</description> > > <display-name>Management EJB</display-name> > > <enterprise-beans> > > <session id="Session_1037057335913"> > > <ejb-name>Management</ejb-name> > > <home>javax.management.j2ee.ManagementHome</home> > > <remote>javax.management.j2ee.Management</remote> > > > <ejb-class>com.ibm.ws.management.j2ee.ManagementBean</ejb-class> > > <session-type>Stateless</session-type> > > <transaction-type>Container</transaction-type> > > </session> > > </enterprise-beans> > > <assembly-descriptor id="AssemblyDescriptor_1037057335983"> > > </assembly-descriptor> > > </ejb-jar> > > > > > > > > -----Original Message----- > > From: Romain Manni-Bucau [mailto:[email protected]] > > Sent: Monday, August 11, 2014 1:13 PM > > To: [email protected] > > Subject: Re: How to exclude jar from module search? > > > > I don't know this jar, is there a descriptor inside (ejb-jar.xml or > something like that)? > > > > > > Romain Manni-Bucau > > Twitter: @rmannibucau > > Blog: http://rmannibucau.wordpress.com/ > > LinkedIn: http://fr.linkedin.com/in/rmannibucau > > Github: https://github.com/rmannibucau > > > > > > 2014-08-11 19:06 GMT+02:00 Chambery, Todd < > [email protected]>: > >> The upgrade fixes the exception, but unfortunately still loading the > modules from runtime-6.1.jar. > >> > >> OpenEJB.options-2014-08-11-main--INFO -OpenEJB.options:Using > 'openejb.additional.exclude=runtime-6.1' > >> ... > >> OpenEJB.startup.config-2014-08-11-main--INFO > -OpenEJB.startup.config:Found EjbModule in classpath: > c:\users\user\.m3\repository\was\runtime\6.1\runtime-6.1.jar > >> ... > >> OpenEJB.startup.config-2014-08-11-main--INFO > >> -OpenEJB.startup.config:Beginning load: > >> c:\users\user\.m3\repository\was\runtime\6.1\runtime-6.1.jar > >> > >> I also tried adding it to the forced-skip property, but no dice: > >> > >> p.put("openejb.classloader.forced-skip", "org.xml.sax,com.ibm"); > >> > >> > >> > >> -----Original Message----- > >> From: Romain Manni-Bucau [mailto:[email protected]] > >> Sent: Monday, August 11, 2014 11:36 AM > >> To: [email protected] > >> Subject: Re: How to exclude jar from module search? > >> > >> Ha, did you try upgrading to 4.6.0.2? > >> > >> > >> Romain Manni-Bucau > >> Twitter: @rmannibucau > >> Blog: http://rmannibucau.wordpress.com/ > >> LinkedIn: http://fr.linkedin.com/in/rmannibucau > >> Github: https://github.com/rmannibucau > >> > >> > >> 2014-08-11 17:33 GMT+02:00 Chambery, Todd < > [email protected]>: > >>> Setting openejb.additional.exclude=runtime-6.1 causes the following > exception: > >>> > >>> Caused by: java.lang.UnsupportedOperationException > >>> at java.util.AbstractList.add(AbstractList.java:148) > >>> at java.util.AbstractList.add(AbstractList.java:108) > >>> at > org.apache.openejb.config.NewLoaderLogic.getExclusions(NewLoaderLogic.java:222) > >>> at > org.apache.openejb.config.NewLoaderLogic.applyBuiltinExcludes(NewLoaderLogic.java:165) > >>> at > org.apache.openejb.config.NewLoaderLogic.applyBuiltinExcludes(NewLoaderLogic.java:161) > >>> at > org.apache.openejb.config.DeploymentsResolver.loadFromClasspath(DeploymentsResolver.java:238) > >>> at > org.apache.openejb.config.ConfigurationFactory.getModulesFromClassPath(ConfigurationFactory.java:564) > >>> at > org.apache.openejb.OpenEjbContainer$Provider.load(OpenEjbContainer.java:512) > >>> at > org.apache.openejb.OpenEjbContainer$Provider.createEJBContainer(OpenEjbContainer.java:337) > >>> ... 28 more > >>> > >>> which I assume has something to do with it being an AbstractList: > >>> > >>> /** > >>> * {@inheritDoc} > >>> * > >>> * <p>This implementation always throws an > >>> * {@code UnsupportedOperationException}. > >>> * > >>> * @throws UnsupportedOperationException {@inheritDoc} > >>> * @throws ClassCastException {@inheritDoc} > >>> * @throws NullPointerException {@inheritDoc} > >>> * @throws IllegalArgumentException {@inheritDoc} > >>> * @throws IndexOutOfBoundsException {@inheritDoc} > >>> */ > >>> public void add(int index, E element) { > >>> throw new UnsupportedOperationException(); > >>> } > >>> > >>> I'm using OpenEJB core 4.5.1: > >>> > >>> <dependency> > >>> <groupId>org.apache.openejb</groupId> > >>> <artifactId>openejb-core</artifactId> > >>> <version>4.5.1</version> > >>> <scope>test</scope> > >>> <exclusions> > >>> <exclusion> > >>> > <artifactId>slf4j-jdk14</artifactId> > >>> <groupId>org.slf4j</groupId> > >>> </exclusion> > >>> </exclusions> > >>> </dependency> > >>> > >>> <dependency> > >>> <groupId>org.apache.openejb</groupId> > >>> <artifactId>javaee-api</artifactId> > >>> <version>6.0-4</version> > >>> <scope>provided</scope> > >>> </dependency> > >>> > >>> > >>> > >>> -----Original Message----- > >>> From: Romain Manni-Bucau [mailto:[email protected]] > >>> Sent: Monday, August 11, 2014 11:07 AM > >>> To: [email protected] > >>> Subject: Re: How to exclude jar from module search? > >>> > >>> Hi > >>> > >>> you can use -Dopenejb.additional.exclude=runtime-6.1 IIRC. > >>> > >>> deployments.classpat properties works in openejb but are hard to > configure (path) and doesnt work in tomee. > >>> > >>> > >>> Romain Manni-Bucau > >>> Twitter: @rmannibucau > >>> Blog: http://rmannibucau.wordpress.com/ > >>> LinkedIn: http://fr.linkedin.com/in/rmannibucau > >>> Github: https://github.com/rmannibucau > >>> > >>> > >>> 2014-08-11 16:26 GMT+02:00 Chambery, Todd < > [email protected]>: > >>>> Hi, > >>>> > >>>> I posted the below question to StackOverflow ( > http://stackoverflow.com/questions/25187808/openejb-how-to-exclude-jar-from-module-search), > but maybe I have a better chance to get a response here: > >>>> > >>>> > >>>> I use OpenEJB to run unit tests for applications ultimately deployed > to WebSphere Application Server. My problem is a(n unavoidable) dependency > on the WAS runtime jar. I've added an expression to the exclude property > (I've also tried the physical path): > >>>> > >>>> p.put("openejb.deployments.classpath.exclude", > ".*?runtime-6.1.*?"); > >>>> // p.put("openejb.deployments.classpath.exclude", > "C:/Users/user/.m3/repository/was/runtime/6.1/runtime-6.1.jar"); > >>>> p.put("openejb.exclude-include.order", "include-exclude"); > >>>> > >>>> This value is confirmed in the logs: > >>>> > >>>> OpenEJB.options-2014-08-07-main--INFO -OpenEJB.options:Using > 'openejb.exclude-include.order=include-exclude' > >>>> OpenEJB.options-2014-08-07-main--INFO -OpenEJB.options:Using > 'openejb.deployments.classpath.include=.*eed-jar.*' > >>>> OpenEJB.options-2014-08-07-main--INFO -OpenEJB.options:Using > 'openejb.deployments.classpath.exclude=.*?runtime-6.1.*?' > >>>> > >>>> but the jar is still being inspected for loadable modules: > >>>> > >>>> OpenEJB.startup.config-2014-08-07-main--INFO > >>>> -OpenEJB.startup.config:Found EjbModule in classpath: > >>>> C:\Users\user\.m3\repository\was\runtime\6.1\runtime-6.1.jar > >>>> > >>>> The result is startup failure for OpenEJB: > >>>> > >>>> org.apache.openejb.OpenEjbContainer$InvalidApplicationException: > >>>> org.apache.openejb.config.ValidationFailedException: Module failed > >>>> validation. AppModule(name=) and > >>>> WARNING: can't load com.ibm.ws.management.j2ee.ManagementBean > >>>> org.apache.openejb.OpenEJBRuntimeException: Management > >>>> > >>>> I've been creating a 0-length dummy file and renaming runtime-6.1.jar > to execute the tests in Eclipse, but I need to restore the jar to run the > Maven build (which Eclipse will then bind to, necessitating a restart to > rename the jar). > >>>> > >>>> What's the right way to exclude this jar? > >>>> > >>>> Thanks, > >>>> Todd > >>>> > >>>> ---------------------------------------------------------------------- > >>>> This message, and any attachments, is for the intended recipient(s) > only, may contain information that is privileged, confidential and/or > proprietary and subject to important terms and conditions available at > http://www.bankofamerica.com/emaildisclaimer. If you are not the > intended recipient, please delete this message. > >>> > >>> ---------------------------------------------------------------------- > >>> This message, and any attachments, is for the intended recipient(s) > only, may contain information that is privileged, confidential and/or > proprietary and subject to important terms and conditions available at > http://www.bankofamerica.com/emaildisclaimer. If you are not the > intended recipient, please delete this message. > >> > >> ---------------------------------------------------------------------- > >> This message, and any attachments, is for the intended recipient(s) > only, may contain information that is privileged, confidential and/or > proprietary and subject to important terms and conditions available at > http://www.bankofamerica.com/emaildisclaimer. If you are not the > intended recipient, please delete this message. > > > > ---------------------------------------------------------------------- > > This message, and any attachments, is for the intended recipient(s) > only, may contain information that is privileged, confidential and/or > proprietary and subject to important terms and conditions available at > http://www.bankofamerica.com/emaildisclaimer. If you are not the > intended recipient, please delete this message. > > ---------------------------------------------------------------------- > This message, and any attachments, is for the intended recipient(s) only, > may contain information that is privileged, confidential and/or proprietary > and subject to important terms and conditions available at > http://www.bankofamerica.com/emaildisclaimer. If you are not the > intended recipient, please delete this message. >
