Configure webapp to use local or remote interface based on environment

Hi,
I have the following problem I am trying to solve (app server is Weblogic 10g by the way).
I have a webapp (war-project) and an ear project containing stateless session beans.
In our development environment I would like to deploy the war and ear separately, because that is easier for development (war-project can then be deployed as a directory, so changes to jsp's and such have immediate effect).
Deploying the war and ear separately means that the war-project can only call the session beans through their remote interfaces. For development this is not a problem.
In a production environment however we would like to package the war INSIDE the ear, so that the webapp can use the local interfaces to call the session beans, as this will improve performance.
So I am looking for a solution where I can configure the way beans are called. Local if the war is inside the ear, remote if the war is separate from the ear. I was thinking along the lines of packaging a properties file with the war that determines the mode (local or remote). Or maybe packaging a different deployment descriptor, if that is a possibility.
This is what I have so far:
Business Interface_
package be.cegeka.test.ejb3.service;
public interface TestService {
     public void doSomething();
Remote Interface_
package be.cegeka.test.ejb3.service;
public interface TestServiceRemote extends TestService {
Local Interface_
package be.cegeka.test.ejb3.service;
public interface TestServiceLocal extends TestService {
Bean implementation_
package be.cegeka.test.ejb3.service;
import javax.ejb.Local;
import javax.ejb.Remote;
import javax.ejb.Stateless;
@Stateless(mappedName="ejb/TestService")
@Local(TestServiceLocal.class)
@Remote(TestServiceRemote.class)
public class TestServiceBean implements TestService {
     @Override
     public void doSomething() {
          System.out.println("I'm doing something");
     @Override
     public void doSomethingLocal() {
          System.out.println("I'm doing something local");
JSF backing bean_
package be.cegeka.test.ui;
public class MyWebAppBackingBean {
     @EJB(mappedName="ejb/TestService", beanInterface=TestServiceRemote.class)
     private TestService testService;
     public String doSmth() {
          testService.doSomething();
          return "success";
}The part that I would like to be configurable is the "+beanInterface=TestServiceRemote.class+" part in the JSF backing bean. Depending on the environment (development vs. production), this should be "+beanInterface=TestServiceRemote.class+" for development and "+beanInterface=TestServiceLocal.class+" for production.
Is something like this possible?
I would like to avoid having to fill my web.xml with ejb-refs and having to do the JNDI-lookups myself if at all possible, to keep things as easy and clean as possible.
Any ideas are welcome!
Steven

Hey Manish,
comments inline.
"manish kumar" <[email protected]> wrote in message
news:1794338.1102557677925.JavaMail.root@jserv5...
So If they are supposed to be in the same JVM -
then
1. the cluster of 3 weblogic servers are three JVMs. So does that meanLOCAL INTERFACES CAN'T BE USED IN CLUSTERED ENVIORONMENT ?
Sure they can, but the calling component in an enterprise app will not call
an intance of the local bean on another node in the cluster. It will make a
by-reference call to the local component in the same EAR. Local interfaces
are not Remote, so they cannot be used with by-value RMI semantics.
>
2. ARE YOU SURE ABOUT THIS FACT THAT THAT LOCAL INTERFACES CAN BE USEDONLY INSIDE THE SAME APPLICATION, I THOUGHT IT CAN BE USED AS LONG AS CLINET
IS IN THE SAME JVM?
PLEASE CONFIRM.........!!!!!!!!!!!!!Dead sure:
http://e-docs.bea.com/wls/docs81/programming/classloading.html#1073506
http://e-docs.bea.com/wls/docs81/ejb/understanding.html#1126831
http://e-docs.bea.com/wls/docs61/ejb/cmp.html#1085452
http://www.theserverside.com/discussions/thread.tss?thread_id=14628
Also, search the ejb newsgroups. I know Rob Woollen has addressed this in
here somewhere. And, if Rob says it's so, trust me, it's so.
Bill

Similar Messages

  • Using local session bean interface from web container using EJB 3.0

    Hi,
    How can you use a local session bean interface from Java (rather than data controls) in a web container using EJB 3.0?
    I can use a remote interface by looking up InitialContext, but I can't find a local interface this way (even from another session EJB). I can use a local interface from an EJB using annotation "EJB", but as I understand, this is not available in the web container.
    If I try to add an ejb-jar.xml file, these seems to mess up by project...
    Hope you can help.
    Roger

    The portable way to retrieve an EJB reference in Java EE is to either inject it or look it up via the
    component's private naming environment. The simplest way is :
    @EJB
    private DocumentManager dm;
    The global JNDI name is only used as an implementation specific way to uniquely assign an
    identifier to a specific Remote EJB. It's best for this not to appear directly in the source code.
    There's more on global JNDI names in our EJB FAQ :
    https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html
    The alternative to annotations is to use an ejb-ref to declare the ejb dependency. The ejb-ref
    is declared in the standard deployment descriptor corresponding to the component doing the
    lookup. Each ejb-ref has an ejb-ref-name, e.g. <ejb-ref-name>DM_ref</ejb-ref-name>
    The code looks up the ejb-ref-name relative to the java:comp/env namespace to retrieve the
    EJB reference.
    DocumentManager dm = (DocumentManager)
    new InitialContext().lookup("java:comp/env/DM_ref");

  • Steps to setup and configure Node Manager on local and remote machine

    Hello,
    I am using WLS 10.3 on Windows.
    I have two machines, One cluster and two managed servers (one on each machine) created under a domain. I have used configuration wizard to create the domain.
    I have gone through documents on Node Manager and found what to configure. But I have not found when to configure. In other words I want to know what is the sequence of steps if I have to set Node Manager on my local machine (in which domain exists) and on remote machine.
    Please let me know the sequence of steps I need to follow to set and configure the Node Manager on local and remote machine. I want to use Java Node Manager (not the Script node manager).
    Thanks,
    Sanjay

    Hello,
    Ok, let me tell you what I have done till now.
    1) Installed WebLogic 10.3 on machine A (local machine, on which I have created domain and my Admin Server is running. Also Managed Server 1 is created on this machine).
    2) Installed WebLogic 10.3 on machine B (remote machine, on which Managed Server 2 will be created).
    3) On machine A I used the configuration wizard and create a domain. While creating the domain I did the following:
    i) Created two managed servers.
    ii) Created a cluster
    iii) Assigned Servers to cluster.
    iv) Created two machines.
    v) Assigned servers to machines (Admin Server and MS_1 to machine A and MS_2 to machine B).
    4) Sarted Admin Server.
    5) On the Admin Console I made some configurations for the Node Manager on Machines -> Machine A -> Node Manager. Assigned the values:
    i) Type (SSL)
    ii) Listen Address (IP_Address of machine A)
    iii) Listen Port (5556)
    6) Similarly did for Machine B.
    So till now phsically the managed server (MS_2) directory and configuration is not there on Machine B (its only configured on machine A because I created the domain on Machine A).
    Now I want install/configure/setup NM on both the machines. Start my both the managed servers using Admin Console (which will use the node managers).
    What are the sequence of steps I need to follow my task?
    Any help and suggestions are welcome with warm regards.
    Thanks,
    Sanjay

  • Local versus remote interface

    Hello
    i'm working with Bea weblogic 8.1 sp1. We are now looking to change our remote
    interface into locale interface to avoid serialization. But someone tell me that
    bea weblogic already manage remote interface as local interface if we are inside
    a ear application deploy on one server !
    I look in Bea documentation but i was not able to find anything that confirm this.
    Do someone know abou this!!!!!

    If by serialization you mean call-by-value, then take a look at
    enable-call-by-reference. You can avoid the cost of copying by setting this
    to true. Otherwise, the default value is false.
    "Benjamin Léonard" <[email protected]> wrote in message
    news:[email protected]..
    >
    Hello
    i'm working with Bea weblogic 8.1 sp1. We are now looking to change ourremote
    interface into locale interface to avoid serialization. But someone tellme that
    bea weblogic already manage remote interface as local interface if we areinside
    a ear application deploy on one server !
    I look in Bea documentation but i was not able to find anything thatconfirm this.
    Do someone know abou this!!!!!

  • Using EJBObject as remote interface

    Hello all,
    I'm trying to make an ejb session available for web services. I see that we must create an interface similar to the EJBObject, but that simply extends Remote, to get the web service. So I tried to use the EJBObject (which extends Remote) directly in the wscompile to get the wsdl. Unfortunalety I get the following error message that I don't understand:
    error: type cannot implement remote: javax.ejb.EJBHome
    Can someone explain the problem ? And btw, I don't have any problem when I create a copy of my EJBHome and simply extends Remote instead of EJBHome. So why to I have to duplicate the same code in 2 separate classes ?
    Thanks for the help
    This works:
    public interface OperatorGroupCommands extends Remote {
    public void modify(OperatorGroup operatorGroup) throws RemoteException;
    This doesn't work:
    public interface OperatorGroupCommands extends javax.ejb.EJBObject {
    public void modify(OperatorGroup operatorGroup) throws RemoteException;

    I am having the same problem.
    I am try to use web service security in the sun j2ee 1.4 application server. I noticed that web services built from servlets work just fine, but web services built from ejbs do not work so well.
    I tried to deploy an ejb and the security stuff appears in the deploytool when I extend EJBObject. When I extend java.rmi.Remote, the stuff does not show up.
    Did you ever solve this problem?

  • How to configure physical channel using DAQmx block(remote PXI6733)

    I am trying to run the example in labview that use DAQmx. But I find I can't find the physical channel by browser or using DAQ assisstant. It reports "No supported device found". My PXI6733 is on a controller and communicate with host computer by TCP/IP. Could I use DAQmx in such environment? What I should do to find the physical channel?

    Braver,
    The NI 6733 is not yet support by NI-DAQmx. Thus, you will need to use Traditional NI-DAQ to program this device until this support is added. I would suggest that you examine the following Traditional NI-DAQ examples:
    Examples >> Hardware Input and Output >> Traditional DAQ >> Analog Output
    Good luck with your application.
    Spencer S.

  • ClassCastException by using Local Interface of EJB in other, but local EAR

    Hi,
    I get a ClassCastException if I try to cast the EJSWrapper-Class returned from local EJB Lookup to the interface it implements.
    The environment I use is WSADIE 5.1.1 with integrated Testenvironment.
    I have defined two EARs. One with a Web-Application and one wich contains the EJB to call from the WebApp. Both run in the same appserver instance wich means both run in the same JVM and i should be able to use Local Interface of the EJB.
    The EJB should use Libraries from the Server Environment while the WebApp uses newer Libs than the Server Environment offers(eg axis-rpc,wsdl4j,saaj). The Classloader-Policy of the EAR with the WebApp is set to PARENT_LAST while the Classloader-Policy of the EAR with the EJB is set to PARENT_FIRST.
    I do a Lookup by using an EJB-Local-Reference. The returned object is an EJSLocalStatelessHome-Object, wich implements my LocalEJBInterface. But if i try to cast to Object to this interface a ClassCastException occurs.
    The Classes of the EJB are packaged as follows:
    EJBName.jar contains the EJB-Impl class, the Serverside Implementations for RMI/IIOP interaction an EJSWrapper classes. This jar is packaged with the EJB-EAR.
    EJBClient.jar contains the Local- and Remote-Interface classes and the Stub-classes for EJBHome and EJB-Implementation. This jar is packaged wich both EARs, because of the interfaces, wich are needed in both projects.
    The Classloader of the EAR with the WebApp has no access the jar with the EJB-Impl, the generated Ties- and EJSWrapperclasses because it is located in only the EJB-EAR. But the interface-class is contained in the WebApp-EAR as described above.
    The exact Exception is as follows:
    java.lang.ClassCastException: com/ibm/wsrf/EJSLocalStatelessBPEAdapterHome_c2546ef5 incompatible with com/ibm/wsrf/BPEAdapterLocalHome
    java.lang.Throwable.<init>(Throwable.java)
    java.lang.Throwable.<init>(Throwable.java)
    java.lang.ClassCastException.<init>(ClassCastException.java:53)
    org.tempuri.ResourceDiscoveryService.DiscoverySoapHttpBindingImpl.getResourceEPR(DiscoverySoapHttpBindingImpl.java)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java)
    ... The EJSLocalStatelessBPEAdapterHome_c2546ef5 implements the BPEAdapterLocalHome interface.
    Please, can anyone give me a hint how to solve this problem?
    Thanks in advance, Michael

    Problem solved!
    The different EAR contained each an own copy of the jar with the local and remote interfaces of the EJB. The Problem is caused by the separate classloaders of the EARs in an application server. Each EAR Classloader loads his own version of the interface classes. Is the same class loaded by different classloaders, the JVM handles this classes as different classes. An example if you create an instance of a class in one classloader and try to reference the created instance by the same class from another classloader, the association will fail, because of different classloaders in the same JVM.
    The solution in an application server where you have deployed two projects and want to use local interfaces is, store the interfaces(and only the interfaces) in an directory, where it is found by the parent classloader of the EAR classloaders. Remove the Jar with the interface from the EARs. The EAR Classloaders will then search in the their parent classloader for the interfaces. The interfaces will be loaded by the parent classloader and will recognized as compatible by the JVM.
    Greetings, hope this helps help others!
    Michael

  • Local Interfaces in WebLogic 7.0 Not Faster Than Remote Interfaces?

    I was curious how much faster calling business methods in
    a stateless session EJB in WebLogic 7.0 would be through
    a local interface than calling the same business methods
    through a remote interface. I timed both ways of calling
    the same methods and much to my surprise the times were
    nearly identical. I double-checked that in one case I really
    used the local interface (using ejb-local-ref, local-jndi-name,
    local interfaces in source code). Does anybody (perhaps from
    BEA) have an explanation for this? By the way, I ran the
    same experiment with other J2EE application servers such
    as IBM's WebSphere 5 (Beta) and there was a tremendous
    performance difference between local and remote interface
    usage.
    Thanks,
    Reinhard

    "Reinhard Klemm" <[email protected]> wrote in message
    news:[email protected]...
    I appreciate your response and, at the same time, I am somewhat
    surprised about it. Here are the reasons for my surprise:
    1. Your response indicates that WebLogic uses RMI for
    EJB local method calls, i.e., even if the client is on the same VM.
    I would have assumed that WebLogic would bypass RMI in such
    a situation.That is not what I said. Local interfaces wont use rmi.
    But remote interfaces do better if the call is from the same VM. This is
    weblogic rmi optimization. Please see Rob's posting also.
    2. Other J2EE application servers fare a lot better. In one
    experiment, I timed WebLogic against WebSphere 5.0 Technology
    for Developers (i.e., WebSphere 5.0 Beta, which is expressly
    NOT for performance testing) and against the Sun Reference
    Implementation. Here are the numbers for calling business
    methods in a stateless session EJB through its local interface:
    WebLogic: 5.15 ms on the average
    WebSphere: 0.41 ms on the average
    Sun Reference Implementation: 0.11 ms on the average
    This indicates to me that both WebSphere and the Sun Reference
    Implementation are better optimized than WebLogic by excluding
    RMI when making local EJB calls.
    Reinhard
    "Maruthi Nuthikattu" <[email protected]> wrote in message
    news:<[email protected]>...
    Can you post some numbers so that we can visualize the difference.
    Please add the numbers with other J2EE appserver also.
    Otherwise top of my head, the reason is:
    Weblogic rmi is well optimized for the calls with in the same JVM andsame
    J2EE application.
    This could be the reason you are not seeing much difference.
    ..maruthi
    "Reinhard Klemm" <[email protected]> wrote in message
    news:[email protected]...
    I was curious how much faster calling business methods in
    a stateless session EJB in WebLogic 7.0 would be through
    a local interface than calling the same business methods
    through a remote interface. I timed both ways of calling
    the same methods and much to my surprise the times were
    nearly identical. I double-checked that in one case I really
    used the local interface (using ejb-local-ref, local-jndi-name,
    local interfaces in source code). Does anybody (perhaps from
    BEA) have an explanation for this? By the way, I ran the
    same experiment with other J2EE application servers such
    as IBM's WebSphere 5 (Beta) and there was a tremendous
    performance difference between local and remote interface
    usage.
    Thanks,
    Reinhard

  • How to deside weather to write local interface or remote interface

    Hi All.
    in Ejb 2.0 the concept of local and remote interface is introduced.then how to deside weather to wrire local interface or to write remote interface.
    thanks

    Here in lies the problem. That decision shouldn't be up to a developer, it should be the role of the deployer who decides this. I think they got this wrong in 2.0, its been put at the wrong level. You as the coder need to make scalability decisions about the deployment, which you shouldn't need to. One of the big stengths of the EJB's is that anyone can code them because the container does the hard work for you. That paradigm has been broken now, IMHO.
    Having said that, I was at a SUN developer day just the other day and they suggested that the local interface was mainly for fine grained entity beans and that the course grained entity beans would access the fine grained over local interfaces thus allowing a 'cheaper' implementation of relationship modeling in the entity bean layer. In this scheme of things you would then use the remote interface from session beans to access the course grain entity beans.
    Cheers,
    Peter.

  • How to use the same services-config for the local and remote servers.

    My flex project works fine using the below but when I upload my flash file to the server I doesn't work, all the relative paths and files are the same execpt the remote one is a linux server.
    <?xml version="1.0" encoding="UTF-8"?>
    <services-config>
        <services>
            <service id="amfphp-flashremoting-service"
                class="flex.messaging.services.RemotingService"
                messageTypes="flex.messaging.messages.RemotingMessage">
                <destination id="amfphp">
                    <channels>
                        <channel ref="my-amfphp"/>
                    </channels>
                    <properties>
                        <source>*</source>
                    </properties>
                </destination>
            </service>
        </services>
        <channels>
        <channel-definition id="my-amfphp" class="mx.messaging.channels.AMFChannel">
            <endpoint uri="http://localhost/domainn.org/amfphp/gateway.php" class="flex.messaging.endpoints.AMFEndpoint"/>
        </channel-definition>
        </channels>
    </services-config>
    I think the problem  is the line
            <endpoint uri="http://localhost/domainn.org/amfphp/gateway.php" class="flex.messaging.endpoints.AMFEndpoint"/>
    but I'm not sure how to use the same services-config for the local and remote servers.

    paul.williams wrote:
    You are confusing "served from a web-server" with "compiled on a web-server". Served from a web-server means you are downloading a file from the web-server, it does not necessarily mean that the files has been generated / compiled on the server.
    The server.name and server.port tokens are replaced at runtime (ie. on the client when the swf has been downloaded and is running) not compile time (ie. while mxmlc / ant / wet-tier compiler is running). You do not need to compile on the server to take advantage of this.
    Hi Paul,
    In Flex, there is feature that lets developer to put all service-config.xml file configuration information into swf file. with
    -services=path/to/services-config.xml
    IF
    services-config.xml
    have tokens in it and user have not specified additional
    -context-root
    and this swf file is not served from web-app-server (like tomcat for example) than it will not work,
    Flash player have no possible way to replace token values of service-config.xml file durring runtime if that service-config.xml file have been baked into swf file during compilation,
    for example during development you can launch your swf file from your browser with file// protocol and still be able to access blazeDS services if
    -services=path/to/services-config.xml
    have been specified durring compilation.
    I dont know any better way to exmplain this, but in summary there is two places that you can tell swf  about service confogiration,
    1) pass -services=path/to/services-config.xml  parameter to compiler this way you tell swf file up front about all that good stuff,
    or 2) you put that file on the webserver( in this case, yes you should have replacement tokens in that file) and they will be repaced at runtime .

  • [Forum FAQ] How to install and configure Windows Server Essentials Experience role on Windows Server 2012 R2 Standard via PowerShell locally and remotely

    As we all know,
    the Windows Server Essentials Experience role is available in Windows Server 2012 R2 Standard and Windows Server 2012 R2 Datacenter. We can add the Windows Server
    Essentials Experience role in Server Manager or via Windows PowerShell.
    In this article, we introduce the steps to install and configure Windows
    Server Essentials Experience role on Windows Server 2012 R2 Standard via PowerShell locally and remotely. For better analyze, we divide this article into two parts.
    Before installing the Windows Server Essentials Experience Role, please use
    Get-WindowsFeature
    PowerShell cmdlet to ensure the Windows Server Essentials Experience (ServerEssentialsRole) is available. (Figure 1)
    Figure 1.
    Part 1: Install Windows Server Essentials Experience role locally
    Add Windows Server Essentials Experience role
    Run Windows PowerShell as administrator, then type
    Add-WindowsFeature ServerEssentialsRole cmdlet to install Windows Server Essentials Experience role. (Figure 2)
    Figure 2.
    Note: It is necessary to configure Windows Server Essentials Experience (Post-deployment Configuration). Otherwise, you will encounter following issue when opening Dashboard.
    (Figure 3)
    Figure 3.
      2. Configure Windows Server Essentials Experience role
    (1)  In an existing domain environment
    Firstly, please join the Windows Server 2012 R2 Standard computer to the existing domain through the path:
    Control Panel\System\Change Settings\”Change…”\Member of. (Figure 4)
    Figure 4.
    After that, please install Windows Server Essentials Experience role as original description. After installation completed, please use the following command to configure Windows
    Server Essentials:
    Start-WssConfigurationService –Credential <Your Credential>
    Note: The type of
    Your Credential should be as: Domain-Name\Domain-User-Account.
    You must be a member of the Enterprise Admin group and Domain Admin group in Active Directory when using the command above to configure Windows Server Essentials. (Figure 5)
    Figure 5.
    Next, you can type the password for the domain account. (Figure 6)
    Figure 6.
    After setting the credential, please type “Y” to continue to configure Windows Server Essentials. (Figure 7)
    Figure 7.
    By the way, you can use
    Get-WssConfigurationStatus
    PowerShell cmdlet to
    get the status of the configuration of Windows Server Essentials. Specify the
    ShowProgress parameter to view a progress indicator. (Figure 8)
    Figure 8.
    (2) In a non-domain environment
    Open PowerShell (Run as Administrator) on the Windows Server 2012 R2 Standard and type following PowerShell cmdlets: (Figure 9)
    Start-WssConfigurationService -CompanyName "xxx" -DNSName "xxx" -NetBiosName "xxx" -ComputerName "xxx” –NewAdminCredential $cred
    Figure 9.
    After you type the commands above and click Enter, you can create a new administrator credential. (Figure 10)
    After creating the new administrator credential, please type “Y” to continue to configure Windows Server Essentials. (Figure 11)
    After a reboot, all the configurations will be completed and you can open the Windows Server Essentials Dashboard without any errors. (Figure 12)
    Figure 12.
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

    Part 2: Install and configure Windows Server Essentials Experience role remotely
    In an existing domain environment
    In an existing domain environment, please use following command to provide credential and then add Server Essentials Role: (Figure 13)
    Add-WindowsFeature -Name ServerEssentialsRole
    -ComputerName xxx -Credential DomainName\DomainAccount
    Figure 13.
    After you enter the credential, it will start install Windows Server Essentials role on your computer. (Figure 14)
    Figure 14.
    After the installation completes, it will return the result as below:
    Figure 15.
    Next, please use the
    Enter-PSSession
    cmdlet and provide the correct credential to start an interactive session with a remote computer. You can use the commands below:
    Enter-PSSession –ComputerName
    xxx –Credential DomainName\DomainAccount (Figure 16)
    Figure 16.
    Then, please configure Server Essentials Role via
    Add-WssConfigurationService cmdlet and it also needs to provide correct credential. (Figure 17)
    Figure 17.
    After your credential is accepted, it will update and prepare your server. (Figure 18)
    Figure 18.
    After that, please type “Y” to continue to configure Windows Server Essentials. (Figure 19)
    Figure 19.
    2. In a non-domain environment
    In my test environment, I set up two computers running Windows Server 2012 R2 Standard and use Server1 as a target computer. The IP addresses for the two computers are as
    below:
    Sevrer1: 192.168.1.54
    Server2: 192.168.1.53
    Run
    Enable-PSRemoting –Force on Server1. (Figure 20)
    Figure 20.
    Since there is no existing domain, it is necessary to add the target computer (Server1) to a TrustedHosts list (maintained by WinRM) on Server 2. We can use following command
    to
    add the TrustedHosts entry:
    Set-Item WSMan:\localhost\Client\TrustedHosts IP-Address
    (Figure 21)
    Figure 21.
    Next, we can use
    Enter-PSSession
    cmdlet and provide the correct credential to start an interactive session with the remote computer. (Figure 22)
    Figure 22.
    After that, you can install Windows Server Essentials Experience Role remotely via Add-WindowsFeature ServerEssentialsRole cmdlet. (Figure 23)
    Figure 23.
    From figure 24, we can see that the installation is completed.
    Figure 24.
    Then you can use
    Start-WssConfigurationService cmdlet to configure Essentials Role and follow the steps in the first part (configure Windows Server Essentials Experience in a non-domain environment) as the steps would be the same.
    The figure below shows the status of Windows Server Essentials.
    Figure
    25.
    Finally, we have successfully configured Windows Server Essentials on Server1. (Figure 26)
    Figure 26.
    More information:
    [Forum
    FAQ] Introduce Windows Powershell Remoting
    Windows Server Essentials Setup Cmdlets
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

  • No performance gain when using local interfaces

    Hello,
    I'm doing some tests to compare performances between remote ejb interfaces and local ejb interfaces.
    I have two stateless session beans EJB1 and EJB2, EJB1 calls a method on EJB2, this method receives one object as the only parameter and returns it immediately. The parameter is a big object (~700ko). My test consists simply of making 1000 calls from EJB1 to EJB2, one time with remote interfaces, one time with local interface. For both tests, the EJBs run in the same container, same VM.
    The results show absolutely no differences between the remote and the local interface !
    As I found these results a bit surprising, I changed the serialization method of my parameter object this way:
    private void writeObject(java.io.ObjectOutputStream out) throws IOException {
    System.out.println("writeObject(MyBigObject)");
    out.defaultWriteObject();
    just to check if my object is serialized when using remote interface. And the response is no.
    So question is: is there an "undocumented optimization" of the stub/skel generated by weblogic which make local calls when calling a remote method inside the same VM ?
    Some precisions:
    - I'am using weblogic 8.1sp2
    - When calling remotely my EJB2 from an external batch (running in a separate VM), I see the message "writeObject(MyBigObject)" so the serialization is done in this case.

    <Fr?d?ric Chopard> wrote in message news:[email protected]..
    So question is: is there an "undocumented optimization" of the stub/skel generated by weblogic which make local calls when callinga remote method inside the same VM ?
    >
    Some precisions:
    - I'am using weblogic 8.1sp2
    - When calling remotely my EJB2 from an external batch (running in a separate VM), I see the message "writeObject(MyBigObject)" sothe serialization is done in this case.
    WebLogic 5.x, 6.x and 7.x do call by reference for co-located EJBs by default. 8.1 has this behavior turned off by default. You may
    experience call-by-reference optimization in 8.1 only if it has been turned on explicitly in the deployment descriptor.
    Hope this helps.
    Regards,
    Slava Imeshev

  • Remote Interface problem using Sun ONE App & web server

    HI,
    1) I am using an S'less SB. I have local & remote interfaces. I am using the sun one appserver7 & the sun ones's htttp server. By default it doesnt pick up the remote interfaces is it ? How do i make my remote interfaces work ? what are the changes required in config/xml ?
    2) However i changed my client code (i.e my action class which is called by the struts action servlet ) to access the localhome rather than the remote home, but then i get java.lang.classcastexception.
    pls help !
    sanjay

    Hi parsuram,
    Thanks for the tip. After looking at the sample source code, I did finally figure out the solution - so I'll post it in case anyone else happens to be working with websphere studio has the same issue deploying on sun one.
    To access local interface ejb, you must have the following
    1. ejb-local-ref tag in the ejb-jar.xml like so underneath the <session> or <entity> tag of the bean which you plan to access the local ejb with.
    <ejb-local-ref>
    <ejb-ref-name>TestL</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <local-home>memory.simple.TestLLocalHome</local-home>
    <local>memory.tool.simple.TestLLocal</local>
    <ejb-link>TestL</ejb-link>
    </ejb-local-ref>
    2. similar ejb-ref tag in sun-ejb-jar.xml
    <ejb-ref>
    <ejb-ref-name>TestL</ejb-ref-name>
    <jndi-name>localejbs/module_memory.betaEJB/TestL68640023372300293</jndi-name>
    </ejb-ref>
    note: sun generates the <jndi-name> and overwrites whatever you put in that tag no matter what you put in there.
    3. here is the code to access
    Context initial = new InitialContext();
    TestLLocalHome tlHome=(TestLLocalHome) Initial.lookup
    ("TestL");
    //the string must match <ejb-ref-name> underneath <ejb-local-ref>
    4. note that the jndi name for the local interface bean becomes irrelevant. only the <ejb-ref-name> in the ejb-jar and sun-ejb-jar matter. furthermore, both <ejb-ref-name> must be the same or you won't be able to deploy.
    5. This is completely my fault for not checking the "proper" way to access local interfaces. in websphere, they let you get away without the ejb-ref tags and just use the string "local:/TestL"!
    -matt

  • How to use local interface in my easy code ?

    hi everybody
    I work on an ejb project. My code is like that to test remote interface (and it works) :
    public class TestStudent {
       Properties properties;
       public TestStudent() {
          properties = new Properties();
          properties.put("java.naming.factory.initial",
          "org.jnp.interfaces.NamingContextFactory");
          properties.put("java.naming.factory.url.pkgs",
          "org.jboss.naming:org.jnp.interfaces");
          properties.put("java.naming.provider.url", "jnp://localhost:1099");
          properties.put("jnp.disableDiscovery", "true");
       public static void main(String[] args) {
          TestStudent beanStudent = new TestStudent();
          beanStudent.createBean();
       public void createBean() throws EJBException {
          try {
             InitialContext context = new InitialContext(properties);
             Object object = context.lookup(StudentHome.JNDI_NAME);
             StudentHome studentHome = (StudentHome) PortableRemoteObject.narrow(object,StudentHome.class);
             Student student = studentHome.create();
             student.setName("pirlouit");
             System.out.println(student.getId());
             System.out.println(student.getName());
          } catch (NamingException e) {
             throw new EJBException(e);
          } catch (RemoteException e) {
             throw new EJBException(e);
          } catch (CreateException e) {
             throw new EJBException(e);
    }Then I do quite the same thing to test local interface like in the following code but it doen't work :
    public class TestStudent {
       Properties properties;
       public TestStudent() {
          properties = new Properties();
          properties.put("java.naming.factory.initial",
          "org.jnp.interfaces.NamingContextFactory");
          properties.put("java.naming.factory.url.pkgs",
          "org.jboss.naming:org.jnp.interfaces");
          properties.put("java.naming.provider.url", "jnp://localhost:1099");
          properties.put("jnp.disableDiscovery", "true");
       public static void main(String[] args) {
          TestStudent beanStudent = new TestStudent();
          beanStudent.createBean();
       public void createBean() throws EJBException {
          try {
             InitialContext context = new InitialContext(properties);
             Object object = context.lookup(StudentLocalHome.JNDI_NAME);
             StudentLocalHome studentLocalHome = (StudentLocalHome)object;
             System.out.println("studentLocalHome is null ? "+studentHome.equals(null));
             StudentLocal student = studentLocalHome.create();
             student.setName("pirlouit");
             System.out.println(student.getId());
             System.out.println(student.getName());
          } catch (NamingException e) {
             throw new EJBException(e);
          } /*catch (RemoteException e) {
             throw new EJBException(e);
          }*/ catch (CreateException e) {
             throw new EJBException(e);
    }The print of "student local home is null ?" give me 'true' which is not the answer I want ... so here is the problem. How can I get my entity bean using local interface ?
    For the moment 've got the exception (which appears on instruction "StudentLocal student = studentLocalHome.create();") :
    Exception in thread "main" java.lang.NullPointerException
         at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:118)
         at $Proxy0.create(Unknown Source)Please help !! Thank you very much !

    Write a JSP to test Local Interface. You cannot call Local Interface from a remote JVM.
    Jay
    http://www.javarss.com - Java News from around the world.
    Visit JavaRSS.com and add above signature to your messages. Thanks!

  • Get a remote interface from a local instance

    hi,
    I want to construct a bean locally on a server and then I want to pass the remote interface for that constructed bean back to a client. Is this possible?
    Thanks

    Yes. Take a look at SessionContext class. You can't construct a bean yourself, as its life is managed by container.
         * Obtain an object that can be used to invoke the current bean through
         * the given business interface.
         * @param businessInterface One of the local business interfaces
         *        or remote business interfaces for this session bean.
         * @return The business object corresponding to the given business
         *         interface.
         * @exception IllegalStateException Thrown if this method is invoked
         *         with an invalid business interface for the current bean.
        <T> T getBusinessObject(Class<T> businessInterface) throws IllegalStateException;

Maybe you are looking for