如何在WLST中加载基于应用程序范围的工作管理器?

时间:2018-10-21 23:05:10

标签: weblogic wlst initial-context workmanagers

我有几个基于应用程序的工作经理:

weblogic.xml

<work-manager>
  <name>my-work-manager</name>
  <!-- some thread parameters -->
</work-manager>

web.xml

<resource-ref>
  <res-ref-name>my-work-manager</res-ref-name>
  <res-type>commonj.work.WorkManager</res-type>
  <res-auth>Container</res-auth>
  <res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>

这些是在运行时从已部署的应用程序中加载的:

InitialContext ctx = InitialContext();
WorkManager wm = (WorkManager)ctx("java:comp/env/my-work-manager");

有一个新的要求,可以从WLST进行监视,但这不起作用:

connect(...)
ic = javax.naming.InitialContext()
ic.lookup('java:comp/env/my-work-manager')

此操作失败,并显示以下信息:

Traceback (innermost last):
  File "<console>", line 1, in ?
    at weblogic.j2eeclient.SimpleContext.internalLookup(SimpleContext.java:77)
    at weblogic.j2eeclient.SimpleContext.lookup(SimpleContext.java:39)
    at weblogic.jndi.SimpleContext.lookup(SimpleContext.java:86)
    at weblogic.jndi.factories.java.ReadOnlyContextWrapper.lookup(ReadOnlyContextWrapper.java:45)
    at weblogic.jndi.internal.AbstractURLContext.lookup(AbstractURLContext.java:130)
    at javax.naming.InitialContext.lookup(InitialContext.java:411)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)

javax.naming.NameNotFoundException: javax.naming.NameNotFoundException: remaining name: comp/env/my-work-manager

我知道它们的存在和运行有多种原因,其中包括它们出现在Web控制台(Deployments / MyApp / Configuration / Workload)下。那么我在WLST中的调用怎么了?

0 个答案:

没有答案