Topic
  • No replies
YuvrajSurvase
YuvrajSurvase
1 Post

Pinned topic Weblogic workmanager classcast exception

‏2011-08-09T11:06:01Z |
Hi,

I am using plain web application where i want to use commonJ workmanager to do same i have done following steps

1. Define work manager in weblogic.xml

<work-manager>
<name>LogWorkmanager</name>
<min-threads-constraint>
<count>5</count>
</min-threads-constraint>
</work-manager>

2. Define resource in web.xml file

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

3. Use JNDI mapping to get workmanager as:

InitialContext ic = new InitialContext();
commonj.work.WorkManager wm = (commonj.work.WorkManager)ic.lookup("java:comp/env/LogWorkmanager");

Here at step 3 I am getting classcast exception as java.lang.ClassCastException: weblogic.work.j2ee.J2EEWorkManager.

Could you please guide me where I am making mistake as I have defined resource ref point to commonj.workmanager and used same name in lookup method still why i am getting J2EEWorkManager instead of commonJ workmanager.

Thanks,
Yuvraj