将包含EJB和EJBClient的EAR部署到websphere时出错

时间:2015-02-20 21:33:45

标签: eclipse java-ee-6 ejb-3.1 websphere-8

我们正在使用websphere应用程序遇到一种奇怪的情况。

我们使用websphere 8.5服务器在Eclipse Juno中开发了这个应用程序。它是一个JSF 2.0应用程序。它还定义了EJBTimer。在本地测试此应用程序时,它可以正常运行JSF页面,并且EJBTimer也可以按预期工作。

  • 当我们使用常规构建过程构建应用程序时 - 从clearcase中提取代码并执行ANT构建 应用程序已部署,但抱怨找不到的方法 ejb的本地接口。当我们检查构建的EAR时,该方法 是否在界面中。
  • 当我们尝试将其导出为导出时 - > EAR并部署了EAR 在我们的开发服务器上,我们得到以下错误。 Rememebr, 相同的代码适用于本地Windows环境。我们也查过了 所有项目的编译器版本 - web,ejb,ejbclient和 所有这些都是Java 1.7。还有什么我们需要看的吗?

    [*Error] ejbModule/com/abc/appname/service/ProcessDailyFeed.java(54): Multi-catch parameters are not allowed for source level below 1.7
    [*Error] ejbModule/com/abc/appname/scheduledBean/ScheduledBean.java(68): Multi-catch parameters are not allowed for source level below 1.7
    

更新

错误部署的输出

=== wasd8100Cell:Deploy Failed ===
=== Check http://serverabc:12345/Deployment_EAR_log for detail ===

Submitted By: b3601
    ------ Deploying Application -----------
    Ear File: myApp_dev_1.ear
    App Name: myApp
    Install Type: UPDATE
    Target: ('srv01_cluster', '')
    Target Http: ('https-web01', 'wasd8101')('https-web01', '')('https-web01', 'wasd8104')
    Modified Target Http: ('https-web01', 'wasd8101')('https-web01', 'wasd8104')
    Copy ear file from nfs to local filesystem /opt/local/software/abcnstalledApps/tmp/myApp_dev_1.ear - 1.0s
    Virtual Host: default_host
    (Module, URI): ('MyAppEJB', 'MyAppEJB.jar,META-INF/ejb-jar.xml')('MyAppWeb', 'MyAppWeb.war,WEB-INF/web.xml')
Bean: OracleDatabaseAccess
Bean: JPAReasonManager
Bean: JpaHistoryManager
Bean: JpaHistoryManager
Bean: ProcessDailyFeed
Bean: AccessExternal
Bean: MyAppService
Bean: ScheduledUpdateDatabase
Bean: ScheduledBean
Bean: StartUp
Bean: OracleDatabaseAccess
Bean: JPAReasonManager
Bean: JpaHistoryManager
Bean: ProcessDailyFeed
Bean: AccessExternal
Bean: MyAppService
Bean: ScheduledUpdateDatabase
Bean: ScheduledBean
Bean: StartUp
EJBDeploy = true

Run ejbdeploy.sh : /opt/local/software/websphere/v8/bin/ejbdeploy.sh -cp /ora01/oracle/product/was8/jdbc/lib/ojdbc6.jar /opt/local/software/abcnstalledApps/tmp/myApp_dev_1.ear /opt/local/software/abcnstalledApps/tmp /opt/local/software/abcnstalledApps/tmp/myApp_dev_1.ear_ejb.ear -quiet > /opt/local/software/abcnstalledApps/tmp/myApp.out
using JVM heap -Xms1024m -Xmx2048m
EJB Deploy configuration directory: /opt/local/software/websphere/v8/profiles/dmgr01/ejbdeploy/configuration/
framework search path: /opt/local/software/websphere/v8/deploytool/itp/plugins
build:RAD851-I20121103_1921
[*Error] ejbModule/com/abc/productivity/service/ProcessDailyFeed.java(54): Multi-catch parameters are not allowed for source level below 1.7
[*Error] ejbModule/com/abc/productivity/scheduledBean/ScheduledBean.java(68): Multi-catch parameters are not allowed for source level below 1.7
[*Warning] ejbModule/com/abc/productivity/scheduledBean/ScheduledBean.java(80): Type safety: Unchecked cast from List to List<ProgramProductivityHistory>
[*Warning] ejbModule/com/abc/productivity/scheduledBean/ScheduledBean.java(167): Type safety: Unchecked cast from List to List<ProgramProductivityHistory>
[*Warning] ejbModule/com/abc/productivity/dao/JpaHistoryManager.java(67): Type safety: Unchecked cast from List to List<ProgramProductivityHistory>
[*Warning] ejbModule/com/abc/productivity/dao/JpaHistoryManager.java(110): Type safety: Unchecked cast from List to List<Long>
[*Warning] ejbModule/com/abc/productivity/dao/JpaHistoryManager.java(121): Type safety: Unchecked cast from List to List<ProgramProductivity>
[*Warning] ejbModule/com/abc/productivity/dao/JpaHistoryManager.java(160): Type safety: Unchecked cast from List to List<ProgramProductivityHistory>
[*Warning] ejbModule/com/abc/productivity/dao/JpaHistoryManager.java(217): Type safety: Unchecked cast from List to List<ProgramProductivityHistory>
[*Warning] ejbModule/com/abc/productivity/dao/JpaHistoryManager.java(267): Type safety: Unchecked cast from List to List<ProgramProductivityHistory>
[*Warning] ejbModule/com/abc/productivity/dao/JpaHistoryManager.java(292): Type safety: Unchecked cast from List to List<ProgramProductivityHistory>
[*Warning] ejbModule/com/abc/productivity/dao/JpaHistoryManager.java(314): Type safety: Unchecked cast from List to List<String>
[*Warning] ejbModule/com/abc/productivity/dao/JpaHistoryManager.java(348): Type safety: Unchecked cast from List to List<ProgramProductivityHistory>
[*Warning] ejbModule/com/abc/productivity/dao/JpaHistoryManager.java(372): Type safety: Unchecked cast from List to List<ProgramProductivity>
[*Warning] ejbModule/com/abc/productivity/dao/JpaHistoryManager.java(375): Type safety: Unchecked cast from List to List<ProgramProductivityHistory>
[*Warning] ejbModule/com/abc/productivity/dao/JpaHistoryManager.java(408): Type safety: Unchecked cast from List to List<ProgramProductivityHistory>
[*Warning] ejbModule/com/abc/productivity/dao/JPAReasonManager.java(97): Type safety: Unchecked cast from List to List<String>
[*Warning] ejbModule/com/abc/productivity/dao/JPAReasonManager.java(207): Type safety: Unchecked cast from List to List<EmergencyReason>
Execution Halted: Compilation Errors Reported
2 Errors, 16 Warnings, 0 Informational Messages

