0

我尝试从 alfresco 4.0.2 企业获取文档 URL。我使用 Java 8 将 web 服务作为 WAR。它在 tomcat 9 (java 8) 中工作,但在我的 Payara 社区服务器 5.2021.1 中不起作用。

战争在 Payara 中正确部署,但是当我得到网络服务时出现 NoSuchMethodError:

java.lang.NoSuchMethodError: org.apache.xml.security.transforms.Transform.init()V
at org.apache.ws.security.WSSConfig.staticInit(WSSConfig.java:308) ~[wss4j-1.5.12.jar:na]
at org.apache.ws.security.WSSConfig.<init>(WSSConfig.java:324) ~[wss4j-1.5.12.jar:na]
at org.apache.ws.security.WSSConfig.getNewInstance(WSSConfig.java:333) ~[wss4j-1.5.12.jar:na]
at org.apache.ws.security.WSSConfig.getDefaultWSConfig(WSSConfig.java:342) ~[wss4j-1.5.12.jar:na]
at org.apache.ws.security.WSSecurityEngine.getWssConfig(WSSecurityEngine.java:157) ~[wss4j-1.5.12.jar:na]
at org.apache.ws.security.handler.WSHandler.doSenderAction(WSHandler.java:97) ~[wss4j-1.5.12.jar:na]
at org.apache.ws.axis.security.WSDoAllSender.invoke(WSDoAllSender.java:170) ~[wss4j-1.5.12.jar:na]
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32) ~[axis-1.4.jar:na]
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118) ~[axis-1.4.jar:na]
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83) ~[axis-1.4.jar:na]
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:127) ~[axis-1.4.jar:na]
at org.apache.axis.client.Call.invokeEngine(Call.java:2784) ~[axis-1.4.jar:na]
at org.apache.axis.client.Call.invoke(Call.java:2767) ~[axis-1.4.jar:na]
at org.apache.axis.client.Call.invoke(Call.java:2443) ~[axis-1.4.jar:na]
at org.apache.axis.client.Call.invoke(Call.java:2366) ~[axis-1.4.jar:na]
at org.apache.axis.client.Call.invoke(Call.java:1812) ~[axis-1.4.jar:na]
at org.alfresco.webservice.content.ContentServiceSoapBindingStub.read(ContentServiceSoapBindingStub.java:467) ~[alfresco-web-service-client-3.4.b.jar:na]
at com.cfemex.lv.apps.alfresco.models.dao.AlfrescoDAO.getArchivoURL(AlfrescoDAO.java:349) ~[AlfrescoDAO.class:na]
at com.cfemex.lv.apps.alfresco.models.services.AlfrescoBO.mostrarArchivo(AlfrescoBO.java:132) ~[AlfrescoBO.class:na]
at com.cfemex.lv.apps.alfresco.controlllers.PruebaRestController.prueba2(PruebaRestController.java:32) ~[PruebaRestController.class:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_45]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_45]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_45]
at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_45]
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:197) ~[spring-web-5.3.4.jar:5.3.4]
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:141) ~[spring-web-5.3.4.jar:5.3.4]
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:106) ~[spring-webmvc-5.3.4.jar:5.3.4]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:894) ~[spring-webmvc-5.3.4.jar:5.3.4]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808) ~[spring-webmvc-5.3.4.jar:5.3.4]
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.3.4.jar:5.3.4]

规则 org.apache.xml.security.transforms.Transform.init() 不在 wss4j-1.5.12.jar 中,它在 xmlsec-1.4.1.jar 中。我不知道为什么在 Payara 中出现此错误,但在 Tomcat 中却没有。

在payara,我把罐子放进去:

  • payara5\glassfish\domains\domain1\lib
  • payara5\glassfish\lib

错误来自我的连接方法:

private void Conection(String user, String password){
    try {
        WebServiceFactory.setEndpointAddress(Util.getAlfrescoServer());
        AuthenticationUtils.startSession(user, password);
    } catch (Exception authenticationFault) {
        System.out.println(authenticationFault.getMessage());
        authenticationFault.printStackTrace();
    } }

我使用这个罐子:

  • alfresco-core-3.4.b.jar
  • alfresco-data-model-3.4.b.jar
  • 露天部署-3.4.b.jar
  • alfresco-jlan-embed-3.4.b.jar
  • alfresco-jndi-client-3.4.b.jar
  • alfresco-mbeans-3.4.b.jar
  • alfresco-remote-api-3.4.b.jar
  • alfresco-repository-3.4.b.jar
  • alfresco-web-client-3.4.b.jar
  • alfresco-web-service-client-3.4.b.jar
  • 轴1.4.jar
  • 轴架构.jar
  • commons-discovery-0.2.jar
  • commons-logging-1.1.jar
  • jaxrpc.jar
  • wsdl4j-1.5.1.jar
  • wss4j-1.5.12.jar
  • xmlsec-1.4.1.jar
  • xmlsec-1.4.1.jar

提前致谢。

4

1 回答 1

0

我解决了它在 payara5/glassfish/domains/domain1/applications/MYAPP/WEB-INF 添加 glassfish-web.xml

行 class-loader delegate="false" 问题消失了。但我还有其他与白名单相关的问题。

我的 glassfish-web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
<glassfish-web-app>
  <class-loader delegate="false"/>
  <whitelist-package>com.google</whitelist-package>
  <whitelist-package>org.alfresco</whitelist-package>
  <whitelist-package>org.apache</whitelist-package>
</glassfish-web-app>
于 2021-08-13T18:21:41.460 回答