aspose file tools*
The moose likes XML and Related Technologies and the fly likes Transformation Error - Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Transformation Error - "Branch target offset too large for short"" Watch "Transformation Error - "Branch target offset too large for short"" New topic
Author

Transformation Error - "Branch target offset too large for short"

Abdul Basit Munda
Greenhorn

Joined: Sep 07, 2005
Posts: 10
Hi ,
I am getting this weird if i try to do a transformation from an xslt to xml
here is the error i get
"com.sun.org.apache.bcel.internal.generic.ClassGenException: Branch target offset too large for short
at com.sun.org.apache.bcel.internal.generic.BranchInstruction.dump(BranchInstruction.java:99)
at com.sun.org.apache.bcel.internal.generic.InstructionList.getByteCode(InstructionList.java:980)
at com.sun.org.apache.bcel.internal.generic.MethodGen.getMethod(MethodGen.java:587)
at com.sun.org.apache.xalan.internal.xsltc.compiler.Mode.compileNamedTemplate(Mode.java:581)
at com.sun.org.apache.xalan.internal.xsltc.compiler.Mode.compileTemplates(Mode.java:591)
at com.sun.org.apache.xalan.internal.xsltc.compiler.Mode.compileApplyTemplates(Mode.java:843)
at com.sun.org.apache.xalan.internal.xsltc.compiler.Stylesheet.compileModes(Stylesheet.java:615)
at com.sun.org.apache.xalan.internal.xsltc.compiler.Stylesheet.translate(Stylesheet.java:730)
at com.sun.org.apache.xalan.internal.xsltc.compiler.XSLTC.compile(XSLTC.java:335)
at com.sun.org.apache.xalan.internal.xsltc.compiler.XSLTC.compile(XSLTC.java:410)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:791)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:619)
at com.sun.sleuth.services.OCATReportGenerator.fileOperation(Unknown Source)
at com.sun.sleuth.omcmweb.model.dao.jdbc.ProjectDaoJdbcImpl.getProjectReport(Unknown Source)
at com.sun.sleuth.omcmweb.model.service.impl.ProjectServiceImpl.getReport(Unknown Source)
at com.sun.sleuth.webservices.server.impl.ProjectWebServiceImpl.getReport(Unknown Source)
at com.sun.sleuth.webservices.server.ProjectWebService__Project_Service__Tie.invoke_getReport(ProjectWebService__Project_Service__Tie.java:54)
at com.sun.sleuth.webservices.server.ProjectWebService__Project_Service__Tie.processingHook(ProjectWebService__Project_Service__Tie.java:295)
at com.sun.xml.rpc.server.StreamingHandler.handle(StreamingHandler.java:333)
at com.sun.xml.rpc.server.http.JAXRPCServletDelegate.doPost(JAXRPCServletDelegate.java:448)
at com.sun.xml.rpc.server.http.JAXRPCServlet.doPost(JAXRPCServlet.java:102)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:535)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:790)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:709)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:572)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:644)
at java.lang.Thread.run(Thread.java:534)
ERROR: 'Branch target offset too large for short'
FATAL ERROR: 'Could not compile stylesheet'
Error in Report Generation Process
Could not compile stylesheet"

Here is the code which i m trying to run

StreamResult result = new StreamResult(new StringWriter());
System.out.println(" TransformFactory method applied");
System.out.println(" Rtemp Absolute Path " + rTemp.getAbsoluteFile().getAbsolutePath());

//This is the line causing error
Transformer transformer = TransformerFactory.newInstance().newTransformer(new


StreamSource(rTemp.getAbsoluteFile()));
System.out.println("Created Transformer");
transformer.transform(new StreamSource(content_xml.openStream()), result);
System.out.println("Applying transformation");
zipStream.putNextEntry(zipEn);
System.out.println(" Writing bytes");
byte [] rbytes = (result.getWriter()).toString().getBytes("UTF-8");"

I know that when i try to create transform object it give me reason and i know that error is due to the big xslt file but i have no idea how to solve it . I cant shorten my xslt because its very painful my xslt is 2000 lines(approx 121 kb) .If you guys can tell me any solution please do so

Thanks a lot
Sachin K Deshmukh
Greenhorn

Joined: Dec 29, 2006
Posts: 3

Try using the XALAN verison 2.7.1
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Transformation Error - "Branch target offset too large for short"
 
Similar Threads
getting a 500 error
error while deploying in Tomcat 5
Tomcat not loading mysql database driver
Problem with Jakarta Commons Fileupload
Remote Home lookup from tomcat 5.0 to Weblogic 8.1