Deploy EJB ear file from /opt/local/software/abcnstalledApps/tmp/myApp_dev_1.ear_ejb.ear

*** Invoke AdminApp Install *** 2015-02-20 07:25:00

AdminApp.install (/opt/local/software/abcnstalledApps/tmp/myApp_dev_1.ear_ejb.ear,[ -appname myApp -installed.ear.destination /opt/local/software/abcnstalledApps/myApp -MapModulesToServers [["MyAppEJB" MyAppEJB.jar,META-INF/ejb-jar.xml WebSphere:cell=wasd8100Cell,cluster=srv01_cluster]["MyAppWeb" MyAppWeb.war,WEB-INF/web.xml WebSphere:cell=wasd8100Cell,cluster=srv01_cluster+WebSphere:cell=wasd8100Cell,node=wasd8101,server=https-web01+WebSphere:cell=wasd8100Cell,node=wasd8104,server=https-web01]] -MapWebModToVH [["MyAppWeb" MyAppWeb.war,WEB-INF/web.xml default_host]] -update  -usedefaultbindings -defaultbinding.ejbjndi.prefix ejb -defaultbinding.virtual.host default_host -nopreCompileJSPs -distributeApp -nouseMetaDataFromBinary -createMBeansForResources -noreloadEnabled -nodeployws -validateinstall off -noprocessEmbeddedConfig -nodeployejb -filepermission .*\.dll=755#.*\.so=755#.*\.a=755#.*\.sl=755 -noallowDispatchRemoteInclude -noallowServiceRemoteInclude -asyncRequestDispatchType DISABLED -nouseAutoLink ])

=== deployEntApps with Exception === 2015-02-20 07:25:00
Traceback (most recent call last):


File "/opt/softdepot/abcinst/was8scripts/abcUtils.py", line 2556, in deployEntApps
    installResults = AdminApp.install(installableEar,installOptions)
com.ibm.ws.scripting.ScriptingException: com.ibm.ws.scripting.ScriptingException: WASX7115E: Cannot read input file "/opt/local/software/abcnstalledApps/tmp/myApp_dev_1.ear_ejb.ear"

良好部署的输出

=== wasd8100Cell:Deploy Successful ===

Submitted By: b3601
    ------ Deploying Application -----------
    Ear File: myApp_dev_31.ear
    App Name: myApp
    Install Type: UPDATE
    Target: ('srv01_cluster', '')
    Target Http: ('https-web01', 'wasd8101')('https-web01', '')('https-web01', 'wasd8104')
    Modified Target Http: ('https-web01', 'wasd8101')('https-web01', 'wasd8104')
    Copy ear file from nfs to local filesystem /opt/local/software/abcnstalledApps/tmp/myApp_dev_31.ear - 0.0s
    Virtual Host: default_host
    (Module, URI): ('MyAppEJB', 'MyAppEJB.jar,META-INF/ejb-jar.xml')('MyAppWeb', 'MyAppWeb.war,WEB-INF/web.xml')

    Bean: OracleDatabaseAccess
    Bean: JPAReasonManager
    Bean: JpaHistoryManager
    Bean: JpaHistoryManager
    Bean: ProcessDailyFeed
    Bean: AccessExternal
    Bean: MyAppService
    Bean: ScheduledUpdateDatabase
    Bean: ScheduledBean
    Bean: StartUp
    Bean: OracleDatabaseAccess
    Bean: JPAReasonManager
    Bean: JpaHistoryManager
    Bean: ProcessDailyFeed
    Bean: AccessExternal
    Bean: MyAppService
    Bean: ScheduledUpdateDatabase
    Bean: ScheduledBean
    Bean: StartUp
    EJBDeploy = true

    Run ejbdeploy.sh : /opt/local/software/websphere/v8/bin/ejbdeploy.sh -cp /ora01/oracle/product/was8/jdbc/lib/ojdbc6.jar /opt/local/software/abcnstalledApps/tmp/myApp_dev_31.ear /opt/local/software/abcnstalledApps/tmp /opt/local/software/abcnstalledApps/tmp/myApp_dev_31.ear_ejb.ear -quiet > /opt/local/software/abcnstalledApps/tmp/myApp.out
    using JVM heap -Xms1024m -Xmx2048m
    EJB Deploy configuration directory: /opt/local/software/websphere/v8/profiles/dmgr01/ejbdeploy/configuration/
    framework search path: /opt/local/software/websphere/v8/deploytool/itp/plugins
    build:RAD851-I20121103_1921
    0 Errors, 0 Warnings, 0 Informational Messages

    Deploy EJB ear file from /opt/local/software/abcnstalledApps/tmp/myApp_dev_31.ear_ejb.ear

    *** Invoke AdminApp Install *** 2015-02-20 07:28:48

    AdminApp.install (/opt/local/software/abcnstalledApps/tmp/myApp_dev_31.ear_ejb.ear,[ -appname myApp -installed.ear.destination /opt/local/software/abcnstalledApps/myApp -MapModulesToServers [["MyAppEJB" MyAppEJB.jar,META-INF/ejb-jar.xml WebSphere:cell=wasd8100Cell,cluster=srv01_cluster]["MyAppWeb" MyAppWeb.war,WEB-INF/web.xml WebSphere:cell=wasd8100Cell,cluster=srv01_cluster+WebSphere:cell=wasd8100Cell,node=wasd8101,server=https-web01+WebSphere:cell=wasd8100Cell,node=wasd8104,server=https-web01]] -MapWebModToVH [["MyAppWeb" MyAppWeb.war,WEB-INF/web.xml default_host]] -update  -usedefaultbindings -defaultbinding.ejbjndi.prefix ejb -defaultbinding.virtual.host default_host -nopreCompileJSPs -distributeApp -nouseMetaDataFromBinary -createMBeansForResources -noreloadEnabled -nodeployws -validateinstall off -noprocessEmbeddedConfig -nodeployejb -filepermission .*\.dll=755#.*\.so=755#.*\.a=755#.*\.sl=755 -noallowDispatchRemoteInclude -noallowServiceRemoteInclude -asyncRequestDispatchType DISABLED -nouseAutoLink ])
    *** AdminApp Install Complete *** 2015-02-20 07:28:56

    Deployed Location : /opt/local/software/abcnstalledApps/myApp/myApp.ear
    Class Loader Policy : MULTIPLE (SINGLE=Application,MULTIPLE=Module)
    Class Loader Mode : PARENT_FIRST

    *** Saving the deployemnt *** 2015-02-20 07:28:56

    Old Context Root: myApp
    New Context Root: myApp
    Same Context root, no need to genPlugin

    *** Generate docs cache deployment request **** 2015-02-20 07:29:00

    Duration: 44.0s

    *** It may take up to 5-10 minutes for the ear file completely written to each node. Please have a nice coffee break:-)
    *** Check http://serverabc:12345/Deployment_EAR_log for detail.

1 个答案:

答案 0 :(得分:0)

现在有点清楚了。错误发生在ejbdeploy调用期间。首先,如果您的应用程序使用的是ejb 3.x,则不需要调用ejbdeploy(只有较旧的应用程序才需要它,因此您可以安全地从3.x脚本中删除该调用)。其次,我将比较来自两个EAR的application.xmlejb-jar.xml文件 - 由构建脚本生成的文件和由Eclipse创建的文件。 ejbdeploy使用complianceLevel,请参阅更多here

  -complianceLevel X   Set the JDK level X for compiler compliance to one of: 1.4(default), 5.0, 6.0, 7.0

使用以下规则计算:

  

如果ejbdeploy命令的-complianceLevel选项不是   在以下任何一种情况下指定默认的-complianceLevel   设置是Java开发人员工具包V5.0,“5.0”:

     
      
  • 包含Java EE 5(或更高版本)或EJB 3.0(或更高版本)部署描述符文件的EAR或JAR文件
  •   
  • 没有任何部署描述符文件的EAR文件
  •   
     

在所有其他情况下,-complianceLevel设置默认为Java   开发人员工具包V1.4,“1.4”

所以我想说你的Eclipse导出可能有描述符,它改变了complianceLevel

尝试添加到您的ejbdeploy调用标记-complianceLevel "7.0"