1
votes

I used axis2 1.7.3 version for my web service requirement. when i deploy the aar files, it shows the below exception. I used the java 8 features (eg. streams, filter etc ) in web service implementation files. Does axis2 support to deploy the web services implemented with java 8 features.

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.ServiceBuilder.populateService(ServiceBuilder.java:441) at org.apache.axis2.deployment.repository.util.ArchiveReader.buildServiceGroup(ArchiveReader.java:109) at org.apache.axis2.deployment.repository.util.ArchiveReader.processServiceGroup(ArchiveReader.java:232) at org.apache.axis2.deployment.ServiceDeployer.deploy(ServiceDeployer.java:154) at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:149) at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:585) at org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:164) at org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.java:377) at org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListener.java:254) at org.apache.axis2.deployment.RepositoryListener.startListener(RepositoryListener.java:371) at org.apache.axis2.deployment.scheduler.SchedulerTask.checkRepository(SchedulerTask.java:73) at org.apache.axis2.deployment.scheduler.SchedulerTask.run(SchedulerTask.java:94) at org.apache.axis2.deployment.scheduler.Scheduler$SchedulerTimerTask.run(Scheduler.java:93) at java.util.TimerThread.mainLoop(Unknown Source) at java.util.TimerThread.run(Unknown Source) Caused by: 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.ServiceBuilder.populateService(ServiceBuilder.java:404) ... 14 more Caused by: java.lang.IllegalStateException: Error looking for paramter names in bytecode: unexpected bytes in file at org.apache.axis2.description.java2wsdl.bytecode.ClassReader.readCpool(ClassReader.java:354) at org.apache.axis2.description.java2wsdl.bytecode.ParamReader.(ParamReader.java:78) at org.apache.axis2.description.java2wsdl.bytecode.ParamReader.(ParamReader.java:57) at org.apache.axis2.description.java2wsdl.bytecode.ChainedParamReader.(ChainedParamReader.java:52) at org.apache.axis2.description.java2wsdl.bytecode.MethodTable.(MethodTable.java:31) at org.apache.axis2.description.java2wsdl.DefaultSchemaGenerator.(DefaultSchemaGenerator.java:177) at org.apache.axis2.deployment.util.Utils.fillAxisService(Utils.java:454) at org.apache.axis2.deployment.ServiceBuilder.populateService(ServiceBuilder.java:396) ... 14 more

2

2 Answers

12
votes

No, Axis2 (I use 1.7.4) does not work when using Java 8 features in the implementation class, because axis somehow has a problem analyzing that bytecode.

As a workaround, removing Java 8 features (e.g. streams) in the skeleton implementation solved it in my case. You can use those features anywhere except in the web service implementation class (when using Axis2).

1
votes

Had a quick look at the Axis source code (https://svn.apache.org/repos/asf/axis/axis2/java/core/tags/v1.0/modules/java2wsdl/src/org/apache/ws/java2wsdl/bytecode/ClassReader.java), looks like you've got some problem with your class file ('corrupted class file', line 354).