[jira] [Commented] (AXIS2-5935) axis2 service did not work under jdk 11 class format

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (AXIS2-5935) axis2 service did not work under jdk 11 class format

Adam Fordham (Jira)

    [ https://issues.apache.org/jira/browse/AXIS2-5935?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17040442#comment-17040442 ]

Frank-Michael Jaeschke commented on AXIS2-5935:
-----------------------------------------------

Stumbled over this problem in Axis1 1,4 with Java 8 compiled client due to converting a project from old Websphere 8.0 to Liberty (JAX-RPC with clients that will not change soon :().

 

Easiest way to replicate the problem without any patch for me was to deploy service and obtaining the WSDL by ?WSDL.

Even if wsdlFile Element in Deployment Descriptor is used, Axis generates the WSDL from deployed service. And in this case the bytecode introspection is done.

 

 

Patched it for Axis1 by using Paranamer:

Index: src/org/apache/axis/utils/bytecode/ClassReader.java
===================================================================
--- src/org/apache/axis/utils/bytecode/ClassReader.java (revision 1845252)
+++ src/org/apache/axis/utils/bytecode/ClassReader.java (working copy)
@@ -59,6 +59,9 @@
 private static final int CONSTANT_Double = 6;
 private static final int CONSTANT_NameAndType = 12;
 private static final int CONSTANT_Utf8 = 1;
+ private static final int CONSTANT_MethodHandle = 15;
+ private static final int CONSTANT_MethodType = 16;
+ private static final int CONSTANT_InvokeDynamic = 18;
 /**
 * the constant pool. constant pool indices in the class file
 * directly index into this array. The value stored in this array
@@ -312,6 +315,9 @@
 cpoolIndex[i] = super.pos;
 switch (c) // constant pool tag
 {
+ case CONSTANT_MethodHandle:
+ case CONSTANT_MethodType:
+ case CONSTANT_InvokeDynamic:
 case CONSTANT_Fieldref:
 case CONSTANT_Methodref:
 case CONSTANT_InterfaceMethodref:
Index: src/org/apache/axis/utils/bytecode/ParamNameExtractor.java
===================================================================
--- src/org/apache/axis/utils/bytecode/ParamNameExtractor.java (revision 1845252)
+++ src/org/apache/axis/utils/bytecode/ParamNameExtractor.java (working copy)
@@ -15,6 +15,8 @@
 */
 package org.apache.axis.utils.bytecode;
 
+import com.thoughtworks.paranamer.BytecodeReadingParanamer;
+import com.thoughtworks.paranamer.Paranamer;
 import org.apache.axis.components.logger.LogFactory;
 import org.apache.axis.utils.Messages;
 import org.apache.commons.logging.Log;
@@ -53,16 +55,15 @@
 return null;
 }
 
- try {
- // get a parameter reader
- ParamReader pr = new ParamReader(c);
+ // get a parameter reader
+// ParamReader pr = new ParamReader(c);
 // get the paramter names
- String[] names = pr.getParameterNames(method);
+ Paranamer paranamer = new BytecodeReadingParanamer();
+ String[] names = paranamer.lookupParameterNames(method, false);
+ if (names == null || names.length == 0) {
+ return null;
+ } else {
 return names;
- } catch (IOException e) {
- // log it and leave
- log.info(Messages.getMessage("error00") + ":" + e);
- return null;
 }
 }
 }
\ No newline at end of file

> axis2 service did not work under jdk 11 class format
> ----------------------------------------------------
>
>                 Key: AXIS2-5935
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5935
>             Project: Axis2
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.7.8
>            Reporter: Kris Chung
>            Priority: Blocker
>         Attachments: ClassReader.java, ClassReader.java.patch, axis2-kernel-1.7.10.jar
>
>
> jdk version: 11
> tomcat: 9.0.12
> os: centos 6
> axis2 version: 1.7.8
> 20:06:16.797 ERROR ServiceDeployer - The axis2 service, which is not valid, caused The following error occurred during schema generation: Error looking for paramter names in bytecode: unexpected bytes in file
> org.apache.axis2.deployment.DeploymentException: The following error occurred during schema generation: Error looking for paramter names in bytecode: unexpected bytes in file
>  at org.apache.axis2.deployment.ServiceGroupBuilder.populateServiceGroup(ServiceGroupBuilder.java:106) ~[axis2-kernel-1.7.8.jar:1.7.8]
>  at org.apache.axis2.deployment.repository.util.ArchiveReader.buildServiceGroup(ArchiveReader.java:117) ~[axis2-kernel-1.7.8.jar:1.7.8]
>  at org.apache.axis2.deployment.repository.util.ArchiveReader.processServiceGroup(ArchiveReader.java:232) ~[axis2-kernel-1.7.8.jar:1.7.8]
>  at org.apache.axis2.deployment.ServiceDeployer.deploy(ServiceDeployer.java:154) ~[axis2-kernel-1.7.8.jar:1.7.8]
>  at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:149) ~[axis2-kernel-1.7.8.jar:1.7.8]
>  at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:585) ~[axis2-kernel-1.7.8.jar:1.7.8]
>  at org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:164) ~[axis2-kernel-1.7.8.jar:1.7.8]
>  at org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.java:377) ~[axis2-kernel-1.7.8.jar:1.7.8]
>  at org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListener.java:254) ~[axis2-kernel-1.7.8.jar:1.7.8]
>  at org.apache.axis2.deployment.DeploymentEngine.loadServices(DeploymentEngine.java:136) ~[axis2-kernel-1.7.8.jar:1.7.8]
>  at org.apache.axis2.deployment.WarBasedAxisConfigurator.loadServices(WarBasedAxisConfigurator.java:289) ~[axis2-kernel-1.7.8.jar:1.7.8]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]