首页 > 解决方案 > weblogic-appc 编译器不工作 - WL 12.2.1.4 和 JDK 180_241

问题描述

我们正在将应用程序从 Weblogic 12.2.1.0 升级到 12.2.1.4,同时 JDK 从 180_65 升级到 180_241。使用最新的 JDK 版本和新的 WL 库编译代码时,有一个 EJB 组件会导致问题。早些时候它使用 weblogic-ejbc 作为编译器,现在我将其更改为 weblogic-appc。当使用任务 weblogic-ejbc 时,构建需要很长时间才能执行。

更新的代码片段:

```
    weblogic destdir="${project.build.directory}"
    classpath="${compile_classpath}" rebuild="false" ejbcclass="weblogic.appc"                                          keepgenerated="false"                                           outputdir="${project.build.outputDirectory}/ejb" 
```

```
    weblogic destdir="${project.build.directory}"
    classpath="${compile_classpath}" rebuild="false" ejbcclass="weblogic.ejbc"                                          keepgenerated="false"                                           outputdir="${project.build.outputDirectory}/ejb" 
**Build Error:**

Usage: java weblogic.appc [options] <ear, jar,, war or rar file or directory>
15:20:51      [ejbc] 
15:20:51      [ejbc] where options include:
15:20:51      [ejbc]     -help             Print the standard usage message.            
15:20:51      [ejbc]     -version          Print version information.                   
15:20:51      [ejbc]     -output <file>    Specifies an alternate output archive or     
15:20:51      [ejbc]                       directory.  If not set, output will be       
15:20:51      [ejbc]                       placed in the source archive or directory.   
15:20:51      [ejbc]     -plan <file>      Specifies an optional deployment plan.       
15:20:51      [ejbc]     -forceGeneration  Force generation of EJB and JSP classes.     
15:20:51      [ejbc]                       Without this flag the classes may not be     
15:20:51      [ejbc]                       regenerated if it is determined to be        
15:20:51      [ejbc]                       unnecessary.                                 
15:20:51      [ejbc]     -quiet            Turns off output except for errors           
15:20:51      [ejbc]     -lineNumbers      Add JSP line numbers to generated class      
15:20:51      [ejbc]                       files to aid in debugging.                   
15:20:51      [ejbc]     -library <file>   Comma-separated list of libraries. Each      
15:20:51      [ejbc]                       library may optionally set its name and      
15:20:51      [ejbc]                       versions, if not already set in its          
15:20:51      [ejbc]                       manifest, using the following syntax: <file> 
15:20:51      [ejbc]                       [@name=<string>@libspecver=<version>         
15:20:51      [ejbc]                       @libimplver=<version|string>]                
15:20:51      [ejbc]     -librarydir <dir> Registers all files in specified directory   
15:20:51      [ejbc]                       as libraries.                                
15:20:51      [ejbc]     -writeInferredDescriptors Write out the descriptors with inferred    
15:20:51      [ejbc]                       information including annotations.           
15:20:51      [ejbc]     -manifest <file>  Include manifest information from specified  
15:20:51      [ejbc]                       manifest file.                               
15:20:51      [ejbc]     -clientJarOutputDir <dir> Specifies a directory to put generated     
15:20:51      [ejbc]                       client jars.                                 
15:20:51      [ejbc]     -keepgenerated    Keep the generated .java files.              
15:20:51      [ejbc]     -verbose          Compile with verbose output.                 
15:20:51      [ejbc]     -classpath <path> Classpath to use.                            
15:20:51      [ejbc]     -source <source>  Source version.                              
15:20:51      [ejbc]     -target <target>  Target version.                              
15:20:51      [ejbc]     -advanced         Print advanced usage options.                
15:20:51      [ejbc] 
15:20:51      [ejbc] <Jul 10, 2020 3:20:51 PM EDT> <Error> <J2EE> <BEA-160187> <weblogic.appc failed to compile the application. Recompile with the -verbose option for more details about the issue.> 
15:20:51      [ejbc] weblogic.utils.compiler.ToolFailureException: [J2EE:160128]ERROR: Incorrect appc command. Too many arguments were given. The appc command only takes a single argument, the source file, in addition to the supported options.
15:20:51      [ejbc]    at weblogic.application.compiler.flow.PrepareInputFlow.prepareInput(PrepareInputFlow.java:65)
15:20:51      [ejbc]    at weblogic.application.compiler.flow.PrepareInputFlow.compile(PrepareInputFlow.java:43)
15:20:51      [ejbc]    at weblogic.application.compiler.FlowDriver$FlowStateChange.next(FlowDriver.java:70)
15:20:51      [ejbc]    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
15:20:51      [ejbc]    at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:37)
15:20:51      [ejbc]    at weblogic.application.compiler.FlowDriver.run(FlowDriver.java:27)
15:20:51      [ejbc]    at weblogic.application.compiler.Appc.runBody(Appc.java:202)
15:20:51      [ejbc]    at weblogic.utils.compiler.Tool.run(Tool.java:159)
15:20:51      [ejbc]    at weblogic.utils.compiler.Tool.run(Tool.java:116)
15:20:51      [ejbc]    at weblogic.application.compiler.Appc.main(Appc.java:261)
15:20:51      [ejbc]    at weblogic.appc.main(appc.java:14)
15:20:51      [ejbc] [J2EE:160128]ERROR: Incorrect appc command. Too many arguments were given. The appc command only takes a single argument, the source file, in addition to the supported options. 

Could some please help me with the correct syntax for WEBLOGIC-APPC task

标签: java-8compiler-errorsejbweblogic12c

解决方案


推荐阅读