You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Martin Gainty (JIRA)" <ji...@apache.org> on 2013/04/06 02:49:16 UTC
[jira] [Commented] (AXIS2-3618) WSDL2Java produces code that causes
javac to fail with "code to large"
[ https://issues.apache.org/jira/browse/AXIS2-3618?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13624244#comment-13624244 ]
Martin Gainty commented on AXIS2-3618:
--------------------------------------
This is not the fault of Axis but the fault of Class.getMethod failure to interrogate code size<=64K
but there is a workaround available:
XSL does blind substitution ..the solution is to extend fromOM to output a Collection ( as seen here )
Original:
java.lang.Object object = fromOM(
_returnEnv.getBody().getFirstElement() ,
<xsl:value-of select="$outputtype"/>.class,
getEnvelopeNamespaces(_returnEnv));
New:
Collection collection_of_object=fromOM_Collection
_returnEnv.getBody().getFirstElement() ,
<xsl:value-of select="$outputtype"/>.class,
getEnvelopeNamespaces(_returnEnv));
<!-- Class.getMethod would need the new Class so we must change messageClass from
java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage",
new java.lang.Class[]{messageClass});
-->
while (collection_of_object.iterator().hasNext())
{
Object object=collection_of_object.iterator().next().
Class messageClass =object.getClass();
java.lang.reflect.Method m = exceptionClass.getMethod("setFaultMessage",
new java.lang.Class[]{messageClass});
<!-- assume fromOM outputs <objects>
<object>
</object>
</objects>
-->
<xsl:for-each select="objects/object">
<!-- IF output/param[@location='body']/param) drives each record to be unique
then we can retain outputparamcount as our counter
otherwise we could need another counter to make sure each xsl:when test is unique for each
object
-->
<xsl:when test="$outputparamcount=1" return get
<xsl:value-of select="$outputparamshorttype"/>
<xsl:value-of select="$outputparampartname"/>((<xsl:value-of select="$outputtype"/>)object);
</xsl:when>
<xsl:when test="$outputparamcount=2" return get
<xsl:value-of select="$outputparamshorttype"/>
<xsl:value-of select="$outputparampartname"/>((<xsl:value-of select="$outputtype"/>)object);
</xsl:when>
</xsl:for-each>
} <!-- end when -->
Personally I would prefer to twiddle Class.getMethod but thats part of the JDK so the only solution
is to have fromOM create multiple classes (with identical method names) e.g.
class Object1Class { public void method1, public void method2... };
class Object2Class { public void method1, public void method2...};
Everyone uses toOM and fromOM to generate their XML and then to transform XML to code
so these methods need to be left as is
ToOM_Collection and fromOM_Collection is the only solution that would work
Martin.. 5 April 2013
> WSDL2Java produces code that causes javac to fail with "code to large"
> ----------------------------------------------------------------------
>
> Key: AXIS2-3618
> URL: https://issues.apache.org/jira/browse/AXIS2-3618
> Project: Axis2
> Issue Type: Bug
> Components: codegen
> Affects Versions: 1.3
> Environment: We have encountered this problem both on linux using jdk 1.6 and on Windows using jdk 1.5.
> Reporter: Peter Canning
> Priority: Critical
> Attachments: Axis2Patch, vimService.wsdl, vim.wsdl
>
>
> When generating stubs from a large WSDL document using either the ADB or XMLBeans databindings, the generated code causes javac to fail with the following error
> [javac] /exit26/home/pcanning/visdk_clients/2.5/axis2-1.3/axis_stubs/src/com/vmware/vim/VimServiceStub.java:3090: code too large
> [javac] private void populateFaults() {
> [javac] ^
> FYI: In order to successfully run the Axis2-1.3 stub generator, I had to modify axis2.sh to add -Xmx512M to increase the maximum heap size.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org