Arquillian 无法识别 Weblogic 12c 中的共享库
Arquillian doesn't recognize shared libraries in Weblogic 12c
我正在使用 Arquillian 运行 Weblogic 12c 中的集成测试,它无法识别部署在容器中的共享库。
EAR植入正确,但部分测试启动异常
我正在使用 Weblogic 12.2.1.3.0。
ProtocoloTest.java
package br.gov.mg.fazenda.protocolonegocio.testeintegracao;
import static org.junit.Assert.assertNotNull;
import java.io.File;
import java.io.IOException;
import javax.ejb.EJB;
import javax.xml.parsers.ParserConfigurationException;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.jboss.shrinkwrap.resolver.api.maven.Maven;
import org.jboss.shrinkwrap.resolver.api.maven.ScopeType;
import org.junit.Test;
import org.junit.jupiter.api.DisplayName;
import org.junit.runner.RunWith;
import org.xml.sax.SAXException;
import com.unitech.ufw.exception.UFWException;
import gov.sefmg.sicaf.protocolo.controller.ProtocoloFacadeEJB3;
import gov.sefmg.sicaf.protocolo.model.ProtocoloModel;
import gov.sefmg.sicaf.util.identificacao.IdentificacaoCPF;
import gov.sefmg.sicaf.util.identificacao.SolicitanteModel;
@RunWith(Arquillian.class)
public class ProtocoloTest {
//Deve ser mantido com Deployents, outras configurações a injeção não funciona.
@Deployment
@DisplayName("Empacotando o EAR de testes")
public static Archive<?> createDeployment() throws ParserConfigurationException, SAXException, IOException {
File[] lFiles = Maven.configureResolver()
// Define para utilizar os artefatos disponíveis no repositório local (após o "clean install")
//.withClassPathResolution(false)
// Define as configurações do Maven que devem ser utilizadas (contém o usuário, senha e repositório)
.fromFile("C:/Ambiente/maven/apache-maven-3.5.2/conf/settings.xml")
// Carrega o arquivo "pom.xml" para a identificação das dependências
.loadPomFromFile("pom.xml")
// Importa tudo que é "provided" de forma a garantir que tudo necessário seja disponibilizado
.importDependencies(ScopeType.PROVIDED)
// Se baseia no próprio projeto a ser testado
.resolve("gov.sefmg:protocolonegocio:1.0.0")
// Garante que o próprio projeto seja incluído
.withTransitivity()
.asFile();
// Gera o JAR com as classes de teste
JavaArchive lJavaArchive = ShrinkWrap.create(JavaArchive.class, "testeArquillianProtocolo.jar")
.addClasses(ProtocoloTest.class)
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
//Criando o ear, não é necessario de jogar tudo, apenas o que achar necessário para os testes.
final EnterpriseArchive lEnterpriseArchive = ShrinkWrap.create(EnterpriseArchive.class, "testeArquillianProtocolo.ear")
.setApplicationXML("application.xml") // application.xml com configurações otimizadas, este arquivo esta presente em \src\test\resources
.addAsApplicationResource(new File("src/test/resources/weblogic-application.xml"))
.addAsLibrary(lJavaArchive)
.addAsLibraries(lFiles);
//Sysout no console do ear configurado, sempre verificar se foi criado corretamente com as configurações
System.out.println(lEnterpriseArchive.toString(true));
return lEnterpriseArchive;
}
@EJB(lookup="ProtocoloFacadeEJB3")
ProtocoloFacadeEJB3 protocoloFacadeEJB3;
@Test
@DisplayName("Testa a alteração de um protocolo (Atualmente só ocorre para ITCD). Falhará pois é um protocolo fake.")
public void testAlterarProtocoloInvalido() throws UFWException {
NumeroProtocolo lNumeroProtocoloFake = new NumeroProtocolo(999900000012L);
ProtocoloModel lProtocoloModel = new ProtocoloModel();
lProtocoloModel.setProtocolo(lNumeroProtocoloFake);
lProtocoloModel.setDataSolicitacao(new Date());
SolicitanteModel lSolicitante = new SolicitanteModel();
lSolicitante.setIdentificacao(new IdentificacaoCPF("88888888888"));
lSolicitante.setNome("Teste Arquillian");
lProtocoloModel.setSolicitante(lSolicitante);
try {
protocoloFacadeEJB3.alterar(lProtocoloModel);
// Se não lançar exceção, então indica que a validação falhou.
assertTrue(false);
} catch (SicafAplicacaoException e) {
assertTrue(e.getCodigoErro().equals(SicafConstantesDicionarioIf.PAR_REGISTRO_JA_REMOVIDO));
}
}
}
pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>gov.sefmg</groupId>
<artifactId>projeto-sefmg</artifactId>
<version>5.8</version>
</parent>
<artifactId>protocolonegocio</artifactId>
<packaging>ejb</packaging>
<version>1.0.0</version>
<name>protocolonegocio</name>
<dependencies>
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-wls-remote-12.1.x</artifactId>
<version>1.0.1.Final</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.descriptors</groupId>
<artifactId>shrinkwrap-descriptors-impl-javaee</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-impl-maven</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-api-maven-embedded</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-launcher</artifactId>
<version>1.5.0-M1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>5.3.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.4.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.4.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.opentest4j</groupId>
<artifactId>opentest4j</artifactId>
<version>1.1.1</version>
<scope>provided</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>1.4.1.Final</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-bom</artifactId>
<version>3.1.3</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.descriptors</groupId>
<artifactId>shrinkwrap-descriptors-bom</artifactId>
<version>2.0.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
.
.
.
</project>
arquillian.xml
<?xml version="1.0"?>
<arquillian
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://jboss.org/schema/arquillian"
xsi:schemaLocation="http://jboss.org/schema/arquillian
http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
<engine>
<property name="deploymentExportPath">target/deployments</property>
</engine>
<container qualifier="weblogic" default="true">
<protocol type="Servlet 3.0" />
<configuration>
<property name="wlHome">C:/Ambiente/as/Oracle/Middleware/wlserver_12.1</property>
<property name="domainDirectory">C:/Ambiente/as/Oracle/Middleware/user_projects/domains/siare_com_provider</property>
<property name="middlewareHome">C:/Ambiente/as/Oracle/Middleware</property>
<property name="adminUrl">t3://localhost:7001</property>
<property name="adminUserName">weblogic</property>
<property name="adminPassword">welcome1</property>
<property name="target">AdminServer</property>
<property name="allowConnectingToRunningServer">true</property>
</configuration>
</container>
</arquillian>
application.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<application xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="7"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/application_7.xsd">
<display-name>ear</display-name>
<module>
<ejb>lib/protocolonegocio-1.0.0.jar</ejb>
</module>
<library-directory>lib</library-directory>
</application>
weblogic-application.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wls:weblogic-application
xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-application"
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/javaee_7.xsd http://xmlns.oracle.com/weblogic/weblogic-application http://xmlns.oracle.com/weblogic/weblogic-application/1.7/weblogic-application.xsd">
<!--weblogic-version:12.2.1 -->
<wls:application-param>
<wls:param-name>webapp.encoding.default</wls:param-name>
<wls:param-value>UTF-8</wls:param-value>
</wls:application-param>
<wls:library-ref>
<wls:library-name>siare-client</wls:library-name>
</wls:library-ref>
<wls:library-ref>
<wls:library-name>lib-sef</wls:library-name>
</wls:library-ref>
<wls:library-ref>
<wls:library-name>siare-libs</wls:library-name>
</wls:library-ref>
</wls:weblogic-application>
堆栈跟踪
class "gov.sefmg.sicaf.seguranca.model.UsuarioSefModel" 在 "siare-client" 库中。
javax.ejb.EJBException: EJB Exception: ; nested exception is:
java.lang.NoClassDefFoundError: gov/sefmg/sicaf/seguranca/model/UsuarioSefModel
at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.unwrapRemoteException(RemoteBusinessIntfProxy.java:129)
at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:99)
at com.sun.proxy.$Proxy1696.alterar(Unknown Source)
at br.gov.mg.fazenda.protocolonegocio.testeintegracao.ProtocoloTest.testAlterarFluxoInvalido(ProtocoloTest.java:309)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.jboss.arquillian.junit.Arquillian.invokeMethod(Arquillian.java:325)
at org.jboss.arquillian.junit.MethodInvoker.invoke(MethodInvoker.java:18)
at org.jboss.arquillian.container.test.impl.execution.LocalTestExecuter.execute(LocalTestExecuter.java:57)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:103)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:90)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:133)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:105)
at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:62)
at org.jboss.arquillian.container.test.impl.execution.ContainerTestExecuter.execute(ContainerTestExecuter.java:36)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:103)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:90)
at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:116)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95)
at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:83)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95)
at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:69)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:133)
at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.test(EventTestRunnerAdaptor.java:139)
at org.jboss.arquillian.junit.MethodInvoker.invoke(MethodInvoker.java:15)
at org.jboss.arquillian.junit.Arquillian.evaluate(Arquillian.java:332)
at org.jboss.arquillian.junit.Arquillian.evaluate(Arquillian.java:204)
at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:350)
at org.jboss.arquillian.junit.Arquillian.access0(Arquillian.java:54)
at org.jboss.arquillian.junit.Arquillian.evaluate(Arquillian.java:215)
at org.jboss.arquillian.junit.Arquillian.invoke(Arquillian.java:279)
at org.jboss.arquillian.container.test.impl.execution.BeforeLifecycleEventExecuter.on(BeforeLifecycleEventExecuter.java:34)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:103)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:90)
at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:116)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95)
at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:83)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95)
at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:69)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:133)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:105)
at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.fireCustomLifecycle(EventTestRunnerAdaptor.java:159)
at org.jboss.arquillian.junit.Arquillian.evaluate(Arquillian.java:273)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access[=15=]0(ParentRunner.java:58)
at org.junit.runners.ParentRunner.evaluate(ParentRunner.java:268)
at org.jboss.arquillian.junit.Arquillian.evaluate(Arquillian.java:166)
at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:350)
at org.jboss.arquillian.junit.Arquillian.access0(Arquillian.java:54)
at org.jboss.arquillian.junit.Arquillian.evaluate(Arquillian.java:177)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:115)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
at org.jboss.arquillian.junit.container.JUnitTestRunner.execute(JUnitTestRunner.java:61)
at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.executeTest(ServletTestRunner.java:139)
at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.execute(ServletTestRunner.java:117)
at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.doGet(ServletTestRunner.java:86)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:295)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:260)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:137)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:353)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:25)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:32)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3786)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3752)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:326)
at weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197)
at weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)
at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71)
at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2451)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2299)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2277)
at weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1703)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1663)
at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:272)
at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:352)
at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:337)
at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:57)
at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:644)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:415)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:355)
Caused by: java.rmi.RemoteException: EJB Exception: ; nested exception is:
java.lang.NoClassDefFoundError: gov/sefmg/sicaf/seguranca/model/UsuarioSefModel
at weblogic.ejb.container.internal.EJBRuntimeUtils.asRemoteException(EJBRuntimeUtils.java:60)
at weblogic.ejb.container.internal.BaseRemoteObject.handleSystemException(BaseRemoteObject.java:581)
at weblogic.ejb.container.internal.BaseRemoteObject.handleSystemException(BaseRemoteObject.java:537)
at weblogic.ejb.container.internal.BaseRemoteObject.postInvoke1(BaseRemoteObject.java:365)
at weblogic.ejb.container.internal.StatelessRemoteObject.postInvoke1(StatelessRemoteObject.java:20)
at weblogic.ejb.container.internal.BaseRemoteObject.__WL_postInvokeTxRetry(BaseRemoteObject.java:307)
at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invokeInternal(SessionRemoteMethodInvoker.java:67)
at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:21)
at gov.sefmg.sicaf.protocolo.controller.ProtocoloFacadeEJB3_frcos0_ProtocoloFacadeEJB3Impl.alterar(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:86)
... 142 more
Caused by: java.lang.NoClassDefFoundError: gov/sefmg/sicaf/seguranca/model/UsuarioSefModel
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetPublicMethods(Class.java:2902)
at java.lang.Class.getMethods(Class.java:1615)
at weblogic.rmi.utils.Utilities.getRemoteMethodsAndSignatures(Utilities.java:370)
at weblogic.rmi.utils.Utilities.getRemoteMethodsAndSignatures(Utilities.java:360)
at weblogic.rmi.internal.ClientRuntimeDescriptor.isInterAppClassLoaderNeeded(ClientRuntimeDescriptor.java:313)
at weblogic.rmi.internal.ClientRuntimeDescriptor.findLoader(ClientRuntimeDescriptor.java:278)
at weblogic.rmi.internal.ClientRuntimeDescriptor.getClassLoader(ClientRuntimeDescriptor.java:168)
at weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:843)
at weblogic.rmi.extensions.StubFactory.getStub(StubFactory.java:73)
at weblogic.rmi.internal.StubInfo.resolveObject(StubInfo.java:410)
at weblogic.rmi.internal.StubInfo.readResolve(StubInfo.java:332)
at sun.reflect.GeneratedMethodAccessor46.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at java.io.ObjectStreamClass.invokeReadResolve(ObjectStreamClass.java:1248)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2073)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1568)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:428)
at weblogic.rmi.extensions.server.CBVInputStream.readObject(CBVInputStream.java:64)
at weblogic.rmi.internal.ServerRequest.unmarshalReturn(ServerRequest.java:127)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:555)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:313)
at gov.sefmg.sicaf.retaguarda.servico.controller.RetaguardaServicoFacade_lgeqsw_HomeImpl_12213_WLStub.create(Unknown Source)
at gov.sefmg.sicaf.protocolo.controller.ProtocoloRN.getRetaguardaServicoFacade(ProtocoloRN.java:264)
at gov.sefmg.sicaf.protocolo.controller.ProtocoloRN.validarPermissao(ProtocoloRN.java:228)
at gov.sefmg.sicaf.protocolo.controller.ProtocoloRN.alterar(ProtocoloRN.java:192)
at gov.sefmg.sicaf.protocolo.controller.ProtocoloFacadeBean.alterar(ProtocoloFacadeBean.java:104)
at gov.sefmg.sicaf.protocolo.controller.ProtocoloFacadeEJB3_frcos0_ProtocoloFacadeEJB3Impl.__WL_invoke(Unknown Source)
at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invokeInternal(SessionRemoteMethodInvoker.java:54)
... 149 more
有人可以给点小费吗?
我发现了问题。
Weblogic在应用程序的库目录下虚拟合并一个共享库的库目录。
我的共享库正在使用“libs”作为库目录。
但是,应用程序正在使用“lib”作为库目录。
因此,Weblogic 不会合并内容。
我正在使用 Arquillian 运行 Weblogic 12c 中的集成测试,它无法识别部署在容器中的共享库。
EAR植入正确,但部分测试启动异常
我正在使用 Weblogic 12.2.1.3.0。
ProtocoloTest.java
package br.gov.mg.fazenda.protocolonegocio.testeintegracao;
import static org.junit.Assert.assertNotNull;
import java.io.File;
import java.io.IOException;
import javax.ejb.EJB;
import javax.xml.parsers.ParserConfigurationException;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.jboss.shrinkwrap.resolver.api.maven.Maven;
import org.jboss.shrinkwrap.resolver.api.maven.ScopeType;
import org.junit.Test;
import org.junit.jupiter.api.DisplayName;
import org.junit.runner.RunWith;
import org.xml.sax.SAXException;
import com.unitech.ufw.exception.UFWException;
import gov.sefmg.sicaf.protocolo.controller.ProtocoloFacadeEJB3;
import gov.sefmg.sicaf.protocolo.model.ProtocoloModel;
import gov.sefmg.sicaf.util.identificacao.IdentificacaoCPF;
import gov.sefmg.sicaf.util.identificacao.SolicitanteModel;
@RunWith(Arquillian.class)
public class ProtocoloTest {
//Deve ser mantido com Deployents, outras configurações a injeção não funciona.
@Deployment
@DisplayName("Empacotando o EAR de testes")
public static Archive<?> createDeployment() throws ParserConfigurationException, SAXException, IOException {
File[] lFiles = Maven.configureResolver()
// Define para utilizar os artefatos disponíveis no repositório local (após o "clean install")
//.withClassPathResolution(false)
// Define as configurações do Maven que devem ser utilizadas (contém o usuário, senha e repositório)
.fromFile("C:/Ambiente/maven/apache-maven-3.5.2/conf/settings.xml")
// Carrega o arquivo "pom.xml" para a identificação das dependências
.loadPomFromFile("pom.xml")
// Importa tudo que é "provided" de forma a garantir que tudo necessário seja disponibilizado
.importDependencies(ScopeType.PROVIDED)
// Se baseia no próprio projeto a ser testado
.resolve("gov.sefmg:protocolonegocio:1.0.0")
// Garante que o próprio projeto seja incluído
.withTransitivity()
.asFile();
// Gera o JAR com as classes de teste
JavaArchive lJavaArchive = ShrinkWrap.create(JavaArchive.class, "testeArquillianProtocolo.jar")
.addClasses(ProtocoloTest.class)
.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
//Criando o ear, não é necessario de jogar tudo, apenas o que achar necessário para os testes.
final EnterpriseArchive lEnterpriseArchive = ShrinkWrap.create(EnterpriseArchive.class, "testeArquillianProtocolo.ear")
.setApplicationXML("application.xml") // application.xml com configurações otimizadas, este arquivo esta presente em \src\test\resources
.addAsApplicationResource(new File("src/test/resources/weblogic-application.xml"))
.addAsLibrary(lJavaArchive)
.addAsLibraries(lFiles);
//Sysout no console do ear configurado, sempre verificar se foi criado corretamente com as configurações
System.out.println(lEnterpriseArchive.toString(true));
return lEnterpriseArchive;
}
@EJB(lookup="ProtocoloFacadeEJB3")
ProtocoloFacadeEJB3 protocoloFacadeEJB3;
@Test
@DisplayName("Testa a alteração de um protocolo (Atualmente só ocorre para ITCD). Falhará pois é um protocolo fake.")
public void testAlterarProtocoloInvalido() throws UFWException {
NumeroProtocolo lNumeroProtocoloFake = new NumeroProtocolo(999900000012L);
ProtocoloModel lProtocoloModel = new ProtocoloModel();
lProtocoloModel.setProtocolo(lNumeroProtocoloFake);
lProtocoloModel.setDataSolicitacao(new Date());
SolicitanteModel lSolicitante = new SolicitanteModel();
lSolicitante.setIdentificacao(new IdentificacaoCPF("88888888888"));
lSolicitante.setNome("Teste Arquillian");
lProtocoloModel.setSolicitante(lSolicitante);
try {
protocoloFacadeEJB3.alterar(lProtocoloModel);
// Se não lançar exceção, então indica que a validação falhou.
assertTrue(false);
} catch (SicafAplicacaoException e) {
assertTrue(e.getCodigoErro().equals(SicafConstantesDicionarioIf.PAR_REGISTRO_JA_REMOVIDO));
}
}
}
pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>gov.sefmg</groupId>
<artifactId>projeto-sefmg</artifactId>
<version>5.8</version>
</parent>
<artifactId>protocolonegocio</artifactId>
<packaging>ejb</packaging>
<version>1.0.0</version>
<name>protocolonegocio</name>
<dependencies>
<dependency>
<groupId>org.jboss.arquillian.junit</groupId>
<artifactId>arquillian-junit-container</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.arquillian.container</groupId>
<artifactId>arquillian-wls-remote-12.1.x</artifactId>
<version>1.0.1.Final</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.descriptors</groupId>
<artifactId>shrinkwrap-descriptors-impl-javaee</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-impl-maven</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-api-maven-embedded</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-launcher</artifactId>
<version>1.5.0-M1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>5.3.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.4.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.4.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.opentest4j</groupId>
<artifactId>opentest4j</artifactId>
<version>1.1.1</version>
<scope>provided</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.arquillian</groupId>
<artifactId>arquillian-bom</artifactId>
<version>1.4.1.Final</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-bom</artifactId>
<version>3.1.3</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.descriptors</groupId>
<artifactId>shrinkwrap-descriptors-bom</artifactId>
<version>2.0.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
.
.
.
</project>
arquillian.xml
<?xml version="1.0"?>
<arquillian
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://jboss.org/schema/arquillian"
xsi:schemaLocation="http://jboss.org/schema/arquillian
http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
<engine>
<property name="deploymentExportPath">target/deployments</property>
</engine>
<container qualifier="weblogic" default="true">
<protocol type="Servlet 3.0" />
<configuration>
<property name="wlHome">C:/Ambiente/as/Oracle/Middleware/wlserver_12.1</property>
<property name="domainDirectory">C:/Ambiente/as/Oracle/Middleware/user_projects/domains/siare_com_provider</property>
<property name="middlewareHome">C:/Ambiente/as/Oracle/Middleware</property>
<property name="adminUrl">t3://localhost:7001</property>
<property name="adminUserName">weblogic</property>
<property name="adminPassword">welcome1</property>
<property name="target">AdminServer</property>
<property name="allowConnectingToRunningServer">true</property>
</configuration>
</container>
</arquillian>
application.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<application xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="7"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/application_7.xsd">
<display-name>ear</display-name>
<module>
<ejb>lib/protocolonegocio-1.0.0.jar</ejb>
</module>
<library-directory>lib</library-directory>
</application>
weblogic-application.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wls:weblogic-application
xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-application"
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/javaee_7.xsd http://xmlns.oracle.com/weblogic/weblogic-application http://xmlns.oracle.com/weblogic/weblogic-application/1.7/weblogic-application.xsd">
<!--weblogic-version:12.2.1 -->
<wls:application-param>
<wls:param-name>webapp.encoding.default</wls:param-name>
<wls:param-value>UTF-8</wls:param-value>
</wls:application-param>
<wls:library-ref>
<wls:library-name>siare-client</wls:library-name>
</wls:library-ref>
<wls:library-ref>
<wls:library-name>lib-sef</wls:library-name>
</wls:library-ref>
<wls:library-ref>
<wls:library-name>siare-libs</wls:library-name>
</wls:library-ref>
</wls:weblogic-application>
堆栈跟踪
class "gov.sefmg.sicaf.seguranca.model.UsuarioSefModel" 在 "siare-client" 库中。
javax.ejb.EJBException: EJB Exception: ; nested exception is:
java.lang.NoClassDefFoundError: gov/sefmg/sicaf/seguranca/model/UsuarioSefModel
at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.unwrapRemoteException(RemoteBusinessIntfProxy.java:129)
at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:99)
at com.sun.proxy.$Proxy1696.alterar(Unknown Source)
at br.gov.mg.fazenda.protocolonegocio.testeintegracao.ProtocoloTest.testAlterarFluxoInvalido(ProtocoloTest.java:309)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.jboss.arquillian.junit.Arquillian.invokeMethod(Arquillian.java:325)
at org.jboss.arquillian.junit.MethodInvoker.invoke(MethodInvoker.java:18)
at org.jboss.arquillian.container.test.impl.execution.LocalTestExecuter.execute(LocalTestExecuter.java:57)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:103)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:90)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:133)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:105)
at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:62)
at org.jboss.arquillian.container.test.impl.execution.ContainerTestExecuter.execute(ContainerTestExecuter.java:36)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:103)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:90)
at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:116)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95)
at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:83)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95)
at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:69)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:133)
at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.test(EventTestRunnerAdaptor.java:139)
at org.jboss.arquillian.junit.MethodInvoker.invoke(MethodInvoker.java:15)
at org.jboss.arquillian.junit.Arquillian.evaluate(Arquillian.java:332)
at org.jboss.arquillian.junit.Arquillian.evaluate(Arquillian.java:204)
at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:350)
at org.jboss.arquillian.junit.Arquillian.access0(Arquillian.java:54)
at org.jboss.arquillian.junit.Arquillian.evaluate(Arquillian.java:215)
at org.jboss.arquillian.junit.Arquillian.invoke(Arquillian.java:279)
at org.jboss.arquillian.container.test.impl.execution.BeforeLifecycleEventExecuter.on(BeforeLifecycleEventExecuter.java:34)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:103)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:90)
at org.jboss.arquillian.test.impl.TestContextHandler.createTestContext(TestContextHandler.java:116)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95)
at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:83)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95)
at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:69)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:133)
at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:105)
at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.fireCustomLifecycle(EventTestRunnerAdaptor.java:159)
at org.jboss.arquillian.junit.Arquillian.evaluate(Arquillian.java:273)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access[=15=]0(ParentRunner.java:58)
at org.junit.runners.ParentRunner.evaluate(ParentRunner.java:268)
at org.jboss.arquillian.junit.Arquillian.evaluate(Arquillian.java:166)
at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:350)
at org.jboss.arquillian.junit.Arquillian.access0(Arquillian.java:54)
at org.jboss.arquillian.junit.Arquillian.evaluate(Arquillian.java:177)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:115)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
at org.jboss.arquillian.junit.container.JUnitTestRunner.execute(JUnitTestRunner.java:61)
at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.executeTest(ServletTestRunner.java:139)
at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.execute(ServletTestRunner.java:117)
at org.jboss.arquillian.protocol.servlet.runner.ServletTestRunner.doGet(ServletTestRunner.java:86)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:295)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:260)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:137)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:353)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:25)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:32)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:78)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3786)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3752)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:326)
at weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197)
at weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)
at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71)
at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2451)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2299)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2277)
at weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1703)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1663)
at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:272)
at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:352)
at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:337)
at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:57)
at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:644)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:415)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:355)
Caused by: java.rmi.RemoteException: EJB Exception: ; nested exception is:
java.lang.NoClassDefFoundError: gov/sefmg/sicaf/seguranca/model/UsuarioSefModel
at weblogic.ejb.container.internal.EJBRuntimeUtils.asRemoteException(EJBRuntimeUtils.java:60)
at weblogic.ejb.container.internal.BaseRemoteObject.handleSystemException(BaseRemoteObject.java:581)
at weblogic.ejb.container.internal.BaseRemoteObject.handleSystemException(BaseRemoteObject.java:537)
at weblogic.ejb.container.internal.BaseRemoteObject.postInvoke1(BaseRemoteObject.java:365)
at weblogic.ejb.container.internal.StatelessRemoteObject.postInvoke1(StatelessRemoteObject.java:20)
at weblogic.ejb.container.internal.BaseRemoteObject.__WL_postInvokeTxRetry(BaseRemoteObject.java:307)
at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invokeInternal(SessionRemoteMethodInvoker.java:67)
at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:21)
at gov.sefmg.sicaf.protocolo.controller.ProtocoloFacadeEJB3_frcos0_ProtocoloFacadeEJB3Impl.alterar(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:86)
... 142 more
Caused by: java.lang.NoClassDefFoundError: gov/sefmg/sicaf/seguranca/model/UsuarioSefModel
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetPublicMethods(Class.java:2902)
at java.lang.Class.getMethods(Class.java:1615)
at weblogic.rmi.utils.Utilities.getRemoteMethodsAndSignatures(Utilities.java:370)
at weblogic.rmi.utils.Utilities.getRemoteMethodsAndSignatures(Utilities.java:360)
at weblogic.rmi.internal.ClientRuntimeDescriptor.isInterAppClassLoaderNeeded(ClientRuntimeDescriptor.java:313)
at weblogic.rmi.internal.ClientRuntimeDescriptor.findLoader(ClientRuntimeDescriptor.java:278)
at weblogic.rmi.internal.ClientRuntimeDescriptor.getClassLoader(ClientRuntimeDescriptor.java:168)
at weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:843)
at weblogic.rmi.extensions.StubFactory.getStub(StubFactory.java:73)
at weblogic.rmi.internal.StubInfo.resolveObject(StubInfo.java:410)
at weblogic.rmi.internal.StubInfo.readResolve(StubInfo.java:332)
at sun.reflect.GeneratedMethodAccessor46.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at java.io.ObjectStreamClass.invokeReadResolve(ObjectStreamClass.java:1248)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2073)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1568)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:428)
at weblogic.rmi.extensions.server.CBVInputStream.readObject(CBVInputStream.java:64)
at weblogic.rmi.internal.ServerRequest.unmarshalReturn(ServerRequest.java:127)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:555)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:313)
at gov.sefmg.sicaf.retaguarda.servico.controller.RetaguardaServicoFacade_lgeqsw_HomeImpl_12213_WLStub.create(Unknown Source)
at gov.sefmg.sicaf.protocolo.controller.ProtocoloRN.getRetaguardaServicoFacade(ProtocoloRN.java:264)
at gov.sefmg.sicaf.protocolo.controller.ProtocoloRN.validarPermissao(ProtocoloRN.java:228)
at gov.sefmg.sicaf.protocolo.controller.ProtocoloRN.alterar(ProtocoloRN.java:192)
at gov.sefmg.sicaf.protocolo.controller.ProtocoloFacadeBean.alterar(ProtocoloFacadeBean.java:104)
at gov.sefmg.sicaf.protocolo.controller.ProtocoloFacadeEJB3_frcos0_ProtocoloFacadeEJB3Impl.__WL_invoke(Unknown Source)
at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invokeInternal(SessionRemoteMethodInvoker.java:54)
... 149 more
有人可以给点小费吗?
我发现了问题。
Weblogic在应用程序的库目录下虚拟合并一个共享库的库目录。
我的共享库正在使用“libs”作为库目录。
但是,应用程序正在使用“lib”作为库目录。
因此,Weblogic 不会合并内容。