EAR PACKAGE LOCAL BEAN

Hi everybody,
I would be really glad for some help.
I have a servlet in a web app that tries to use a local stateless EJB 3 bean. I have packaged all it in a EAR created using eclipse. But it seems not to deploy well the EJB.
Instead if I deployed this EJB by myself (as a jar) I see that things are ok in the jboss, but I cannot acces to it because is a local bean.
Any suggestion will be nice.
Thanks.

Any suggestion will be nice.I would suggest that you remove the code that directly calls the EJB from the servlet. Implement a Business Delegate and have it call the EJB directly. Store a reference to the Business Delegate in HttpSession.
Try to create the EAR without Eclipse. Deploy the EAR in JBoss without Eclipse.
If you delploy the EJB (local bean) correctly in JBoss, you should be able to access it via JNDI tree of application server. It does not matter whether you use an EAR jar or and EJB jar. If you deploy the web application and the EJB application on the same node, they can communicate with each other using EJB local interfaces.

Similar Messages

  • How to get a EAR package for deploying without local data-source setting in JDev9i?

    Hi all,
    I want to use pooled data-sources defined in OC4J's global configuration setting directory in JDEV_HOME\j2ee\home\config.
    But when I packaged my application to an EAR file,it contains it's local data-sources.xml file in the package.Each time the server was restared,the local data-sources.xml file was overwritten by the originally setting in the EAR package,thus I cannot use the pooled settings.
    So could let me know how to package a EAR file without containing it's local data-source setting,but use the global data-source setting?Or how to control the local data-source setting without changed after mannully defined.
    Your reply is greatly appreciated!
    Regards,
    Robbin Woo

    Mike,
    You don't need a File to do what you want. Even if you could, it would be wrong to use a file.
    It would be wrong, because the compiler might not by using a JavaFileManager that is actually backed by a filesystem. It could be backed by some form of repository such as a database, or it could be backed by a transient in memory file system ( An example of the latter is the [annotation processor test framework|https://hickory.dev.java.net/nonav/apidocs/index.html?net/java/dev/hickory/testing/package-summary.html] in hickory)
    But probably of more interest to you, you don't need to because you can simply [get an InputStream|http://java.sun.com/javase/6/docs/api/javax/tools/FileObject.html#openInputStream()] from the FileObject returned from [filer.getResource(...)|http://java.sun.com/javase/6/docs/api/javax/annotation/processing/Filer.html#getResource(javax.tools.JavaFileManager.Location,%20java.lang.CharSequence,%20java.lang.CharSequence)] and read it.
    You might also find the [Compiler Tree API|http://java.sun.com/javase/6/docs/jdk/api/javac/tree/index.html] useful. The Compiler Tree API is available to annotation processors running in Oracle's (Sun's) javac, but not in other compilers (possibly limiting portability).
    With this API you can [convert |http://java.sun.com/javase/6/docs/jdk/api/javac/tree/com/sun/source/util/Trees.html#getPath(javax.lang.model.element.Element)] the Element representing the annotation to a Treepath then [get the leaf node|http://java.sun.com/javase/6/docs/jdk/api/javac/tree/com/sun/source/util/TreePath.html#getLeaf()] and from that tree [obtain its offsets|http://java.sun.com/javase/6/docs/jdk/api/javac/tree/com/sun/source/util/Trees.html#getSourcePositions()] within the source file.
    Bruce

  • Why do I use local bean interfaces?

    When can I use a local bean interface?
    Is it when the beans are deployed in the same manufacturers container system or do the beans just have to reside on the same physical machine?

    Yes, you should always write local interfaces when
    both web and ejb container using the same JVM.
    This is incorrect. The EJB Local view (as opposed to the EJB Remote view)
    can only be accessed by :
    1) an EJB within the same ejb-jar
    2) an EJB within a different ejb-jar but packaged within the same .ear
    3) a web component(servlet or jsp) in a .war packaged within the same .ear
    An ejb or web component in a different application(.ear) cannot portably
    access the Local EJB view.
    Kenneth Saks
    J2EE SDK Team
    SUN Microsystems
    You can search out about more on local interface for
    solving data-aliasing problem.

  • Howto: portable bind, lookup remote + local beans (EJB3) to JNDI with WL 10

    I struggle writing portable ejb3 applications with weblogic.
    I have a JEE5 (EJB3) application using the standard and it works fine on JBoss and WebSphere.
    Porting it to Weblogic (10.0) there are quite a lot of problems, mainly
    in the area of JNDI lookups of EJBs.
    So the issue is how to configure the JNDI-Names of local and remote beans (EJB3!)
    in a portable way with Weblogic without making the application unportable.
    The biggest problem is caused by the fact, that WL 10 does not bind the EJBs
    to the JNDI-tree by default. The bound name would not really be important (JBoss and WebSphere
    come up with a value that can easily be used for a generic lookup). Just any binding
    would be fine.
    So there has to be some extra step in order to get WL 10 binding a remote or local
    bean into the JNDI tree. Unfortunately none of them works/is acceptable in an portable JEE app.
    Idea1: Using the "mappedName" attribute (of @Stateless, @Stateful)
    Well, this one is not portable as the documentation states:
    [http://edocs.bea.com/wls/docs100/ejb30/annotations.html#wp1417411|http://edocs.bea.com/wls/docs100/ejb30/annotations.html#wp1417411]
    Idea2: Using @weblogic.ejbgen.JndiName
    Using weblogic's annotation JndiName also doesn't bind the bean to the given names:
    @Stateless
    @weblogic.ejbgen.JndiName(local="myapp/XBean/local",remote="myapp/XBean/remote")
    public class XBean implements XLocal {
    Besides this, that code would not be portable (as nobody wants an weblogic.jar within another application server).
    Idea3: Using weblogic-ejb-jar.xml
    Mapping a bean using the weblogic-ejb-jar.xml below, also doesn't work.
    The bean is not bound to the given name "myapp/XBean/remote":
    Exception in thread "main" javax.naming.NameNotFoundException:
    Unable to resolve 'myapp.XBean.remote'. Resolved 'myapp.XBean' [Root exception is javax.naming.NameNotFoundException: Unable to resolve 'myapp.XBean.remote'. Resolved 'myapp.XBean']; remaining name 'remote'
    Looking at the JNDI tree, there is "something" bound to "myapp.XBean", but it is not the bean.
    Doing a lookup with this name ("myapp/XBean" or "myapp.XBean"), gives this:
    Exception in thread "main" java.lang.ClassCastException: weblogic.jndi.internal.WLContextImpl cannot be cast to test.server.XRemote
         at test.client.Client.main(Client.java:14)
    Question 1) What is the preferred way to bind and lookup a remote bean in Weblogic 10?
    Again: the goal is to use pure EJB3.
    Question 2) What is the preferred way to bind and lookup a local bean in WL 10?
    This lookup has to be done on the server in some "unmanaged" classes
    where injection doesn't work.
    If there is an unportable way to bind a local bean to jndi, it might do for the time.
    The important thing would be, that there is no weblogic specific code within the application.
    So, solving it using weblogic-xml files would be best.
    This declaration
    <local-jndi-name>myapp/XBean/local</local-jndi-name>
    will come up with the same problems, I guess.
    Here's the code. We want the local interface extending the remote interface,
    so that the local beans can do all what the remote beans can do too.
    XRemote.java
    package test.server;
    import javax.ejb.Remote;
    @Remote
    public interface XRemote {
    String JNDI_NAME = "myapp/XBean/remote";
    void doXRemote();
    XLocal.java
    package test.server;
    import javax.ejb.Local;
    @Local
    public interface XLocal extends XRemote {
    String JNDI_NAME = "myapp/XBean/local";
    void doXLocal();
    XBean.java
    package test.server;
    import javax.ejb.Stateless;
    @Stateless
    public class XBean implements XLocal {
    @Override
    public void doXLocal() {
    System.out.println("doXLocal() called");
    @Override
    public void doXRemote() {
    System.out.println("doXRemote() called");
    weblogic-ejb-jar.xml
    <weblogic-ejb-jar
    xmlns="http://www.bea.com/ns/weblogic/10.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.bea.com/ns/weblogic/10.0 http://www.bea.com/ns/weblogic/10.0/weblogic-ejb-jar.xsd">
    <weblogic-enterprise-bean>
    <ejb-name>XBean</ejb-name>
    <jndi-name>myapp/XBean/remote</jndi-name>
    </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    Client.java
    package test.client;
    import java.util.Properties;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import test.server.XRemote;
    public class Client {
    public static void main(String[] args) throws NamingException {
    InitialContext context = getInitialContext();
    XRemote xRemote = (XRemote) context.lookup(XRemote.JNDI_NAME);
    xRemote.doXRemote();
    private static InitialContext getInitialContext() throws NamingException {
    Properties properties = new Properties();
    properties.put(Context.PROVIDER_URL, "t3://localhost:7001");
    properties.put(Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    properties.put(Context.SECURITY_PRINCIPAL, "weblogic");
    properties.put(Context.SECURITY_CREDENTIALS, "weblogic");
    return new InitialContext(properties);
    }

    Hi,
    about how to specify jndi name of remote ejb, please refer to this link: http://forums.oracle.com/forums/thread.jspa?threadID=800314&tstart=1
    please note @JNDIName isn't an EJBGen annotation. its package name is weblogic.javaee.
    So far, based on the EJB spec, local ejb will not be bound to global JNDI. EJB3.1 specification is trying to specify the portable JNDI names including local EJBs, but it isn't published yet.
    local EJB is used within one application and ejb reference is used to lookup the local EJB. please refer to EJB specification about how to declare an EJB local reference. once it is declared, it can be looked up from the java:comp\env JNDI namespace.
    But, if the local client of the EJB isn't a JavaEE component, there won't be any declaration of ejb-local-ref. You may want to try remote access to the EJB from the non-JavaEE client.

  • Error during processing local bean: localejbs/RfcAFBean

    Hi everybody
    we currently trying to perform a RFC Call to our developpment system. The scenario is a simple File to RFC Scenario and it worked until yesterday. Since today the Messages stuck in the RFC receiver Adapter with the following errors in the audit log:
    MP: exception caught with cause com.sap.engine.services.ejb.exceptions.BaseTransactionRolledbackLocalException: Exception thrown in method process. The transaction is marked for rollback.
    Exception caught by adapter framework: Exception thrown in method process. The transaction is marked for rollback.
    Delivery of the message to the application using connection RFC_http://sap.com/xi/XI/System failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: Exception thrown in method process. The transaction is marked for rollback.: com.sap.engine.services.ejb.exceptions.BaseTransactionRolledbackLocalException: Exception thrown in method process. The transaction is marked for rollback..
    The deffaultTrace.trc show the following entries. Looks like an error in localejbs/RfcAFBean:
    RfcFunctionName:ZPSCD_INTERFACE_XXXXX
    Date : 07/13/2007
    Time : 9:32:39:301
    Message : 
    [EXCEPTION]
    com.sap.engine.services.ejb.exceptions.BaseTransactionRolledbackLocalException: Exception thrown in method process. The transaction is marked for rollback.
         at com.sap.aii.af.mp.module.ModuleLocalLocalObjectImpl0_0.process(ModuleLocalLocalObjectImpl0_0.java:118)
         at com.sap.aii.af.mp.ejb.ModuleProcessorBean.process(ModuleProcessorBean.java:264)
         at com.sap.aii.af.mp.processor.ModuleProcessorLocalLocalObjectImpl0_0.process(ModuleProcessorLocalLocalObjectImpl0_0.java:103)
         at com.sap.aii.af.listener.AFWListenerBean.onMessage(AFWListenerBean.java:267)
         at com.sap.aii.af.listener.AFWListenerLocalObjectImpl0_0.onMessage(AFWListenerLocalObjectImpl0_0.java:103)
         at com.sap.aii.af.ra.ms.impl.ServicesImpl.deliver(ServicesImpl.java:306)
         at com.sap.aii.adapter.xi.ms.XIEventHandler.onDeliver(XIEventHandler.java:1034)
         at com.sap.aii.af.ra.ms.impl.core.queue.ReceiveConsumer.invokeHandler(ReceiveConsumer.java:392)
         at com.sap.aii.af.ra.ms.impl.core.queue.ReceiveConsumer.onMessage(ReceiveConsumer.java:86)
         at com.sap.aii.af.ra.ms.impl.core.queue.Queue.run(Queue.java:848)
         at com.sap.aii.af.ra.ms.runtime.MSWorkWrapper.run(MSWorkWrapper.java:56)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Caused by: java.lang.NoSuchMethodError: com.sap.aii.af.rfc.core.config.RfcConfigManager.isPPActive(Lcom/sap/aii/af/service/cpa/Channel;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Z
         at com.sap.aii.af.rfc.afcommunication.ejb.RfcAFBean.isPPActive(RfcAFBean.java:385)
         at com.sap.aii.af.rfc.afcommunication.ejb.RfcAFBean.process(RfcAFBean.java:240)
         at com.sap.aii.af.mp.module.ModuleLocalLocalObjectImpl0_0.process(ModuleLocalLocalObjectImpl0_0.java:103)
         ... 14 more
    Severity : Error
    Category :
    Location : com.sap.engine.services.ejb
    Application : sap.com/com.sap.aii.adapter.rfc.app
    Thread : SAPEngine_Application_Thread[impl:3]_44
    Datasource : 312846850:/usr/sap/XDS/DVEBMGS31/j2ee/cluster/server0/log/defaultTrace.trc
    Message ID : 0003BA5D1D27006D000002BF0000653B000435201DA336D6
    Source Name : com.sap.engine.services.ejb
    Argument Objs : com.sap.engine.services.ejb.exceptions.BaseTransactionRolledbackLocalException: Exception thrown in method process. The transaction is marked for rollback.
         at com.sap.aii.af.mp.module.ModuleLocalLocalObjectImpl0_0.process(ModuleLocalLocalObjectImpl0_0.java:118)
         at com.sap.aii.af.mp.ejb.ModuleProcessorBean.process(ModuleProcessorBean.java:264)
         at com.sap.aii.af.mp.processor.ModuleProcessorLocalLocalObjectImpl0_0.process(ModuleProcessorLocalLocalObjectImpl0_0.java:103)
         at com.sap.aii.af.listener.AFWListenerBean.onMessage(AFWListenerBean.java:267)
         at com.sap.aii.af.listener.AFWListenerLocalObjectImpl0_0.onMessage(AFWListenerLocalObjectImpl0_0.java:103)
         at com.sap.aii.af.ra.ms.impl.ServicesImpl.deliver(ServicesImpl.java:306)
         at com.sap.aii.adapter.xi.ms.XIEventHandler.onDeliver(XIEventHandler.java:1034)
         at com.sap.aii.af.ra.ms.impl.core.queue.ReceiveConsumer.invokeHandler(ReceiveConsumer.java:392)
         at com.sap.aii.af.ra.ms.impl.core.queue.ReceiveConsumer.onMessage(ReceiveConsumer.java:86)
         at com.sap.aii.af.ra.ms.impl.core.queue.Queue.run(Queue.java:848)
         at com.sap.aii.af.ra.ms.runtime.MSWorkWrapper.run(MSWorkWrapper.java:56)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Caused by: java.lang.NoSuchMethodError: com.sap.aii.af.rfc.core.config.RfcConfigManager.isPPActive(Lcom/sap/aii/af/service/cpa/Channel;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Z
         at com.sap.aii.af.rfc.afcommunication.ejb.RfcAFBean.isPPActive(RfcAFBean.java:385)
         at com.sap.aii.af.rfc.afcommunication.ejb.RfcAFBean.process(RfcAFBean.java:240)
         at com.sap.aii.af.mp.module.ModuleLocalLocalObjectImpl0_0.process(ModuleLocalLocalObjectImpl0_0.java:103)
         ... 14 more
    Arguments : com.sap.engine.services.ejb.exceptions.BaseTransactionRolledbackLocalException: Exception thrown in method process. The transaction is marked for rollback.
         at com.sap.aii.af.mp.module.ModuleLocalLocalObjectImpl0_0.process(ModuleLocalLocalObjectImpl0_0.java:118)
         at com.sap.aii.af.mp.ejb.ModuleProcessorBean.process(ModuleProcessorBean.java:264)
         at com.sap.aii.af.mp.processor.ModuleProcessorLocalLocalObjectImpl0_0.process(ModuleProcessorLocalLocalObjectImpl0_0.java:103)
         at com.sap.aii.af.listener.AFWListenerBean.onMessage(AFWListenerBean.java:267)
         at com.sap.aii.af.listener.AFWListenerLocalObjectImpl0_0.onMessage(AFWListenerLocalObjectImpl0_0.java:103)
         at com.sap.aii.af.ra.ms.impl.ServicesImpl.deliver(ServicesImpl.java:306)
         at com.sap.aii.adapter.xi.ms.XIEventHandler.onDeliver(XIEventHandler.java:1034)
         at com.sap.aii.af.ra.ms.impl.core.queue.ReceiveConsumer.invokeHandler(ReceiveConsumer.java:392)
         at com.sap.aii.af.ra.ms.impl.core.queue.ReceiveConsumer.onMessage(ReceiveConsumer.java:86)
         at com.sap.aii.af.ra.ms.impl.core.queue.Queue.run(Queue.java:848)
         at com.sap.aii.af.ra.ms.runtime.MSWorkWrapper.run(MSWorkWrapper.java:56)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Caused by: java.lang.NoSuchMethodError: com.sap.aii.af.rfc.core.config.RfcConfigManager.isPPActive(Lcom/sap/aii/af/service/cpa/Channel;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Z
         at com.sap.aii.af.rfc.afcommunication.ejb.RfcAFBean.isPPActive(RfcAFBean.java:385)
         at com.sap.aii.af.rfc.afcommunication.ejb.RfcAFBean.process(RfcAFBean.java:240)
         at com.sap.aii.af.mp.module.ModuleLocalLocalObjectImpl0_0.process(ModuleLocalLocalObjectImpl0_0.java:103)
         ... 14 more
    Dsr Component :
    Dsr Transaction : 3bdbc330311311dcb33b0003ba5d1d27
    Dsr User :
    Indent : 0
    Level : 0
    Message Code :
    Message Type : 1
    Relatives :
    Resource Bundlename :
    Session : 0
    Source : com.sap.engine.services.ejb
    ThreadObject : SAPEngine_Application_Thread[impl:3]_44
    Transaction : SAP J2EE Engine JTA Transaction : [12ffffffa5ffffffaa200435f]
    User : J2EE_GUEST
    Date : 07/13/2007
    Time : 9:32:39:304
    Message : Error during processing local bean: localejbs/RfcAFBean
    Severity : Error
    Category :
    Location : com.sap.aii.af.mp.ejb.ModuleProcessorBean.process(String , ModuleData)
    Application : sap.com/com.sap.aii.af.app
    Thread : SAPEngine_Application_Thread[impl:3]_44
    Datasource : 312846850:/usr/sap/XDS/DVEBMGS31/j2ee/cluster/server0/log/defaultTrace.trc
    Message ID : 0003BA5D1D27006D000002C00000653B000435201DA33A4D
    Source Name : com.sap.aii.af.mp.ejb.ModuleProcessorBean
    Argument Objs :
    Arguments :
    Dsr Component :
    Dsr Transaction : 3bdbc330311311dcb33b0003ba5d1d27
    Dsr User :
    Indent : 0
    Level : 0
    Message Code :
    Message Type : 0
    Relatives :
    Resource Bundlename :
    Session : 0
    Source : com.sap.aii.af.mp.ejb.ModuleProcessorBean
    ThreadObject : SAPEngine_Application_Thread[impl:3]_44
    Transaction : SAP J2EE Engine JTA Transaction : [12ffffffa5ffffffaa200435f]
    User : J2EE_GUEST
    Date : 07/13/2007
    Time : 9:32:39:306
    Message : Rolling back transaction for message 38d82020-3113-11dc-c07b-0003ba5d1d27(INBOUND) due to: Exception thrown in method process. The transaction is marked for rollback.
    Severity : Error
    Category :
    Location : com.sap.aii.af.ra.ms.impl.core.queue.ReceiveConsumer.invokeHandler(QueueMessage, MessageController, Services)
    Application :
    Thread : SAPEngine_Application_Thread[impl:3]_44
    Datasource : 312846850:/usr/sap/XDS/DVEBMGS31/j2ee/cluster/server0/log/defaultTrace.trc
    Message ID : 0003BA5D1D27006D000002C10000653B000435201DA341C8
    Source Name : com.sap.aii.af.ra.ms.impl.core.queue.ReceiveConsumer
    Argument Objs : 38d82020-3113-11dc-c07b-0003ba5d1d27(INBOUND),Exception thrown in method process. The transaction is marked for rollback.,
    Arguments : 38d82020-3113-11dc-c07b-0003ba5d1d27(INBOUND),Exception thrown in method process. The transaction is marked for rollback.,
    Dsr Component :
    Dsr Transaction : 3bdbc330311311dcb33b0003ba5d1d27
    Dsr User :
    Indent : 0
    Level : 0
    Message Code :
    Message Type : 1
    Relatives :
    Resource Bundlename :
    Session : 0
    Source : com.sap.aii.af.ra.ms.impl.core.queue.ReceiveConsumer
    ThreadObject : SAPEngine_Application_Thread[impl:3]_44
    Transaction : SAP J2EE Engine JTA Transaction : [12ffffffa5ffffffaa200435f]
    User : J2EE_GUEST
    It looks like the JCO Bean has an error. Any Ideas
    Regards Oliver

    Hi Bhavesh
    I found some more interesting log entries and it seems to be a user password problem:
    Retries exceded, set message 38f10280-3388-11dc-9c91-0003ba5d1d27(INBOUND) to status NON_DELIVERED.
    Name or password is incorrect (repeat logon)
    JCoClient connection missingHost:xdsci_XDS_31|AdapterType:MessagingSystem|Sender::FileServer|Receiver::PSCD_CDD|Interface:ZPSCD_INTERFACE_DECLAR_TVA:urn:sap-com:document:sap:rfc:functions|MsgID:38f10280-3388-11dc-9c91-0003ba5d1d27
    Is this the user/password of the channel or is it service user for the JCO?
    Regards Oliver

  • How to access ejb jar in ear package from other war web package?

    How to access ejb in jar packed in ear package from other war web package?

    Typically you would just look the EJB Home up in JNDI. If you're
    looking for example code, the medrec example in WLS 8.1 or petstore has
    plenty of webapps calling EJBs.
    -- Rob
    CottonXu wrote:
    How to access ejb in jar packed in ear package from other war web package?

  • Local bean access via JNDI returns a proxy object?

    Hi,
    I am using JBoss, and trying to access a local bean from another bean. One would think simple enough no, with the following code adequate:
    Context initialContext = new InitialContext();
    CartHome cartHome = (CartHome) initialContext.lookup(&#8220;java:comp/env/ejb/cart&#8221;);Which returns the home interface, right, but no in fact a $Proxy77 is returned. Can anyone tell me why this is? Or a solution please.
    Thanks in advance.
    Mike

    Thanks, it works. But do you think calling the executeQuery from a backing bean is against any ADF related coding standards? Should that call be only in Application Module? Please comment.

  • Kodo 3.0.3 fails when detaching package local classes

    When I try to detach a class that is package local to enforce usage of
    factories and interfaces Kodo
    throws the following exception:
    kodo.util.UserException: Cannot access the detached state of class "class
    xxx.core.model.competitor.CompetitorImpl". Ensure that the class has the
    "detachable" metadata extension, and the the class has been re-enhanced.
    NestedThrowables:
    java.lang.IllegalAccessException: Class kodo.runtime.KodoHelper can not
    access a member of class xxx.core.model.competitor.CompetitorImpl with
    modifiers "public final"
    at kodo.runtime.KodoHelper.setDetachedState(KodoHelper.java:496)
    at kodo.runtime.DetachManager.setDetachedVariables(DetachManager.java:231)
    at kodo.runtime.DetachManager.detach(DetachManager.java:168)
    at kodo.runtime.DetachManager.detach(DetachManager.java:55)
    at
    kodo.runtime.PersistenceManagerImpl.detach(PersistenceManagerImpl.java:3073)
    at
    xxx.core.model.competitor.CompetitorImplTest.doCheckPersistent(CompetitorImp
    lTest.java:798)
    at xxx.core.model.DatabaseTest.checkPersistent(DatabaseTest.java:133)
    at xxx.core.model.DatabaseTest.testPersistence(DatabaseTest.java:74)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
    ..java:25)
    at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
    at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
    at junit.extensions.TestSetup.run(TestSetup.java:23)
    at com.intellij.rt.execution.junit2.IdeaJUnitAgent.doRun(Unknown Source)
    at
    com.intellij.rt.execution.junit.TextTestRunner2.startRunnerWithArgs(Unknown
    Source)
    at
    com.intellij.rt.execution.junit2.JUnitStarter.prepareStreamsAndStart(Unknown
    Source)
    at com.intellij.rt.execution.junit2.JUnitStarter.main(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
    ..java:25)
    at com.intellij.rt.execution.application.AppMain.main(Unknown Source)
    Caused by: java.lang.IllegalAccessException: Class kodo.runtime.KodoHelper
    can not access a member of class xxx.core.model.competitor.CompetitorImpl
    with modifiers "public final"
    at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:57)
    at kodo.runtime.KodoHelper.invoke(KodoHelper.java:625)
    at kodo.runtime.KodoHelper.setDetachedState(KodoHelper.java:491)
    ... 38 more
    NestedThrowablesStackTrace:
    java.lang.IllegalAccessException: Class kodo.runtime.KodoHelper can not
    access a member of class xxx.core.model.competitor.CompetitorImpl with
    modifiers "public final"
    at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:57)
    at kodo.runtime.KodoHelper.invoke(KodoHelper.java:625)
    at kodo.runtime.KodoHelper.setDetachedState(KodoHelper.java:491)
    at kodo.runtime.DetachManager.setDetachedVariables(DetachManager.java:231)
    at kodo.runtime.DetachManager.detach(DetachManager.java:168)
    at kodo.runtime.DetachManager.detach(DetachManager.java:55)
    at
    kodo.runtime.PersistenceManagerImpl.detach(PersistenceManagerImpl.java:3073)
    at
    xxx.core.model.competitor.CompetitorImplTest.doCheckPersistent(CompetitorImp
    lTest.java:798)
    at xxx.core.model.DatabaseTest.checkPersistent(DatabaseTest.java:133)
    at xxx.core.model.DatabaseTest.testPersistence(DatabaseTest.java:74)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
    ..java:25)
    at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
    at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
    at junit.extensions.TestSetup.run(TestSetup.java:23)
    at com.intellij.rt.execution.junit2.JUnitStarter.main(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
    ..java:25)
    at com.intellij.rt.execution.application.AppMain.main(Unknown Source)
    Seems that KodoHelper tries to access something per reflection and fails
    because the class is
    not public and setAccessible(true) is not used.
    When the class is changed to be public detaching seems to work fine.

    Werner-
    You are correct: Kodo is using reflection to set the detached state in
    the object. We will make a note of this in the documentation. For the
    time being, the object will need to be public (you can help enforce a
    factory pattern by having a protected constructor).
    This will be addressed when we implement the final version of JDO 2.0,
    which will have a more well-defined specification for how detachment is
    to work.
    In article <[email protected]>, werner wrote:
    When I try to detach a class that is package local to enforce usage of
    factories and interfaces Kodo
    throws the following exception:
    kodo.util.UserException: Cannot access the detached state of class "class
    xxx.core.model.competitor.CompetitorImpl". Ensure that the class has the
    "detachable" metadata extension, and the the class has been re-enhanced.
    NestedThrowables:
    java.lang.IllegalAccessException: Class kodo.runtime.KodoHelper can not
    access a member of class xxx.core.model.competitor.CompetitorImpl with
    modifiers "public final"
    at kodo.runtime.KodoHelper.setDetachedState(KodoHelper.java:496)
    at kodo.runtime.DetachManager.setDetachedVariables(DetachManager.java:231)
    at kodo.runtime.DetachManager.detach(DetachManager.java:168)
    at kodo.runtime.DetachManager.detach(DetachManager.java:55)
    at
    kodo.runtime.PersistenceManagerImpl.detach(PersistenceManagerImpl.java:3073)
    at
    xxx.core.model.competitor.CompetitorImplTest.doCheckPersistent(CompetitorImp
    lTest.java:798)
    at xxx.core.model.DatabaseTest.checkPersistent(DatabaseTest.java:133)
    at xxx.core.model.DatabaseTest.testPersistence(DatabaseTest.java:74)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
    .java:25)
    at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
    at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
    at junit.extensions.TestSetup.run(TestSetup.java:23)
    at com.intellij.rt.execution.junit2.IdeaJUnitAgent.doRun(Unknown Source)
    at
    com.intellij.rt.execution.junit.TextTestRunner2.startRunnerWithArgs(Unknown
    Source)
    at
    com.intellij.rt.execution.junit2.JUnitStarter.prepareStreamsAndStart(Unknown
    Source)
    at com.intellij.rt.execution.junit2.JUnitStarter.main(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
    .java:25)
    at com.intellij.rt.execution.application.AppMain.main(Unknown Source)
    Caused by: java.lang.IllegalAccessException: Class kodo.runtime.KodoHelper
    can not access a member of class xxx.core.model.competitor.CompetitorImpl
    with modifiers "public final"
    at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:57)
    at kodo.runtime.KodoHelper.invoke(KodoHelper.java:625)
    at kodo.runtime.KodoHelper.setDetachedState(KodoHelper.java:491)
    ... 38 more
    NestedThrowablesStackTrace:
    java.lang.IllegalAccessException: Class kodo.runtime.KodoHelper can not
    access a member of class xxx.core.model.competitor.CompetitorImpl with
    modifiers "public final"
    at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:57)
    at kodo.runtime.KodoHelper.invoke(KodoHelper.java:625)
    at kodo.runtime.KodoHelper.setDetachedState(KodoHelper.java:491)
    at kodo.runtime.DetachManager.setDetachedVariables(DetachManager.java:231)
    at kodo.runtime.DetachManager.detach(DetachManager.java:168)
    at kodo.runtime.DetachManager.detach(DetachManager.java:55)
    at
    kodo.runtime.PersistenceManagerImpl.detach(PersistenceManagerImpl.java:3073)
    at
    xxx.core.model.competitor.CompetitorImplTest.doCheckPersistent(CompetitorImp
    lTest.java:798)
    at xxx.core.model.DatabaseTest.checkPersistent(DatabaseTest.java:133)
    at xxx.core.model.DatabaseTest.testPersistence(DatabaseTest.java:74)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
    .java:25)
    at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
    at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
    at junit.extensions.TestSetup.run(TestSetup.java:23)
    at com.intellij.rt.execution.junit2.JUnitStarter.main(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
    at
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
    .java:25)
    at com.intellij.rt.execution.application.AppMain.main(Unknown Source)
    Seems that KodoHelper tries to access something per reflection and fails
    because the class is
    not public and setAccessible(true) is not used.
    When the class is changed to be public detaching seems to work fine.
    Marc Prud'hommeaux
    SolarMetric Inc.

  • Creating jar having packages and beans

    hello!
    i have a project.
    i want to use bean like this(i.e. AdminBean in package com/tech/pack/util/admin)
    com.tech.pack.util.admin.AdminBean
    and have multiple packages like com/tech/pack and com/tech/pack/tools
    i want to create a jar file of all these packages and beans.
    but i have no clue about this.
    please help me.
    thanks in advance.

    thanks
    i did following:
    created text file manifest that contain
    Manifest-Version: 1.0
    Specification-Title: Java Platform API Specification
    Specification-Version: 1.4
    Implementation-Title: Java Runtime Environment
    Implementation-Version: 1.4.0-rc
    Created-By: 1.4.0-rc (Sun Microsystems Inc.)
    Implementation-Vendor: Sun Microsystems, Inc.
    Specification-Vendor: Sun Microsystems, Inc.
    Name: com/tech/forum/Auto.class
    Name: com/tech/forum/AutoFactory.class
    Name: com/tech/forum/UnauthorizedException.class
    Name: com/tech/forum/Category.class
    Name: com/tech/forum/util/admin/AdminBean.class
    Java-Bean: True
    com/tech/forum/.class indicates the class in com/tech/forum/ directory
    then created jar by jar cvf file.jar * .class manifest it create the jar. to be sure i extracted jar that gives directories com , META-INF and manifestfile.
    but i m not able to use bean.
    anything gone wrong?
    please help.
    Edited by: shahamar on Mar 9, 2009 11:34 PM

  • Ear packaging benefits

    Hi everybody,
    I just wanted to get some opinions/validation on ear
    packaging based on reading some of the documentation
    http://edocs.bea.com/wls/docs60/programming/packaging.html#1037589
    It seems that the class loaders for the web applications
    will be a descendant of the EJB classloader and hence
    will not need
    to use the rmi layer to invoke ejb's.
    - This is of course true only for a non- distributed
    scenario (right ?) .
    - Does WebLogic has a different 'logic' when it identifies
    that the EJB client and server are on the same machine
    ? From the following excerpt it implies that there is
    a significant performance gain due to that, correct ?
    - Also wanted to ask about possible side effects of compressing
    the ear/war files .If disk space isn't a consideration,
    classes are loaded separately (hence no memory gain by
    compressing the jarred files) ,isn't there an overhead
    when decompressing the files to use them ?
    Thanks
    Ari
    "About Application Classloaders
    When WebLogic Server deploys an application, it creates
    two new classloaders: one for EJBs and one for Web applications.
    The EJB classloader is a child of the Java system classloader
    and the Web application classloader is a child of the
    EJB classloader. This allows classes in a Web application
    to locate EJB classes, but EJB classes cannot locate
    Web application classes. A positive side-effect of this
    classloader hierarchy is that it allows servlets and
    JSPs direct access to EJB implementation classes. WebLogic
    Server can bypass the intermediate RMI classes because
    the EJB client and implementation are in the same JVM.

    "Ari" <[email protected]> wrote in message
    news:3ab0ed8b$[email protected]..
    >
    Hi everybody,
    I just wanted to get some opinions/validation on ear
    packaging based on reading some of the documentation
    http://edocs.bea.com/wls/docs60/programming/packaging.html#1037589
    It seems that the class loaders for the web applications
    will be a descendant of the EJB classloader and hence
    will not need
    to use the rmi layer to invoke ejb's.
    - This is of course true only for a non- distributed
    scenario (right ?) .Yes. For the distributed case RMI will still be used.
    - Does WebLogic has a different 'logic' when it identifies
    that the EJB client and server are on the same machine
    ? From the following excerpt it implies that there is
    a significant performance gain due to that, correct ?Yes, there is a performance gain. The size and relative importance of this
    gain varies depending on the parameters passed and the work done in the
    method.
    - Also wanted to ask about possible side effects of compressing
    the ear/war files .If disk space isn't a consideration,
    classes are loaded separately (hence no memory gain by
    compressing the jarred files) ,isn't there an overhead
    when decompressing the files to use them ?Generally compressed archives are only used for clients where the size makes
    a big difference for download time. I wouldn't recommend using them on the
    server. Disk space is generally cheaper than CPU.
    Cheers!
    Adam

  • Coldfusion 7.0 ear package running on websphere application server 6.1

    I try to run a coldfusion ear package on a webspehere 6.1
    application server. It all seems to install correct but when I try
    to open the specific url I get this error:
    Error 500: The Security service is not available.
    Does anyone know what is to be done here to get this ear file
    working.
    This ear file contains the complete coldfusion module as it
    seems and just a small simple script for testing reasons but it
    won't work.
    If anybody can help me with this it would be great.

    This would fall into the realm of anecdotal evidence.
    Business Objects XI 3.1 SP2 FP2.7
    Websphere Application Server 6.1 on Windows, have run environments with fix pack 19, fix pack 23, and fix pack 33 without Websphere related problems.  The list for supported Websphere platforms for Windows is the same as AIX.
    Now having said that, I would suspect that SAP does not test Business Objects with each of the available Websphere fix packs.

  • Saving a package locally to burn it on CD

    hello!
    Is it possible to save an ABAP package locally and burn it on CD and then import it from CD to another system?!
    best regards and thanks in advance

    Attach the abap package to a tranport request. Then release the request and subtask. It will create cofile and datafile in the trnaport directory usr/sap/trans/data and usr/sap/trans/cofiles.
    You can burn these files on to DVD and out it in target system in the transport directory. then add the transport rqeust manually from STMS >> import queue >> Extras >> other request >> add request.
    Cheers,
    Jazz

  • Change package of beans ?

    Hi ,
    i use jdev 11.1.1.7
    I wanted to change package of java beans . so after changing  header of java file :
    package viewcontroller.javaClasses; to package JavaClasse.Beans;
    reset adfc-config :
    <managed-bean id="__45">
        <managed-bean-name id="__44">myBean</managed-bean-name>
        <managed-bean-class id="__43">JavaClasse.Beans.myBean</managed-bean-class>
        <managed-bean-scope id="__42">request</managed-bean-scope>
      </managed-bean>
    finally i run program BUT adf show error about myBean
    cannot instantiate class 'JavaClasses.Beans.myBean'
    Now how can i change package of beans ?

    Newbee,
    how have you done this. This should work if you have used refactoring from the menu in jdev.
    One thin is that packages are always begin with lowercase letters which yours don't. The bean class on the other side should begin (as all java classes) with an uppercase character.
    The easiest way to sort this out is to use a new bean and remove the old one. Code inside the old bean can be copied into the new one.
    Timo

  • How to call functions that return package local types?

    Hi everyone, I have a Pl/Sql function in a package that returns a package-local type.
    I would like to call this function from Java, but I don't know what to pass to "statement.registerOutParameter()"
    (it gives this error:
    Unable to resolve type: "XDRIVE_B2B.TEST1.MYTYPE)
    Here's the simple version with one package:
    package TESTPKG IS
    TYPE MYTYPE IS VARRAY(1) OF INTEGER;
    FUNCTION FCT2 RETURN MYTYPE;
    end;
    package body testpkg IS
    FUNCTION FCT2 RETURN MYTYPE IS
    BEGIN
    RETURN mytype(55);
    END;
    end;
    and here's the java code:
    void javatest(OracleConnection conn)
    throws SQLException
    String sql = "{ call ? = testpkg.fct2() }";
    OracleCallableStatement st =
    (OracleCallableStatement) conn.prepareCall(sql);
    st.registerOutParameter(1, OracleTypes.ARRAY, "MYUSERNAME.TESTPKG.MYTYPE");
    st.execute();
    and as I said above, the java code fails with:
    java.sql.SQLException: Fail to construct descriptor: Unable to resolve type: "MYUSERNAME.TEST1.MYTYPE"
    I can't really have this type live outside of a package because in the real case, it's not a VARRAY(1) of integer, it's a VARRAY(1) of MYTABLE%ROWTYPE, which only seems to compile inside a package.
    thanks for any opinions,
    george moudry
    null

    JDBC, JPublisher, and SQLJ do not support PL/SQL-only types. This includes PL/SQL index tables and record types.

  • How to define my startup class in an .ear package?

    I am using WL6.0SP2 on solaris.
    I plan to package my application as an .ear file and to put all necesarry class
    files in there (it will has one .war file for the web tier and one .jar file for
    the EJBs).
    I want, when Weblogic loads my .ear file (i.e. my application), to execute my
    special startup class, which initializes some caches, etc.
    I do not want to define a startup/shutdown class in the console, because it is
    only specific to my application and this startup class is not present in the weblogic
    classpath during weblogic startup.
    The correct place should be in application.xml, but I don't see such thing in
    the DTD.
    Thank you,
    Ivaylo Zlatev

    There is no way to do this on the EAR level - you can use load-on-startup
    servlet(s) in your web component, or initial-beans-in-free-pool=1 EJB.
    Ivaylo Zlatev <[email protected]> wrote:
    I am using WL6.0SP2 on solaris.
    I plan to package my application as an .ear file and to put all necesarry class
    files in there (it will has one .war file for the web tier and one .jar file for
    the EJBs).
    I want, when Weblogic loads my .ear file (i.e. my application), to execute my
    special startup class, which initializes some caches, etc.
    I do not want to define a startup/shutdown class in the console, because it is
    only specific to my application and this startup class is not present in the weblogic
    classpath during weblogic startup.
    The correct place should be in application.xml, but I don't see such thing in
    the DTD.
    Thank you,
    Ivaylo Zlatev--
    Dimitri

Maybe you are looking for