Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

java.lang.ClassCastException: oracle.jbo.common.ampool.PoolMgr

686347Feb 20 2012 — edited Apr 23 2013
Hi all. I write a webservice using oracle ADF Buisiness components.
When I create an appmodule I get this error on working server - java.lang.ClassCastException: oracle.jbo.common.ampool.PoolMgr

I get it not regulary, sometimes it work ok, sometimes shows this error. On integrated server allways works ok, at least I never saw this error.

Here is stack trace
java.lang.ClassCastException: oracle.jbo.common.ampool.PoolMgr
	at oracle.jbo.common.ampool.PoolMgr.getInstance(PoolMgr.java:51)
	at oracle.jbo.client.Configuration.createRootApplicationModule(Configuration.java:1393)
	at oracle.jbo.client.Configuration.createRootApplicationModule(Configuration.java:1370)
	at kz.kklife.osnsws.ws.WsListener.prepareCall(WsListener.java:69)
I create App Module this way
  WsAppModuleImpl      am =
 (WsAppModuleImpl)Configuration.createRootApplicationModule("kz.kklife.osnsws.model.WsAppModule",
                                                            "WsAppModuleLocal");
I've tried shared configuration, enabled and disabled pool in AM Configuration - the same result.
Google says nothing, I cannot find solution. What is the trouble?


PS: Sometimes I got the same error when releasing AM, so I close it this way.
    private void closeCall() {
        try {
            if (am != null)
                Configuration.releaseRootApplicationModule(am, true);
        } catch (Exception e) {
        } finally {
            am = null;
        }
It looks ugly, but I cannot find another solution.

Edited by: Zulkar on 21.02.2012 11:58
This post has been answered by Frank Nimphius-Oracle on Feb 21 2012
Jump to Answer

Comments

686347
So, is there another way to create root app module? I've found only this one.
Frank Nimphius-Oracle
Answer
Hi,

not quite sure what you are doing here, but to expose ADF BC functionality as WS you can

- expose View Objects as SDO services in JDeveloper 11g
- expose client methods on the AM as WS

In both cases, deploying the AM to WLS creates the WS reference without you having to manage state

http://docs.oracle.com/cd/E21764_01/web.1111/b31974/bcextservices.htm#CJAJGIEB
http://technology.amis.nl/blog/9877/adding-a-custom-method-in-an-adf-bc-service-interface-update-of-a-single-attribute-in-a-selected-row

Frank
Marked as Answer by 686347 · Sep 27 2020
686347
Thanks, Frank, I'll read your links.
686347
http://docs.oracle.com/cd/E21764_01/web.1111/b31974/bcextservices.htm#CJAJGIEB
The parameters and non-void return value of the custom service methods you enable must be one of the supported data types, such as a primitive Java type, oracle.jbo.server.ViewRowImpl, java.util.List<ViewRowImpl>, oracle.jbo.AttributeList, or java.util.List<AttributeList>.
So, does it means I cannot publish methods with my own parameter and return types? I need to publish method like this
public MyReturnType myWebServiceMethod(MyParamType p) throws MyException{
  ....
}
I've made all this classes serializable, but myWebServiceMethod doesn't present in "Service Custom Methods" in AM service interface configuration.


So, the main question is how to create root AM? May be my pool config is wrong? But it works sometimes.

Edited by: Zulkar on 22.02.2012 11:59
ppires
Hello,

I'ts been some time, but here is a possible solution for reference.

I think the problem is with ADF Context initialization
I've found this post http://jobinesh.blogspot.pt/2010/04/invoking-applicationmodule-from-servlet.html

You can add a filter on web.xml so that every request received initializes the ADF context.

<!-- ADF Bindings -->
<filter>
<filter-name>adfBindings</filter-name>
<filter-class>oracle.adf.model.servlet.ADFBindingFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>adfBindings</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>FORWARD</dispatcher>
<dispatcher>REQUEST</dispatcher>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>


This fix my problem.

Kind Regards
Pedro Pires
1 - 5
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on May 21 2013
Added on Feb 20 2012
5 comments
2,307 views