<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=rober2d2" rel="nofollow">Roberto Ruiz</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-5352?redirect=false" rel="nofollow">SPR-5352</a></strong> and commented</p>
<p dir="auto">I suppose this is more an Axis2 problem that an Spring one, but may be something can be done</p>
<p dir="auto">I am programming a webservice using Axis2. The bean is provided by Spring:</p>
<p dir="auto">&lt;parameter name="ServiceObjectSupplier"&gt;org.apache.axis2.extensions.spring.receivers.SpringServletContextObjectSupplier&lt;/parameter&gt;<br>
&lt;parameter name="SpringBeanName"&gt;habilitadosWebService&lt;/parameter&gt;</p>
<p dir="auto">It works OK, until I try to put an aspect around habilitadosWebService  bean (The aspect is used to control security). When I start the Tomcat server, I recieve the following exception message: Unable to load bytecode for class $Proxy16. I also tried using CGLIB proxies, but the result is the same.</p>
<p dir="auto">The stack trace is:</p>
<p dir="auto">[ERROR] 11:54:19,592 The HabilitadosWeb service, which is not valid, caused The following error occurred during schema generation: Unable to load bytecode for class $Proxy16 (ServiceDeployer.java:deploy:96)<br>
org.apache.axis2.deployment.DeploymentException: The following error occurred during schema generation: Unable to load bytecode for class $Proxy16<br>
at org.apache.axis2.deployment.ServiceBuilder.populateService(ServiceBuilder.java:431)<br>
at org.apache.axis2.deployment.repository.util.ArchiveReader.buildServiceGroup(ArchiveReader.java:102)<br>
at org.apache.axis2.deployment.repository.util.ArchiveReader.processServiceGroup(ArchiveReader.java:179)<br>
at org.apache.axis2.deployment.ServiceDeployer.deploy(ServiceDeployer.java:81)<br>
at org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:136)<br>
at org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:597)<br>
at org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:144)<br>
at org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.java:330)<br>
at org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListener.java:227)<br>
at org.apache.axis2.deployment.DeploymentEngine.loadServices(DeploymentEngine.java:131)<br>
at org.apache.axis2.deployment.WarBasedAxisConfigurator.loadServices(WarBasedAxisConfigurator.java:284)<br>
at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:82)<br>
at org.apache.axis2.transport.http.AxisServlet.initConfigContext(AxisServlet.java:516)<br>
at org.apache.axis2.transport.http.AxisServlet.init(AxisServlet.java:436)<br>
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139)<br>
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)<br>
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3956)<br>
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4230)<br>
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)<br>
at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)<br>
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)<br>
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)<br>
at org.apache.catalina.core.StandardService.start(StandardService.java:448)<br>
at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)<br>
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)<br>
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br>
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br>
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br>
at java.lang.reflect.Method.invoke(Method.java:585)<br>
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)<br>
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)<br>
Caused by: org.apache.axis2.deployment.DeploymentException: The following error occurred during schema generation: Unable to load bytecode for class $Proxy16<br>
at org.apache.axis2.deployment.ServiceBuilder.populateService(ServiceBuilder.java:394)<br>
... 30 more<br>
Caused by: java.io.IOException: Unable to load bytecode for class $Proxy16<br>
at org.apache.axis2.description.java2wsdl.bytecode.ClassReader.getBytes(ClassReader.java:84)<br>
at org.apache.axis2.description.java2wsdl.bytecode.ParamReader.&lt;init&gt;(ParamReader.java:57)<br>
at org.apache.axis2.description.java2wsdl.bytecode.ChainedParamReader.&lt;init&gt;(ChainedParamReader.java:52)<br>
at org.apache.axis2.description.java2wsdl.bytecode.MethodTable.&lt;init&gt;(MethodTable.java:31)<br>
at org.apache.axis2.description.java2wsdl.DefaultSchemaGenerator.&lt;init&gt;(DefaultSchemaGenerator.java:158)<br>
at org.apache.axis2.deployment.util.Utils.fillAxisService(Utils.java:524)<br>
at org.apache.axis2.deployment.ServiceBuilder.populateService(ServiceBuilder.java:386)<br>
... 30 more</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 2.5.3</p>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398092333" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/10026" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/10026/hovercard" href="https://github.com/spring-projects/spring-framework/issues/10026">#10026</a> Can't use aspects around Axis2 service beans (<em><strong>"is duplicated by"</strong></em>)</li>
</ul>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=antonyblakey" rel="nofollow">Antony Blakey</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-1259?redirect=false" rel="nofollow">SPR-1259</a></strong> and commented</p>
<p dir="auto">org.springframework.web.servlet.FrameworkServer.serviceWrapper is private, which makes it impossible to create a subclass of DispatcherServlet that handles extended HTTP verbs such as the WebDAV set - to do this you need to override HttpServlet.service and pass calls to serviceWrapper. It's not an option to copy the serviceWrapper method because it refers to private fields. By simply changing serviceWrapper from private to protected this use case would be enabled.</p>
<p dir="auto">The only workaround is to duplicate FrameworkServlet + DispatcherServlet in one's own code, which is a PITA in every way.</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 1.2.4</p>