Per Web
server plug-in installation doc (step 19), we should copy the
configureweb_server_name.bat
script, generated by
the plugin installer, to the WAS_HOME/bin directory and run it
in order to map the installed applications to the Web server. This was giving us problems on Windows 2003, such as this:
What is happening is twofold. First, theConfiguration save is not complete, exception = com.ibm.ws.scripting.ScriptingException:
WASX7309W: No “save” was performed before the script “D:optWebSphereAppServerbinconfigureWebserverDefinition.jacl” exited; configuration changes will not be saved.
com.ibm.websphere.management.exception.ConfigServiceException:
WKSP0008E RepositoryException while checking the state of
cells/mycell/applications/application.ear/deployments/application/foo.jar/META-INF/ibm-ejb-jar-ext.xmi
in the master repository -com.ibm.ws.sm.workspace.WorkSpaceException:
WKSP0016E Error get digest for cells/mycell/applications/application.ear/deployments/application/foo.jar/META-INF/ibm-ejb-jar-ext.xmi.workspace_save – java.io.IOException: The system cannot find the specified file, either the filename is too long on Windows system or run out of file descriptor on UNIX platform. java.io.FileNotFoundException: D:optWebSphereAppServerprofilesAppSrv01wstempScript10afa2477bfworkspacecellsmycellapplicationsapplication.eardeploymentsapplicationfoo.jarMETA-INFibm-ejb-jar-ext.xmi.workspace_save (The handle is invalid.)
configureWebserverDefinition.jacl
does a save only at the end, which fails for all installed applications. To narrow the problem down, I put $AdminConfig reset
after foreach Application $ApplicationList {
, and moved the
block from the end of the script into theif {[catch {$AdminConfig save} result]} { puts "Configuration save is not complete, exception = $result" } else { puts "Configuration save is complete." }
else
clause of
I think saving this per-application is better, at least for narrowing the problematic apps down, but I suppose it’s a matter of preference… Now we see that all applications except for two are being updated. Without digging into what exactly is special about those two, it’s enough to go to the “Map modules to servers” in WAS console for any other app to see that the JACL script mapped all modules to the web server – including the EJB modules. Not only is that silly and useless, but also is causing “the filename is too long” thing. So we add another condition into theif {[catch {$AdminApp edit $Application [subst {-MapModulesToServers {$targetMapList } } ]} result]} { puts "Target mapping is not updated for the application $Application, exception = $result" } else { puts "Target mapping is updated for the application $Application" ...
configureWebserverDefinition.jacl
to only map Web modules to the web server, bychanging the block where we set
targetMapList
as follows:
The#-------------------------------------------------------------- # Check if web server is already defined as the target #-------------------------------------------------------------- set index [string first $newTarget $currentTargets] set targetMapList "$targetMapList { {$moduleName} $moduleUri $currentTargets }" if {($index < 0) } { set isWebModule [string first ".war,WEB-INF/web.xml" $moduleUri] if {( $isWebModule < 0)} { puts "$moduleUri is not a Web module, skipping..." } else { puts "Will map $moduleUri to $newTarget" set targetMapList "$targetMapList { {$moduleName} $moduleUri $currentTargets+$newTarget }" } }
configureWebserverDefinition.jacl
modified as above is atMisc
module of jSewer project on SourceForge.