Update ear in web sphere from command line

旧巷老猫 提交于 2019-12-12 14:24:25

问题


I have developed an java ear that i deploy from my local eclipse to my local websphere 8.5 by using the publish button in eclipse. When I try to deploy my ear from command line I get an error after I try to access the webpage.

I update my ear from common line like this: ${was.dir}/profiles/${was.profile}/bin/wsadmin.sh -lang jython -username ${was.username} -password ${was.password} -c AdminApplication.updateApplicationUsingDefaultMerge('${was.app.name}', '${build.dir}/${ear.name}')

The deployment is successful but when I access my application thru my web browser I get the following message instead of seeing my application:

Error 404: com.ibm.ws.webcontainer.servlet.exception.NoTargetForURIException: No target servlet configured for uri: /wwww/index.html

I have verified that the ear is ok by updating it thru the web admin interface of websphere without any configuration.

What am I doing wrong or what additional steps do I need to do to successfully update my ear?


回答1:


You are using wrong command. You should use something like this:

AdminApp.update('MyAppEAR', 'app', '[ -operation update -contents MyApp.ear -nopreCompileJSPs -installed.ear.destination C:\WAS\MyAppEAR -nodistributeApp -useMetaDataFromBinary -nodeployejb -createMBeansForResources -noreloadEnabled -nodeployws -validateinstall warn -noprocessEmbeddedConfig -filepermission ..dll=755#..so=755#..a=755#..sl=755 -noallowDispatchRemoteInclude -noallowServiceRemoteInclude -asyncRequestDispatchType DISABLED -nouseAutoLink -noenableClientModule -clientMode isolated -novalidateSchema -MapModulesToServers [[ MyApp MyApp.war,WEB-INF/web.xml WebSphere:cell=Node02Cell,node=Node02,server=server1 ]]]' )

Also, in WebSphere Application Server you can log every command you issue through Administrative Console.

Steps

  1. login to admin console with administrative user (e.g. wasadmin)
  2. click "System Administration" -> "Console Preferences"
  3. check "Enable command assistance notifications" and "Log command assistance commands"
  4. click Apply button to save changes

You can see commands in help portlet on the upper-right side of admin console:

If you checked "Log command assistance commands", you can also see jython commands in a log file "<WAS_HOME>\profiles\<PROFILE_NAME>\logs\server1\commandAssistanceJythonCommands.log"




回答2:


I'm not sure about updateApplicationUsingDefaultMerge vs update (the latter is what I use), but don't forget you also have to AdminConfig.save() after you're finished.



来源:https://stackoverflow.com/questions/23882128/update-ear-in-web-sphere-from-command-line

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!