What is Workspace:
Whenever a user logs into the administrative console, or
uses wsadmin scripting to make a configuration change, the changes are
stored in the workspace. When a user uses the ConfigService
configuration service interface of the Java application programming
interfaces (APIs), the user specifies a session object that is
associated with the workspace in order to store the changes. Only when
the user performs a save operation under the administrative console,
wsadmin scripting, or the Java APIs are the changes propagated and
merged with the master configuration repository.
For each administrative console user or each invocation of
wsadmin scripting, the application server creates a separate workspace
directory to store the intermediate changes until the changes are merged
with the master configuration repository. Users of the Java APIs use
different session objects to decide where the workspace directory
resides. Both the administrative console and wsadmin scripting generate
user IDs randomly. The user IDs are different from the user IDs that you
use to log into the administrative console or wsadmin scripting. The
Java APIs can either randomly generate the user ID or specify the user
ID as an option when creating the session object.
Workspace keeps track of context and file states whenever a caller does an add / delete / extract / update using Workspace APIs.
Default wstemp directory location: %use r.in stal l.ro ot%\ wste mp \
where %user.install.root% is %WAS _HOM E%\p rofi les\ <pro file name>\
where %user.install.root% is %WAS
Changeable by setting following JVM custom property:
UNIX platform:
-Dwe bsph ere. work spac e.ro ot=/ tem p
Windows platform:
-Dwe bsph ere. work spac e.ro ot=c :\te m p
Windows platform:
Change the JVM custom property through the
administrative console by setting the JVM property as a name-value pair
on the Custom properties page.
For example,
For example,
Under Console > Click System
Administration > Deployment manager > Java and Process Management
> Process definition > Java Virtual Machine > Custom
properties.
Workspace directory location
%use r.in stal l.ro ot%\ wste mp\< user id>\workspace\
%web sphe re.w orks pace .roo t%\w stem p\<u ser id>\workspace\
%use
%web
Workspace generates the following files to keep track of the status of workspace, context and file:
WorkSpace State
- “.wo
rksp ace_ ”<se ssio n id>
Under %use r.in stal l.ro ot%\ wste mp\< user id>\workspace directory to distinguish which session of the user works on the workspace.
This file contains a runtime call stack information from Work Spac eMan ager Impl .cre ateW orkS pace (Pro pert ies)
Context State
- ".re
posi tory Cont ext “
Under each <context
type>\<context name> subdirectory of workspace, keep the status
of the files being accessed.
File State
- <File Name>".copy": keep the digest of the file being extracted.
- <File Name>".current": keep the original copy of the file if merge is needed for this document. Only serverIndex.xml will be merged at this time.
Directory types generated under wstemp folder
- Script*: created by a wsadmin script;
- anonymous*: created by client that pass a null workspace/session id.
- -NNNNNNNNN: created by Admin Console
It is the responsibility of the caller to remove
the workspace session. It is better that the caller creates a session
and then discards the session when finished. Each workspace is
associated with a session object.
1. Session()
This one always creates a new unique session. The id of the session will be anon
Session session = new Session();
conf igSe rvic e.re solv e(se ssio n, "Cell=");
So, every time a new session object is created this way and used, a new unique workspace directory will be created. Therefore, these workspaces should be removed by calling conf
2. Session(id, resuse)
This one creates a new session based on the supplied id. If there is already a workspace created for that id, the same workspace will be used. However, it is not true if the reuse flag is set to false. If the reuse flag is set to false, a new session with id+c
- The following two lines will result in creation of a new workspace if the corresponding workspace directory does not exist:
Session session = new Sess ion( "myW orks pace ", true);
conf igSe rvic e.re solv e(se ssio n, "Cell=");
conf
The workspace must be removed by calling workspace.remove() or conf igse rvic e.di scar d(se ssio n).
- The following two lines will result in creation of a new unique workspace
Session session = new Sess ion( "myW orks pace ", false);
conf igSe rvic e.re solv e(se ssio n, "Cell=");
Note: Every time a session object is created this way, it results in a new unique workspace. Therefore, all the workspaces created this way should be removed. If the caller code is not discarding the session it created, then the size of the wstemp folder will grow and eventually it can cause an OOM (out of memory) condition of dmgr or server depending on your setup.
One can turn on the following trace string either on
deployment manager (or) on base application server depending on the type
of setup to review the caller creating the workspace:
Current trace specification = *=in fo:c om.i bm.w s.sm .wor kspa ce.i mpl. Work Spac eMan ager Impl =all
With above trace string is enabled one can see following logging in the trace.log file:
In the example, I used the case "anonymous*: created by client that pass a null workspace/session id"
[5/9/14 9:00:15:241 NZST] 00000001 WorkSpaceMana > getWorkSpace, UserID: anon ymou s139 9582 8152 40, SessionID: null, create workspace if not found: true Entry
[5/9/14 9:00:15:241 NZST] 00000001 WorkSpaceMana 3 Call stack info of crea teWo rkSp ace( prop ), workspace id anon ymou s139 9582 8152 40:
[5/9/14 9:00:15:241 NZST] 00000001 WorkSpaceMana 3 Call stack info of crea
<----- new workspace anon ymou s139 9582 8152 40 is created ----->
com. ibm. ws.s m.wo rksp ace. impl .Wor kSpa ceMa nage rImp l.ge tCal lSta ck(W orkS pace Mana gerI mpl. java :591 )
com. ibm. ws.s m.wo rksp ace. impl .Wor kSpa ceMa nage rImp l.cr eate Work Spac e(Wo rkSp aceM anag erIm pl.j ava: 148)
com. ibm. ws.s m.wo rksp ace. impl .Wor kSpa ceMa nage rImp l.ge tWor kSpa ce(W orkS pace Mana gerI mpl. java :304 )
com. ibm. ws.s m.wo rksp ace. impl .Wor kSpa ceMa nage rImp l.ge tWor kSpa ce(W orkS pace Mana gerI mpl. java :241 )
com. ibm. ws.s m.wo rksp ace. impl .Wor kSpa ceMa nage rImp l.ge tWor kSpa ce(W orkS pace Mana gerI mpl. java :230 )
com. ibm. ws.m anag emen t.co nfig serv ice. Work spac eHel per. getW orks pace (Wor kspa ceHe lper .jav a:10 0)
com. ibm. ws.m anag emen t.co nfig serv ice. Work spac eHel per. getS cope Cont exts (Wor kspa ceHe lper .jav a:34 4)
com. ibm. ws.m anag emen t.co nfig serv ice. Root Obje ctDe lega tor. getA ll(R ootO bjec tDel egat or.j ava: 118)
com. ibm. ws.m anag emen t.co nfig serv ice. Conf igSe rvic eImp l.qu eryC onfi gObj ects (Con figS ervi ceIm pl.j ava: 948)
com. ibm. ws.m anag emen t.co nfig serv ice. Conf igSe rvic eImp l.re solv e(Co nfig Serv iceI mpl. java :108 3)
com. ibm. ws.m anag emen t.co nfig serv ice. Conf igSe rvic eImp l.re solv e(Co nfig Serv iceI mpl. java :104 3)
com. ibm. bpmc ommo n.up grad e.da taba se.V alid ateD atab aseV ersi on.g etCl uste r(Va lida teDa taba seVe rsio n.ja va:2 26)
com. ibm. bpmc ommo n.up grad e.da taba se.V alid ateD atab aseV ersi on.v erif ySta ndar dDB4 ND(V alid ateD atab aseV ersi on.j ava: 199)
com. ibm. bpmc ommo n.up grad e.da taba se.V alid ateD atab aseV ersi on.s tart (Val idat eDat abas eVer sion .jav a:12 0)
com. ibm. ws.r unti me.c ompo nent .Con tain erHe lper .sta rtCo mpon ents (Con tain erHe lper .jav a:53 9)
com. ibm. ws.r unti me.c ompo nent .Con tain erIm pl.s tart Comp onen ts(C onta iner Impl .jav a:62 7)
com. ibm. ws.r unti me.c ompo nent .Con tain erIm pl.s tart (Con tain erIm pl.j ava: 618)
com. ibm. ws.r unti me.c ompo nent .App lica tion Serv erIm pl.s tart (App lica tion Serv erIm pl.j ava: 252)
com. ibm. ws.r unti me.c ompo nent .Con tain erHe lper .sta rtCo mpon ents (Con tain erHe lper .jav a:53 9)
com. ibm. ws.r unti me.c ompo nent .Con tain erIm pl.s tart Comp onen ts(C onta iner Impl .jav a:62 7)
com. ibm. ws.r unti me.c ompo nent .Con tain erIm pl.s tart (Con tain erIm pl.j ava: 618)
com. ibm. ws.r unti me.c ompo nent .Ser verI mpl. star t(Se rver Impl .jav a:52 3)
com. ibm. ws.r unti me.W sSer verI mpl. boot Serv erCo ntai ner( WsSe rver Impl .jav a:31 0)
com. ibm. ws.r unti me.W sSer verI mpl. star t(Ws Serv erIm pl.j ava: 223)
com. ibm. ws.r unti me.W sSer verI mpl. main (WsS erve rImp l.ja va:6 86)
com. ibm. ws.r unti me.W sSer ver. main (WsS erve r.ja va:5 9)
sun. refl ect. Nati veMe thod Acce ssor Impl .inv oke0 (Nat ive Method)
sun. refl ect. Nati veMe thod Acce ssor Impl .inv oke( Nati veMe thod Acce ssor Impl .jav a:60 )
sun. refl ect. Dele gati ngMe thod Acce ssor Impl .inv oke( Dele gati ngMe thod Acce ssor Impl .jav a:37 )
java .lan g.re flec t.Me thod .inv oke( Meth od.j ava: 611)
com. ibm. wssp i.bo otst rap. WSLa unch er.l aunc hMai n(WS Laun cher .jav a:23 4)
com. ibm. wssp i.bo otst rap. WSLa unch er.m ain( WSLa unch er.j ava: 96)
com. ibm. wssp i.bo otst rap. WSLa unch er.r un(W SLau nche r.ja va:7 7)
sun. refl ect. Nati veMe thod Acce ssor Impl .inv oke0 (Nat ive Method)
sun. refl ect. Nati veMe thod Acce ssor Impl .inv oke( Nati veMe thod Acce ssor Impl .jav a:60 )
sun. refl ect. Dele gati ngMe thod Acce ssor Impl .inv oke( Dele gati ngMe thod Acce ssor Impl .jav a:37 )
java .lan g.re flec t.Me thod .inv oke( Meth od.j ava: 611)
org. ecli pse. equi nox. inte rnal .app .Ecl ipse AppC onta iner .cal lMet hodW ithE xcep tion (Ecl ipse AppC onta iner .jav a:58 7)
org. ecli pse. equi nox. inte rnal .app .Ecl ipse AppH andl e.ru n(Ec lips eApp Hand le.j ava: 198)
org. ecli pse. core .run time .int erna l.ad apto r.Ec lips eApp Laun cher .run Appl icat ion( Ecli pseA ppLa unch er.j ava: 110)
org. ecli pse. core .run time .int erna l.ad apto r.Ec lips eApp Laun cher .sta rt(E clip seAp pLau nche r.ja va:7 9)
org. ecli pse. core .run time .ada ptor .Ecl ipse Star ter. run( Ecli pseS tart er.j ava: 369)
org. ecli pse. core .run time .ada ptor .Ecl ipse Star ter. run( Ecli pseS tart er.j ava: 179)
sun. refl ect. Nati veMe thod Acce ssor Impl .inv oke0 (Nat ive Method)
sun. refl ect. Nati veMe thod Acce ssor Impl .inv oke( Nati veMe thod Acce ssor Impl .jav a:60 )
sun. refl ect. Dele gati ngMe thod Acce ssor Impl .inv oke( Dele gati ngMe thod Acce ssor Impl .jav a:37 )
java .lan g.re flec t.Me thod .inv oke( Meth od.j ava: 611)
org. ecli pse. core .lau nche r.Ma in.i nvok eFra mewo rk(M ain. java :340 )
org. ecli pse. core .lau nche r.Ma in.b asic Run( Main .jav a:28 2)
org. ecli pse. core .lau nche r.Ma in.r un(M ain. java :981 )
com. ibm. wssp i.bo otst rap. WSPr eLau nche r.la unch Ecli pse( WSPr eLau nche r.ja va:3 80)
com. ibm. wssp i.bo otst rap. WSPr eLau nche r.ma in(W SPre Laun cher .jav a:15 1)
com.
com.
com.
com.
com.
com.
com.
com.
com.
com.
com.
com.
com.
com.
com.
com.
com.
com.
com.
com.
com.
com.
com.
com.
com.
sun.
sun.
sun.
java
com.
com.
com.
sun.
sun.
sun.
java
org.
org.
org.
org.
org.
org.
sun.
sun.
sun.
java
org.
org.
org.
com.
com.
[5/9/14 9:00:15:254 NZST] 00000001 WorkSpaceMana 3 Create workspace [Wor kSpa ceMa nage rImp l.cr eate Work Spac e(pr op)] ...
WorkspaceUserPath: /u01 /app /dev /d4/ bpm/ node 1/ws temp /ano nymo us13 9958 2815 240
WorkspacePath ...: /u01 /app /dev /d4/ bpm/ node 1/ws temp /ano nymo us13 9958 2815 240/ work spac e
repositoryAdapter: com. ibm. ws.s m.wo rksp ace. impl .Wor kSpa ceMa ster Repo sito ryAd apte r
[5/9/14 9:00:15:254 NZST] 00000001 WorkSpaceMana 3 getClassOfType, className: com. ibm. ws.s m.wo rksp ace. impl .Wor kSpa ceMa ster Repo sito ryAd apte r
[5/9/14 9:00:15:255 NZST] 00000001 WorkSpaceMana 3 profileKey
<null>
[5/9/14 9:00:15:258 NZST] 00000001 WorkSpaceMana A WKSP0500I: Workspace configuration consistency check is disabled.
[5/9/14 9:00:15:287 NZST] 00000001 WorkSpaceMana < getWorkSpace, WS: com. ibm. ws.s m.wo rksp ace. impl .Wor kSpa ceIm pl@e 332d 7a3 Exit
[5/9/14 9:00:15:299 NZST] 00000001 WorkSpaceMana > getWorkSpace, UserID: anon ymou s139 9582 8152 40, SessionID: null, create workspace if not found: true Entry
[5/9/14 9:00:15:299 NZST] 00000001 WorkSpaceMana 3 The same sessionId share the same WorkSpace.
[5/9/14 9:00:15:300 NZST] 00000001 WorkSpaceMana < getWorkSpace, WS: com. ibm. ws.s m.wo rksp ace. impl .Wor kSpa ceIm pl@e 332d 7a3 Exit
[5/9/14 9:00:15:328 NZST] 00000001 WorkSpaceMana > getWorkSpace, UserID: anon ymou s139 9582 8152 40, SessionID: null, create workspace if not found: true Entry
[5/9/14 9:00:15:328 NZST] 00000001 WorkSpaceMana 3 The same sessionId share the same WorkSpace.
[5/9/14 9:00:15:329 NZST] 00000001 WorkSpaceMana < getWorkSpace, WS: com. ibm. ws.s m.wo rksp ace. impl .Wor kSpa ceIm pl@e 332d 7a3 Exit
[5/9/14 9:00:15:330 NZST] 00000001 WorkSpaceMana > getWorkSpace, UserID: anon ymou s139 9582 8152 40, SessionID: null, create workspace if not found: true Entry
[5/9/14 9:00:15:330 NZST] 00000001 WorkSpaceMana 3 The same sessionId share the same WorkSpace.
[5/9/14 9:00:15:330 NZST] 00000001 WorkSpaceMana < getWorkSpace, WS: com. ibm. ws.s m.wo rksp ace. impl .Wor kSpa ceIm pl@e 332d 7a3 Exit
[5/9/14 9:00:15:451 NZST] 00000001 WorkSpaceMana > getWorkSpace, UserID: anon ymou s139 9582 8152 40, SessionID: null, create workspace if not found: true Entry
[5/9/14 9:00:15:458 NZST] 00000001 WorkSpaceMana 3 The same sessionId share the same WorkSpace.
[5/9/14 9:00:15:459 NZST] 00000001 WorkSpaceMana < getWorkSpace, WS: com. ibm. ws.s m.wo rksp ace. impl .Wor kSpa ceIm pl@e 332d 7a3 Exit
[5/9/14 9:00:15:472 NZST] 00000001 WorkSpaceMana 3 removeWorkSpace, UserID: anon ymou s139 9582 8152 40, SessionID: nullCall stack info of remo veWo rkSp ace( stri ng, string):
WorkspaceUserPath: /u01
WorkspacePath ...: /u01
repositoryAdapter: com.
[5/9/14 9:00:15:254 NZST] 00000001 WorkSpaceMana 3 getClassOfType, className: com.
[5/9/14 9:00:15:255 NZST] 00000001 WorkSpaceMana 3 profileKey
[5/9/14 9:00:15:258 NZST] 00000001 WorkSpaceMana A WKSP0500I: Workspace configuration consistency check is disabled.
[5/9/14 9:00:15:287 NZST] 00000001 WorkSpaceMana < getWorkSpace, WS: com.
[5/9/14 9:00:15:299 NZST] 00000001 WorkSpaceMana > getWorkSpace, UserID: anon
[5/9/14 9:00:15:299 NZST] 00000001 WorkSpaceMana 3 The same sessionId share the same WorkSpace.
[5/9/14 9:00:15:300 NZST] 00000001 WorkSpaceMana < getWorkSpace, WS: com.
[5/9/14 9:00:15:328 NZST] 00000001 WorkSpaceMana > getWorkSpace, UserID: anon
[5/9/14 9:00:15:328 NZST] 00000001 WorkSpaceMana 3 The same sessionId share the same WorkSpace.
[5/9/14 9:00:15:329 NZST] 00000001 WorkSpaceMana < getWorkSpace, WS: com.
[5/9/14 9:00:15:330 NZST] 00000001 WorkSpaceMana > getWorkSpace, UserID: anon
[5/9/14 9:00:15:330 NZST] 00000001 WorkSpaceMana 3 The same sessionId share the same WorkSpace.
[5/9/14 9:00:15:330 NZST] 00000001 WorkSpaceMana < getWorkSpace, WS: com.
[5/9/14 9:00:15:451 NZST] 00000001 WorkSpaceMana > getWorkSpace, UserID: anon
[5/9/14 9:00:15:458 NZST] 00000001 WorkSpaceMana 3 The same sessionId share the same WorkSpace.
[5/9/14 9:00:15:459 NZST] 00000001 WorkSpaceMana < getWorkSpace, WS: com.
[5/9/14 9:00:15:472 NZST] 00000001 WorkSpaceMana 3 removeWorkSpace, UserID: anon
<----- discard() method is being called properly hence anon ymou s139 9582 8152 40 is removed at the end of session ----->
com. ibm. ws.s m.wo rksp ace. impl .Wor kSpa ceMa nage rImp l.ge tCal lSta ck(W orkS pace Mana gerI mpl. java :591 )
com. ibm. ws.s m.wo rksp ace. impl .Wor kSpa ceMa nage rImp l.re move Work Spac e(Wo rkSp aceM anag erIm pl.j ava: 452)
com. ibm. ws.s m.wo rksp ace. impl .Wor kSpa ceMa nage rImp l.re move Work Spac e(Wo rkSp aceM anag erIm pl.j ava: 446)
com. ibm. ws.m anag emen t.co nfig serv ice. Conf igSe rvic eImp l.di scar d(Co nfig Serv iceI mpl. java :789 )
com. ibm. bpmc ommo n.up grad e.da taba se.V alid ateD atab aseV ersi on.g etCl uste r(Va lida teDa taba seVe rsio n.ja va:2 42)
com. ibm. bpmc ommo n.up grad e.da taba se.V alid ateD atab aseV ersi on.v erif ySta ndar dDB4 ND(V alid ateD atab aseV ersi on.j ava: 199)
com. ibm. bpmc ommo n.up grad e.da taba se.V alid ateD atab aseV ersi on.s tart (Val idat eDat abas eVer sion .jav a:12 0)
com. ibm. ws.r unti me.c ompo nent .Con tain erHe lper .sta rtCo mpon ents (Con tain erHe lper .jav a:53 9)
com. ibm. ws.r unti me.c ompo nent .Con tain erIm pl.s tart Comp onen ts(C onta iner Impl .jav a:62 7)
com. ibm. ws.r unti me.c ompo nent .Con tain erIm pl.s tart (Con tain erIm pl.j ava: 618)
com. ibm. ws.r unti me.c ompo nent .App lica tion Serv erIm pl.s tart (App lica tion Serv erIm pl.j ava: 252)
com. ibm. ws.r unti me.c ompo nent .Con tain erHe lper .sta rtCo mpon ents (Con tain erHe lper .jav a:53 9)
com. ibm. ws.r unti me.c ompo nent .Con tain erIm pl.s tart Comp onen ts(C onta iner Impl .jav a:62 7)
com. ibm. ws.r unti me.c ompo nent .Con tain erIm pl.s tart (Con tain erIm pl.j ava: 618)
com. ibm. ws.r unti me.c ompo nent .Ser verI mpl. star t(Se rver Impl .jav a:52 3)
com. ibm. ws.r unti me.W sSer verI mpl. boot Serv erCo ntai ner( WsSe rver Impl .jav a:31 0)
com. ibm. ws.r unti me.W sSer verI mpl. star t(Ws Serv erIm pl.j ava: 223)
com. ibm. ws.r unti me.W sSer verI mpl. main (WsS erve rImp l.ja va:6 86)
com. ibm. ws.r unti me.W sSer ver. main (WsS erve r.ja va:5 9)
sun. refl ect. Nati veMe thod Acce ssor Impl .inv oke0 (Nat ive Method)
sun. refl ect. Nati veMe thod Acce ssor Impl .inv oke( Nati veMe thod Acce ssor Impl .jav a:60 )
sun. refl ect. Dele gati ngMe thod Acce ssor Impl .inv oke( Dele gati ngMe thod Acce ssor Impl .jav a:37 )
java .lan g.re flec t.Me thod .inv oke( Meth od.j ava: 611)
com.
com.
com.
com.
com.
com.
com.
com.
com.
com.
com.
com.
com.
com.
com.
com.
com.
com.
sun.
sun.
sun.
java
If the discard() method was not being called then one would not see "WorkSpaceMana 3 removeWorkSpace," in the trace.log file when you look up on workspace UserID: anon ymou s139 9582 8152 4 0.
Note: If there is no discard() method being called,
then workspace session does not get cleaned up. So if the code is
making a lot of ConfigService API calls, then the /pro file _hom e/ws temp
directory keeps increasing which will eventually cause an OOM (Out Of
Memory) condition on the JVM (deployment manager or appserver). As a
work-around we can stop the JVM and clean up the contents of the "/pr ofil e_ho me/w stem p"
directory. For a permanent solution, one should be looking at the code
to make sure a discard method is being called to clear the workspace.
Source: https://www.ibm.com/developerworks/community/blogs/aimsupport/entry/anatomy_of_workspace_wstemp_websphere_application_server?lang=en
No comments:
Post a Comment