EJB pattern Help!

Hi
guys!
I am newbie to EJB,A question puzzled me much these days.Help me plz :)
I know the EJB include three objects:EJBObject,EJBHome and XXXBean,The EJBHome object create EJBObjects by Facatory pattern.But,The EJBHome is an Interface,so does its subclass,How can an interface use create() method creating an EJBHome Object?
I don't know wthere I describe the question clearly .example as follws:
   public interface Converter extends EJBObject{
         public bussinessMethod1();
public interface ConverterHome extends EJBHome{
       Converter create() .....;
//Client
  Converter currencyConverter=home.create();//<===
   //I can't understand it!home is an interface,and it isn't implemented(or only because i do not find out it )
  the same question occered when I use the Serilizable interface,a class implement theSerilizable interface,then it is serilizable,too.but in the Serilizable interface,i can't find any clue How the serilizable works.
It maybe a stupid question,but ,Help me PLZ!
Thanx for your time!
kind regards
elant

First, a typical EJB is made up of a HOME, REMOTE and a BEAN. You are correct, your HOME and REMOTE are interfaces. The BEAN is your implementation class.
Converter currencyConverter=home.create();//<===
//I can't understand it!home is an interface,and it
isn't implemented(or only because i do not find out itWhat happens here is your application server will generate a subclass of your HOME interface and implete the create method. That method will, among other things, call the ejbCreate() on your BEAN.
the same question occered when I use the Serilizable
interface,a class implement theSerilizable
interface,then it is serilizable,too.but in the
Serilizable interface,i can't find any clue How the
serilizable works.To begin understanding the Serializable interface, take a look at the javadoc found at http://java.sun.com/j2se/1.4.2/docs/api/java/io/Serializable.html You may also wish to look for the tutorials found on the java.sun.com website.
Hope this helps.

Similar Messages

  • Creating a web service from existing EJB.  HELP!!!

    I have an existing EJB deployed to WL which I want to call as a web service. I do not want to deploy everything in an EAR - I want to use the existing EJB.
    Basically I just created a new web module and put my web-services.xml (and web.xml) in WEB-INF and deployed it.
    The web-services.xml looks like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-services>
    <web-service useSOAP12="false" exposeWSDL="true" targetNamespace="http://www.fxf.com/test/services" name="ProtoService" style="rpc" uri="/ProtoService" ignoreAuthHeader="false">
    <components>
    <stateless-ejb name="ejbcomp0">
              <jndi-name path="ejb/ProtoService"/>
    </stateless-ejb>
    </components>
    <operations>
    <operation name="protoOneMethodOne" method="protoOneMethodOne" component="ejbcomp0">
    </operation>
    </operations>
    </web-service>
    </web-services>
    When I deploy my web project WL throws an exception. Here is part of the stack trace:
    <Feb 23, 2005 8:56:14 AM MST> <Error> <HTTP> <BEA-101216> <Servlet: "WebServiceServlet" failed to preload on startup in Web application: "efs".
    javax.servlet.ServletException: ERROR: The EJB component named: ejbcomp0 specified a JNDI name: ejb/TransitRequest, but this JNDI name does not refer to a stateless session EJB.
         at weblogic.webservice.server.servlet.WebServiceServlet.initLocal()V(WebServiceServlet.java:132)
         at weblogic.webservice.server.servlet.WebServiceServlet.init()V(WebServiceServlet.java:86)
         at javax.servlet.GenericServlet.init(Ljavax.servlet.ServletConfig;)V(GenericServlet.java:258)
         at weblogic.servlet.internal.ServletStubImpl$ServletInitAction.run()Ljava.lang.Object;(ServletStubImpl.java:1018)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Lweblogic.security.subject.AbstractSubject;Ljava.security.PrivilegedAction;)Ljava.lang.Object;(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(Lweblogic.security.acl.internal.AuthenticatedSubject;Lweblogic.security.acl.internal.AuthenticatedSubject;Ljava.security.PrivilegedAction;)Ljava.lang.Object;(SecurityManager.java:118)
         at weblogic.servlet.internal.ServletStubImpl.createServlet()Ljavax.servlet.Servlet;(ServletStubImpl.java:894)
         at weblogic.servlet.internal.ServletStubImpl.createInstances()V(ServletStubImpl.java:873)
         at weblogic.servlet.internal.ServletStubImpl.prepareServlet(Lweblogic.servlet.internal.RequestCallback;)V(ServletStubImpl.java:812)
         at weblogic.servlet.internal.WebAppServletContext.preloadServlet(Ljava.lang.String;)V(WebAppServletContext.java:3281)
         at weblogic.servlet.internal.WebAppServletContext.preloadServlets()V(WebAppServletContext.java:3226)
         at weblogic.servlet.internal.WebAppServletContext.preloadResources()V(WebAppServletContext.java:3207)
         at weblogic.servlet.internal.WebAppServletContext.setStarted(Z)V(WebAppServletContext.java:5737)
         at weblogic.servlet.internal.WebAppModule.start()V(WebAppModule.java:874)
    I'm sure that my EJB is a stateless session bean. Looking at the deployed EJB in the console confirms it.
    I cannot figure out what WL is upset about.
    Does anyone have any advice or know of any resoures on using an existing EJB via a webservice in WL? I did not find any sort of guide, I just pieced this approach together. It seems like it should work, but I'm stuck on this problem.
    I really appreciate any help or advice.
    Thanks,
    Matt

    Using <autotype> and <source2wsdd> to generate what I need. Now WL seems happy.

  • EJB and helper classes ...

    I have created an EJB component which uses
    some helper classes in JDeveloper 3.0 .
    The component deploys sucessfully to OAS 4.0.8.1 . When I try to run the component through an applet ( including the _client.jar
    in the archive tag) , the applet does not find the helper classes . How I do i include the helper classes in the _client.jar file ?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Hi,
    Try to put all the EJB's in a single package and import the package. I
    can think of this solution right now, will keep posting for updates.
    Regards
    Raj
    Daniel Westerdale wrote:
    Hi,
    I have a number of EJBs that each use a common set interfaces,
    exceptions and Value beans. If I deploy using the iasdeploy command
    line, then I must package up all these common classes within each of
    the EJB modules - leading to a lot of duplicate code.
    Is there a smarter a way of packaged the common classes so that I can
    include them in the .EAR file but only in one module.
    Note: I would prefer to only argument the IAS classpath with 3rd party
    classes that rarely change and not these common classes e.g. Jlog
    cheers
    Daniel
    Try our New Web Based Forum at http://softwareforum.sun.com
    Includes Access to our Product Knowledge Base!

  • Warning on Unsaved Changes Functional Pattern --Help!

    Is there anyone out there who knows how to make this work??!!
    [http://www.oracle.com/technology/products/adf/patterns/11.1.1.1.0/UnsavedDataWarning.html]
    Help!

    Frank Nimphius wrote:
    Hi,
    I am not familiar with the document, but options I see are
    option 1: set uncommitted data warning property on the af:document to "on" (I am not sure, but think this is already available in JDeveloper 11g R1)
    option 2: use the controller context (ControllerContext) of the ADFc task flow handler to detect if the transaction is dirty
    option 3: use a managed bean that accesses the AM in the DataControl to check if the transaction is dirty
    FrankThank you for the reply Frank. Below are my response to your options
    response to option1:
    I have already set the uncommitted data warning property on the af:document to "on" (yes, the option is already available in JDeveloper 11g R1) and even set the bounded task-flow inside the region of my page as "critical", but when I navigate to other pages thru the navigation items in my template header, the prompt for uncommited changes did not show.
    response to option2:
    Which class of my project will use the controller context to detect if the transaction is dirty? I have tried to google the uncommittedDataWarning property which lead me to the DirtyPageHandler class. I have read on DirtyPageHandler class API that in case I do not set an implementation the default implementation will be used- and if I me quote from the API -"that default implementation will always return false from isDataDirty and will do nothing in response to a trackNavigation call." I wonder if aren't there any concrete samples to make this work? As I understand, the uncommitted data warnings is one of the publicized new features of JDeveloper 11gR1. Nevertheless, I have tried to follow allong and did create my own implementation:
    1.) I did override the isdataDirty method to always return true,
    2.) override the trackNavigation method to "System.out.println("prompt");",
    3.) and created a file named oracle.adf.view.rich.context.DirtyPageHandler in the META-INF/system folder of my project, and
    4) created a one line text which represents my implementing class in the created file in #3.
    but still nothing especial happened.
    response to option3:
    What exactly is "AM" in the DataControl?
    Your feedback on this is very much appreciated.
    Thanks,
    pino

  • Regex Pattern help.

    Me and my friend pedrofire, that�s probably around forums somewhere, are newbies. We are trying to get a log file line and process correctly but we are found some dificculties to create the right expression pattern.
    My log have lines like:
    User 'INEXIST' with session 'ax1zjd8yEeHh' added content '769' with uri 'http://mail.yahoo.com/'.
    User 'INEXIST' with session 'ax1zjd8yEeHh' changed folder from 'E-mails' to 'Milhagem'.
    User 'INEXIST' with session 'a8jXrY_N38ja' updated all content of folder 'Bancos'.
    i need to get the following data
    USER - [INEXIST]
    SESSION - [ax1zjd8yEeHh]
    ACTION - [added] or [changed] or [updated].
    Getting the user and the session is easy, but i am having difficulties grabing the action, because i need to take just the action word without blank spaces igonring the words content or folder or all.
    I m trying this for hours, but to a newbie is a little dificult
    Any help is welcome
    Thanks
    Peter Redman

    Hi,
    How about something like:
    import java.util.regex.*;
    public class RegexpTest
       private static final Pattern p = Pattern.compile(
             "^User '([^']+)' with session '([^']+)' ([^ ]+) .*$" );
       public static void main( String[] argv )
          find( "User 'INEXIST' with session 'ax1zjd8yEeHh' added content '769' with uri 'http://mail.yahoo.com/'." );
          find( "User 'INEXIST' with session 'ax1zjd8yEeHh' changed folder from 'E-mails' to 'Milhagem'." );
          find( "User 'INEXIST' with session 'a8jXrY_N38ja' updated all content of folder 'Bancos'." );
       public static void find( String text )
          System.out.println( "Text: " + text );
          Matcher m = p.matcher( text );
          if ( ! m.matches() ) return;
          String user = m.group(1);
          String session = m.group(2);
          String action = m.group(3);
          System.out.println( "User: " + user );
          System.out.println( "Session: " + session );
          System.out.println( "Action: " + action );
       }which results in:
    Text: User 'INEXIST' with session 'ax1zjd8yEeHh' added content '769' with uri 'http://mail.yahoo.com/'.
    User: INEXIST
    Session: ax1zjd8yEeHh
    Action: added
    Text: User 'INEXIST' with session 'ax1zjd8yEeHh' changed folder from 'E-mails' to 'Milhagem'.
    User: INEXIST
    Session: ax1zjd8yEeHh
    Action: changed
    Text: User 'INEXIST' with session 'a8jXrY_N38ja' updated all content of folder 'Bancos'.
    User: INEXIST
    Session: a8jXrY_N38ja
    Action: updatedYou should probably change the Pattern to be less explicit about what it matches. i.e. changes spaces to \\s+ or something similar.
    Ol.

  • Generic Proxy pattern - help needed.

    Greetings!
    Lately i have been working on some design architecture to work on possible ways of designing message flows in OSB.
    I found one excellent solution called Generic Proxy pattern at: http://javamaster.wordpress.com/tag/osb/ .
    This pattern consists of four proxy services.
    Actually Generic Proxy pattern and proxy service are different. You can read more about pattern at : http://game-engineering.blogspot.com/2010/03/adapter-pattern-vs-proxy-pattern.html
    My problem is interesting and very straight forward.
    1. I have one proxy service which is created on client side WSDL.
    2. I have one business service created on legacy system WSDL.
    Now, if i want to implement this Generic Proxy pattern, I need to create two more proxy services in between my existing proxy service & existing business service.
    On what basis should these two proxy services should be created?
    Options in OSB to create a proxy service are : WSDL Web Service / Messaging Service / Any SOAP Service / Any XML Service / Business Service / Proxy Service
    If anybody has worked in this pattern, please help.
    Any inputs from everyone are welcome.
    Thanks and Regards,
    Swapnil Kharwadkar.

    The generic proxy service will be of type "messaging service" with input/output type as text/XML.

  • Javax.ejb.CreateException:   "Help.." :)

    i am building two tables the relationship between them is one to many..
    I just created a very simple test code run a JSP to call one of these entity beans.. and I got the Error like this...
    javax.ejb.CreateException: Error creating EntityBean: ORA-01747: invalid user.table.column, table.column, or column specification
    I have checked my Oracle Database and codes seems nothing is wrong.. I actually built this CMB by using JDeveloper 9031 and creating the entity bean from the table directly..
    really no clues with this error now.. :( Help Help :)

    i just created this dummy program to test.. when two tables has realtionship how can i deal with the entity beans..
    StudentHome Interface (part of the codes)
    Student create(Long id, String name, String password, String email, Timestamp date, ClassesLocal classes_class_id) throws RemoteException, CreateException;
    ClassesHome interface(part of the codes)
    Classes create(String class_id, String name, String location, String roomid, String teacherid) throws RemoteException, CreateException;
    my client Servlet (part of the codes)
    try{
    // get My Jobs for this user
    Context ctx = new InitialContext();
    Object jndiRef01 = ctx.lookup("Classes");
    Object portableObj01 = PortableRemoteObject.narrow(jndiRef01, ClassesHome.class);
    ClassesHome ejbHome01 = (ClassesHome) portableObj01;
    System.out.println("00");
    ejbHome01.create("xxx24","xxx24", "xxx24","xxx24","xxx24");
    System.out.println("02");
    Object jndiRef02 = ctx.lookup("Student");
    Object portableObj02 = PortableRemoteObject.narrow(jndiRef01, StudentHome.class);
    StudentHome ejbHome02 = (StudentHome) portableObj02;
    Calendar dd = Calendar.getInstance();
    ejbHome02.create(new Long(11),"11","11","ere", new Timestamp((dd.getTime()).getTime()), ????????????????);
    }catch (Exception e)
    e.printStackTrace();
    =================================================================================
    I used Jdeveloper 9032 IDE and built these two CMPs by mapping from Oracle database directly.... i didnot modify anything for these two CMPs since assume JDeveloper will do the setting for me..
    One of the problems i am facing now is
    what vale (ClassesLocal classes_class_id) should I put when call this create method... this paramter is gennerated by IDE.....
    Student create(Long id, String name, String password, String email, Timestamp date, ClassesLocal classes_class_id) throws RemoteException, CreateException;
    Thanks for your reply.. will check back later

  • Webservice, DAO/Bean Pattern - Help

    All,
    I'm stuck on this one - any help would be much apperciated.
    I'm trying to expose a CFC which uses a DAO/Bean pattern and
    am receiving the following error.
    Could not perform web service invocation "getQuote".
    Here is the fault returned when invoking the web service
    operation:
    AxisFault
    faultCode: {
    http://schemas.xmlsoap.org/soap/envelope/}Server.userException
    faultSubcode:
    faultString: coldfusion.xml.rpc.CFCInvocationException:
    [coldfusion.runtime.UndefinedElementException : Element
    QUOTEDAO is undefined in a Java object of type class
    [Ljava.lang.String; referenced as ]
    Here are my files to give you an idea of what I am working
    with.
    /webservices/application.cfm
    /webservices/quote/quote.cfc (bean)
    /webservices/quote/quoteDAO.cfc (my data access object, has
    crud methods)
    /webservices/quote/quoteService.cfc (service layer, i
    generate my wsdl from this)
    I have unit tested the CFC's by running a test.cfm file
    within the /webservices directory which calls all methods. Works
    fine. Additionally, the WSDL generates fine.
    The problem is when I invoke the service, here is how I am
    invoking it.
    <cfinvoke
    webservice="
    http://localhost/apps/webservices/quote/quoteService.cfc?wsdl"
    method="getQuote"
    returnvariable="Quote">
    <cfinvokeargument name="Quote_ID" value="200"/>
    </cfinvoke>
    It's important to note that within my application.cfm I am
    setting up my quoteDAO and quoteGateway objects within my variables
    scope. I am then setting my quoteService in my application scope,
    like so:
    <cfset variables.quoteDAO =
    createObject("component","apps.webservices.quote.quoteDAO").init(variables.dsn)
    />
    <cfset variables.quoteGateway =
    createObject("component","apps.webservices.quote.quoteGateway").init(variables.dsn)
    />
    <cfset application.quoteService =
    createObject("component","apps.webservices.quote.quoteService").init(variables.quoteDAO,
    variables.quoteGateway) />
    I'm not sure what exactly the error I am receiving is, but
    part of me cringes thinking it might have to do with pathing.
    Any advice?

    Simon,
    Thanks for your reply - I modified the code to manually setup
    those objects in my init like so.
    <cfset variables.dsn = "mydsn" />
    <cfset variables.quoteDAO =
    createObject("component","apps.webservices.quote.quoteDAO").init(variables.dsn)
    />
    <cfset variables.quoteGateway =
    createObject("component","apps.webservices.quote.quoteGateway").init(variables.dsn)
    />
    It solved that initial error but now I am getting:
    Could not perform web service invocation "getQuote".
    Here is the fault returned when invoking the web service
    operation:
    AxisFault
    faultCode: {
    http://schemas.xmlsoap.org/soap/envelope/}Server.userException
    faultSubcode:
    faultString: org.xml.sax.SAXParseException: Premature end of
    file.
    faultActor:
    faultNode:
    Any ideas?

  • Transaction & non-EJB objects (helper)

    hi i have a question about transactional behavior of non-EJB objects. i'm
              using
              weblogic 6.0 sp1 with ejb 2.0.
              say i have a session bean which starts a container managed transaction. and
              it calls
              out to helper class A(non-EJB), and that helper class A get a connection and
              update
              some tables. after A returns, session bean calls helper class B(non-EJB) in
              the
              same transaction. B is supposed to update some other tables but it throw an
              user
              exception. would the transaction in the session bean be rolled back? would
              it
              also roll back the changes made by helper class A?
              thanks for any help,
              z
              

    Thanks Rob!
              "Rob Woollen" <[email protected]> wrote in message
              news:[email protected]...
              > Ziqiang Xu wrote:
              >
              > > hi i have a question about transactional behavior of non-EJB objects.
              i'm
              > > using
              > > weblogic 6.0 sp1 with ejb 2.0.
              > >
              > > say i have a session bean which starts a container managed transaction.
              and
              > > it calls
              > > out to helper class A(non-EJB), and that helper class A get a connection
              and
              > > update
              > > some tables.
              >
              > You must get the JDBC connection from a TxDataSource.
              >
              > > after A returns, session bean calls helper class B(non-EJB) in
              > > the
              > > same transaction. B is supposed to update some other tables but it
              throw an
              > > user
              > > exception. would the transaction in the session bean be rolled back?
              >
              > Merely throwing an exception from a helper class will not rollback the
              > transaction.
              >
              > Within an EJB, the best way to rollback a tx is to use the
              > EJBContext.setRollbackOnly method.
              >
              > So you could do something like this:
              >
              > session_bean_method() {
              >
              > try {
              > B.foo();
              > } catch (MyException e) {
              > ctx.setRollbackOnly();
              > throw e;
              > }
              >
              > }
              >
              > > would
              > > it
              > > also roll back the changes made by helper class A?
              > >
              >
              > If they are all within a single transaction, then yes. As I mentioned
              before,
              > make sure that you use a TxDataSource for all of your JDBC Connections.
              >
              > -- Rob
              >
              > >
              > > thanks for any help,
              > >
              > > z
              >
              

  • Observer Pattern Help

    hi,
    I am trying to understand how and when you would use an observer pattern. I understand that it allows one class to observe another, i.e if a variable was to change in 1 class all observing classes would be notified of the change. I do not understand how u would implement this, I have seen some examples but they are kinda confusing does anybody have a simple way of showing how this pattern is implemented?
    thx
    sbains

    Dish would be the observable in this case. Waiter and Chef are the /
    contain observers. The observer's update method will get called whenever
    the observable calls notifyObservers.
    public class Dish extends Observable {
        public void setStock(int stock) {
            .. business logic ..
            this.setChanged();
            this.notifyObservers(new Integer(stock));
    public class Waiter implements Observer {
        public void update(Observable o, Object arg) {
            Long stock = (Long) arg;
            .. business logic ..
    }Note that Listeners are also implementations of the Observer pattern, if
    that helps any.

  • Visitor Pattern - Help Needed

    In a tree of nodes how can one use Visitor Pattern. If possible please refer some sample code for help
    Thanks

    If your Google isn't broken, try this:
    http://www.google.com/search?q=java+visitor+pattern

  • CFINPUT Reg Expression Validation Pattern Help

    I've got a form with a non-required field that needs to meet
    some validation requirements (Numbers, Letters, 'space character'
    or 'blank, empty string' only) if the user chooses to fill it
    out...
    I'm using CFINPUT tag with the following settings, does my
    Reg Expression pattern look OK?
    REQUIRED="No"
    VALIDATE="regular_expression"
    PATTERN="^[a-zA-Z *]{1,40}$"
    MAXLENGTH="40"
    Thanks for any help. I'm v. new to regular expressions (10
    hrs education at Google Univ.)
    Sincerely,
    Paul Cross

    I think you want something more like this:
    ^[a-zA-Z0-9 ]{0,40}$

  • New to EJB (Server Help Needed)

    I am new to EJB and I'm learning through a few books and online tutorials. The only problem is that when I try to use them, I get errors. I've done some researching and I think it has to do with my server setup. Here is what I have running and successfully configured:
    Apache Web Server
    Tomcat Container
    Java 2 SDK 1.4.0_01
    Java XML Pack (Winter 2002)
    I have Sun Studio 4 installed and I think that it installs J2EE but I'm not sure. Can someone help me understand where to go next? What do I have to install/configure to get the EJBs to work? Thanks, Jeremy

    Hello,
    J2EE is roughly about two things: Web applications beeing build out of Servlets, Jsp and HTML pages and a server-side component modell to deploy business logic in EJBs.
    Now for the Web part (generating dynamic HTML content etc.) you have what you need. Tomcat is doing just find. To deploy EJBs, you need an application server which has an EJB container. I don't know the Studio 4 but my understanding is that it is an IDE helping you to develop software, not an application server. You have to install such an appserver.
    My recommendation: go and download BEAs Weblogic 7.0 (www.beasys.com).This is a commercial product but it comes with a 30 day trial license. BEA provides a rather good online docu. Play with this appserver and deploy some EJBs.
    Alternatively there is also a free appserver: JBoss (www.jboss.org) but I have never used it. Yet, they have also online docu and forums to help you through.
    good luck,
    einar

  • Beginner Factory Pattern help needed please

    hi people,
    Can someone please explain to me in laymans terms what the use of the Factory pattern is. I went to http://www.research.umbc.edu/~tarr/dp/lectures/Factory.pdf
    and it did nit help me too much.
    I'd really appreciate it if someone could give me an abstract example of when the Factory pattern would be useful. The reason I ask is because I am researching into JDO and have come across PersistenceManagerFactory and think I would underdstand this better if I understand Factory's.
    Many thanks.

    Is the reason for the ConnectionHelper to allow us to use that as the return type in the getHelper() method, thus allowing us to have either the OracleConnectionHelper or DB2ConnectionHelper?
    Yes. You want to achieve polymorphism. You are interested in the connect() method, not necessarily what database is used (not the best example in the world, normally you would care as different vendors have slightly different SQL syntax, but assume you were using no triggers, procedures or non-ANSI SQL).
    So, are you basically saying that a Factory is a class that can be used to decide which of the two databases we are going to connect to?
    Depends. In this instance, you name the database you want and the factory is responsible for returning the proper class. In other cases, you might have developed a program that works across databases and only uses one at a time. In this case, you would probably read in a setting at application startup, and the factory would always return the same object type.
    If there is a PersistentManagerFactory, does it mean this would be used to decide what PersistentDataStore we are going to use (i.e. flat file, database, serialised object etc)?
    Again, it depends. You can make your factories 'smart' by deciding where to serialize a given object (say, every domain model object has a method save() and your DAO uses the factory to get a connection to do its work). In other cases, you have a 'bare-bones' factory that simply returns the requested object type. Why go through all that effort? Well, one advantage is that I can put the factory, interface and any implementations in the same package. The only ones that (normally) would need to be public would be the interface and the factory. You can hide the implementation details using the security features of the language.
    Also, why is OracleConnectionHelper a final class?[i]
    In general, I make all variables, method signature parameters and classes final. Once I need to sub-class or re-assign a variable value, I remove the final clause. I can't count the number of times the compiler caught an error (rather than at runtime) because of the additional 'safety' declaring everything final gives you. Only make variables and classes (and method signature variables) non-final when you need to. IMHO, of course.
    - Saish

  • EJB Client  : help

    hi
    when i run client in the local matching it calls EJB correctly,
    but when i try to run EJB client being in remote(another matching in the network) matchin using JNDI it gaves errors like
    Excep in thread "main" no class found error: com/sun/corba/se/org/omg/CORBA/ORB
    .............. ect
    this is my client code
    ============
    //set the classpath to appserver-rt.jar
    import javax.naming.*;
    import mypackage.ejb.HelloHome;
    import mypackage.ejb.Hello;
    import java.util.*;
    public class JNDI{
    public static void main(String args[]) throws Exception{
         Properties props = new Properties();
         props.put("org.omg.CORBA.ORBClass","com.sun.corba.ee.impl.orb.ORBImpl");
         props.put(Context.PROVIDER_URL, "iiop://it0006530:3700"); //room1_svr
         props.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.cosnaming.CNCtxFactory");
         Context ctx = new InitialContext(props);
    Object obj = ctx.lookup("Hello");
         HelloHome home = (HelloHome)obj;
         Hello helloClient = home.create();
         System.out.println("hi " +helloClient.sayHello());
    ========
    plz help me to overcome this task
    nuwan

    first i thank u for the help,
    i exploled the jar.
    there ifound that
    com.sun.corba.ee.impl.orb.ORBImpl class was
    s available but
    "com.sun.jndi.cosnaming.CNCtxFactory" was not
    available in the package. (further ...
    com.sun.jndi was available but
    t cosnaming.CNCtxF was not available)
    but i use the same jar in local and remote computer.
    as u explane, in the local computer, intial conext is
    generated by the application server itself. so it
    dosent give runtime error , isnt it?. correct me if i
    m wrong.
    so then what can i do?
    nuwanI think you're wrong.
    Local or remote computer is not important; same or different virtual machine is important.Creating context from a client in a different VM means inclusion of needed classes in the client classpath.
    Fil

Maybe you are looking for

  • Account based COPA datsource taking long time to extract data

    Hi We have created a Account based COPA datasource but it is not extracting data in RSA3 even though the underlying tables have data in it. If the COPA datasource is created using fields only from CE4 (segment ) and not CE1 (line items ) table then i

  • Gallery and security!

    Yet again Nokia have failed to acknowledge that not all media items on users phones are for all and sundry to see in the gallery. What can I do to either security protect some items (photo's and videos) so that you need a pin to view them or remove t

  • P6 version 6.2 on Citrix Windows 2008 R2

    Hi, We are upgrading our Citrix server OS to Window 2008 R2. Can anyone tell me if this the P6 (version 6.2) run on the OS?

  • UCCX (7.0) Servers gets stuck

    We have UCCX 7.0 in HA mode, one of the server (Primary or Secondary) gets stuck and we have to hard reboot the system and then it comes back to naormal. During this phase CRS administration page on that particular server does not open and even we ca

  • [im - finch] where i can get finch ?

    hi i want to use finch as my instant messege, but it isnt in arch repository i search *.tar.gz version of finch - i didnt seen it only i found *.deb version of finch where i can get finch on my arch linux ? Regards Chris