У меня есть большое приложение, часть которого опирается на набор из 3 веб-сервисов.В настоящее время я нахожусь в процессе написания скрипта Ant для сборки и упаковки приложения в EAR-файл.При создании веб-подпроекта для этого приложения я использую задачу <jwsc>
в Ant для компиляции веб-сервисов.Это вызывает исключение IllegalAccessException, как показано ниже в трассировке стека:
[jwsc] warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
[jwsc] JWS: processing module weboutput
[jwsc] Parsing source files
[jwsc] Parsing source files
[jwsc] 3 JWS files being processed for module weboutput
[jwsc] JWS: C:\dev\ir\irWeb\src\webservices\DailyRun.java Validated.
[jwsc] JWS: C:\dev\ir\irWeb\src\webservices\PendingRegistrationsSweep.java Validated.
[jwsc] JWS: C:\dev\ir\irWeb\src\webservices\RegistrationsGoLive.java Validated.
[jwsc] Compiling 6 source files to C:\DOCUME~1\KEVIN~1.BRE\LOCALS~1\Temp\_5l950r
[jwsc] An exception has occurred in the compiler (1.6.0_23). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you.
[jwsc] java.lang.IllegalAccessError: tried to access class com.sun.tools.javac.jvm.ClassReader$AnnotationDefaultCompleter from class com.sun.tools.javac.jvm.ClassReader
[jwsc] at com.sun.tools.javac.jvm.ClassReader.attachAnnotationDefault(ClassReader.java:1128)
[jwsc] at com.sun.tools.javac.jvm.ClassReader.readMemberAttr(ClassReader.java:906)
[jwsc] at com.sun.tools.javac.jvm.ClassReader.readMemberAttrs(ClassReader.java:1027)
[jwsc] at com.sun.tools.javac.jvm.ClassReader.readMethod(ClassReader.java:1490)
[jwsc] at com.sun.tools.javac.jvm.ClassReader.readClass(ClassReader.java:1586)
[jwsc] at com.sun.tools.javac.jvm.ClassReader.readClassFile(ClassReader.java:1658)
[jwsc] at com.sun.tools.javac.jvm.ClassReader.fillIn(ClassReader.java:1845)
[jwsc] at com.sun.tools.javac.jvm.ClassReader.complete(ClassReader.java:1777)
[jwsc] at com.sun.tools.javac.code.Symbol.complete(Symbol.java:386)
[jwsc] at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:763)
[jwsc] at com.sun.tools.javac.jvm.ClassReader.loadClass(ClassReader.java:1951)
[jwsc] at com.sun.tools.javac.comp.Resolve.loadClass(Resolve.java:842)
[jwsc] at com.sun.tools.javac.comp.Resolve.findIdentInPackage(Resolve.java:1011)
[jwsc] at com.sun.tools.javac.comp.Attr.selectSym(Attr.java:1921)
[jwsc] at com.sun.tools.javac.comp.Attr.visitSelect(Attr.java:1835)
[jwsc] at com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:1522)
[jwsc] at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:360)
[jwsc] at com.sun.tools.javac.comp.Attr.attribType(Attr.java:390)
[jwsc] at com.sun.tools.javac.comp.MemberEnter.attribImportType(MemberEnter.java:681)
[jwsc] at com.sun.tools.javac.comp.MemberEnter.visitImport(MemberEnter.java:545)
[jwsc] at com.sun.tools.javac.tree.JCTree$JCImport.accept(JCTree.java:495)
[jwsc] at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:387)
[jwsc] at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:399)
[jwsc] at com.sun.tools.javac.comp.MemberEnter.visitTopLevel(MemberEnter.java:512)
[jwsc] at com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:446)
[jwsc] at com.sun.tools.javac.comp.MemberEnter.memberEnter(MemberEnter.java:387)
[jwsc] at com.sun.tools.javac.comp.MemberEnter.complete(MemberEnter.java:819)
[jwsc] at com.sun.tools.javac.code.Symbol.complete(Symbol.java:386)
[jwsc] at com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:763)
[jwsc] at com.sun.tools.javac.comp.Enter.complete(Enter.java:464)
[jwsc] at com.sun.tools.javac.comp.Enter.main(Enter.java:442)
[jwsc] at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:819)
[jwsc] at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:727)
[jwsc] at com.sun.tools.javac.main.Main.compile(Main.java:353)
[jwsc] at com.sun.tools.javac.main.Main.compile(Main.java:279)
[jwsc] at com.sun.tools.javac.main.Main.compile(Main.java:270)
[jwsc] at com.sun.tools.javac.Main.compile(Main.java:69)
[jwsc] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[jwsc] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[jwsc] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[jwsc] at java.lang.reflect.Method.invoke(Method.java:597)
[jwsc] at org.apache.tools.ant.taskdefs.compilers.Javac13.execute(Javac13.java:56)
[jwsc] at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:1097)
[jwsc] at weblogic.wsee.tools.anttasks.DelegatingJavacTask$ExposingJavac.compile(DelegatingJavacTask.java:343)
[jwsc] at weblogic.wsee.tools.anttasks.DelegatingJavacTask.compile(DelegatingJavacTask.java:286)
[jwsc] at weblogic.wsee.tools.anttasks.JwscTask.javac(JwscTask.java:335)
[jwsc] at weblogic.wsee.tools.anttasks.JwsModule.compile(JwsModule.java:390)
[jwsc] at weblogic.wsee.tools.anttasks.JwsModule.build(JwsModule.java:262)
[jwsc] at weblogic.wsee.tools.anttasks.JwscTask.execute(JwscTask.java:227)
[jwsc] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
[jwsc] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
[jwsc] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[jwsc] at java.lang.reflect.Method.invoke(Method.java:597)
[jwsc] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[jwsc] at org.apache.tools.ant.Task.perform(Task.java:348)
[jwsc] at org.apache.tools.ant.Target.execute(Target.java:390)
[jwsc] at org.apache.tools.ant.Target.performTasks(Target.java:411)
[jwsc] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1397)
[jwsc] at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
[jwsc] at org.apache.tools.ant.Project.executeTargets(Project.java:1249)
[jwsc] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:442)
[jwsc] at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
[jwsc] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
[jwsc] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
[jwsc] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[jwsc] at java.lang.reflect.Method.invoke(Method.java:597)
[jwsc] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[jwsc] at org.apache.tools.ant.Task.perform(Task.java:348)
[jwsc] at org.apache.tools.ant.Target.execute(Target.java:390)
[jwsc] at org.apache.tools.ant.Target.performTasks(Target.java:411)
[jwsc] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1397)
[jwsc] at org.apache.tools.ant.Project.executeTarget(Project.java:1366)
[jwsc] at com.bea.workshop.cmdline.antlib.AntExTask.execute(AntExTask.java:406)
[jwsc] at com.bea.workshop.cmdline.antlib.AntCallExTask.execute(AntCallExTask.java:118)
[jwsc] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
[jwsc] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
[jwsc] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[jwsc] at java.lang.reflect.Method.invoke(Method.java:597)
[jwsc] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[jwsc] at org.apache.tools.ant.Task.perform(Task.java:348)
[jwsc] at org.apache.tools.ant.Target.execute(Target.java:390)
[jwsc] at org.apache.tools.ant.Target.performTasks(Target.java:411)
[jwsc] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1397)
[jwsc] at org.apache.tools.ant.Project.executeTarget(Project.java:1366)
[jwsc] at com.bea.workshop.cmdline.antlib.AntExTask.execute(AntExTask.java:406)
[jwsc] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
[jwsc] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
[jwsc] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[jwsc] at java.lang.reflect.Method.invoke(Method.java:597)
[jwsc] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[jwsc] at org.apache.tools.ant.Task.perform(Task.java:348)
[jwsc] at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
[jwsc] at net.sf.antcontrib.logic.IfTask.execute(IfTask.java:217)
[jwsc] at sun.reflect.GeneratedMethodAccessor44.invoke(Unknown Source)
[jwsc] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[jwsc] at java.lang.reflect.Method.invoke(Method.java:597)
[jwsc] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[jwsc] at org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:154)
[jwsc] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
[jwsc] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
[jwsc] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[jwsc] at java.lang.reflect.Method.invoke(Method.java:597)
[jwsc] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[jwsc] at org.apache.tools.ant.Task.perform(Task.java:348)
[jwsc] at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
[jwsc] at net.sf.antcontrib.logic.IfTask.execute(IfTask.java:197)
[jwsc] at sun.reflect.GeneratedMethodAccessor44.invoke(Unknown Source)
[jwsc] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[jwsc] at java.lang.reflect.Method.invoke(Method.java:597)
[jwsc] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[jwsc] at org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:154)
[jwsc] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
[jwsc] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
[jwsc] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[jwsc] at java.lang.reflect.Method.invoke(Method.java:597)
[jwsc] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[jwsc] at org.apache.tools.ant.Task.perform(Task.java:348)
[jwsc] at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
[jwsc] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
[jwsc] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
[jwsc] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[jwsc] at java.lang.reflect.Method.invoke(Method.java:597)
[jwsc] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[jwsc] at org.apache.tools.ant.Task.perform(Task.java:348)
[jwsc] at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:398)
[jwsc] at net.sf.antcontrib.logic.ForTask.doSequentialIteration(ForTask.java:259)
[jwsc] at net.sf.antcontrib.logic.ForTask.doToken(ForTask.java:268)
[jwsc] at net.sf.antcontrib.logic.ForTask.doTheTasks(ForTask.java:299)
[jwsc] at net.sf.antcontrib.logic.ForTask.execute(ForTask.java:244)
[jwsc] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
[jwsc] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
[jwsc] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[jwsc] at java.lang.reflect.Method.invoke(Method.java:597)
[jwsc] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[jwsc] at org.apache.tools.ant.Task.perform(Task.java:348)
[jwsc] at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
[jwsc] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
[jwsc] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
[jwsc] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[jwsc] at java.lang.reflect.Method.invoke(Method.java:597)
[jwsc] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[jwsc] at org.apache.tools.ant.Task.perform(Task.java:348)
[jwsc] at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:398)
[jwsc] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
[jwsc] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
[jwsc] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[jwsc] at java.lang.reflect.Method.invoke(Method.java:597)
[jwsc] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[jwsc] at org.apache.tools.ant.Task.perform(Task.java:348)
[jwsc] at org.apache.tools.ant.Target.execute(Target.java:390)
[jwsc] at org.apache.tools.ant.Target.performTasks(Target.java:411)
[jwsc] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1397)
[jwsc] at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
[jwsc] at org.apache.tools.ant.Project.executeTargets(Project.java:1249)
[jwsc] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:442)
[jwsc] at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
[jwsc] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
[jwsc] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
[jwsc] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[jwsc] at java.lang.reflect.Method.invoke(Method.java:597)
[jwsc] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[jwsc] at org.apache.tools.ant.Task.perform(Task.java:348)
[jwsc] at org.apache.tools.ant.Target.execute(Target.java:390)
[jwsc] at org.apache.tools.ant.Target.performTasks(Target.java:411)
[jwsc] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1397)
[jwsc] at org.apache.tools.ant.Project.executeTarget(Project.java:1366)
[jwsc] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[jwsc] at org.apache.tools.ant.Project.executeTargets(Project.java:1249)
[jwsc] at org.apache.tools.ant.Main.runBuild(Main.java:801)
[jwsc] at org.apache.tools.ant.Main.startAnt(Main.java:218)
[jwsc] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
[jwsc] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
[AntUtil.deleteDir] Удаление каталога C: \ DOCUME ~ 1 \ KEVIN ~ 1.BRE \ LOCALS ~ 1 \ Temp_5l950r
Цель Ant, использующая задачу <jwsc>
, такова:
<target name="webservice.build" depends="init,generated.root.init">
<path id="jwsc.srcpath">
<path path="${java.sourcepath}" />
<pathelement path="build/assembly/.src" />
</path>
<taskdef name="jwsc" classname="weblogic.wsee.tools.anttasks.JwscTask" >
<classpath>
<path refid="weblogic.jar.classpath" />
</classpath>
</taskdef>
<property name="jwsc.module.root" value="${project.dir}/build/weboutput"/>
<property name="jwsc.contextpath" value="irWeb"/>
<property name="jwsc.srcpath.prop" refid="jwsc.srcpath"/>
<path id="jwsc.classpath">
<path refid="weblogic.jar.classpath" />
<path refid="java.classpath" />
<pathelement path="${java.outpath}" />
</path>
<jwsc destdir="${project.dir}/build" classpathref="jwsc.classpath">
<module name="weboutput" explode="true" contextPath="${jwsc.contextpath}" >
<jwsFileSet srcdir="${webservices.dir}" type="JAXRPC">
<include name="**/*.java"/>
</jwsFileSet>
<descriptor file="${jwsc.module.root}/WEB-INF/web.xml" />
<descriptor file="${jwsc.module.root}/WEB-INF/weblogic.xml" />
</module>
</jwsc>
</target>
Я понятия не имею, что может вызвать компилятор вызвать эту ошибку во время сборки, идень поиска в Google обнаружил другие случаи этой ошибки, вызванной различными триггерами, и решения этих проблем не помогли мне.Я также нашел один отчет на форумах Oracle, который казался точной копией этой проблемы, но ответов не было.
Приложение написано в Weblogic Workshop 10, работает на Weblogic Server 10.3 и используетУлей / NetUI.Не уверен, если это будет иметь значение или нет, хотя.Сценарии сборки были автоматически сгенерированы Weblogic Workshop с некоторыми изменениями и исправлениями, внесенными мной в другие аспекты файлов, чтобы исправить другие проблемы совместимости.Я использую Java 1.6.0_23 от Sun и Ant 1.8.1
Любая помощь или совет будет принята с благодарностью.
~~~ EDIT ~~~ Обновление: я нашел обходной путь для этого, изменив JDK в моей системе с Sun JDK на JRockit JDK, который поставляется с WebLogic.Я думаю, в JRockit есть классы, модифицированные и оптимизированные для WebLogic, по сравнению с классами в Sun JDK.
((Кроме того, я не был уверен, стоит ли добавлять это в правку или ответ, поэтому выбрал правку.Если это неправильное место, прошу прощения.))