What ways of communication between two java apps you know?

Hi all
Lame (but not for me) question.
I have two java applications (first is web-app unning on server (tomcat or JBoss) and second is a standalone java app). Both are running on different JVM and both have to communicate with each other quite often - but mainly: the second one is going to pass results of its work to the first one.
What way of communication would you suggest?
Ps. I'm free to choose frameworks and overall architecture.
Regards
Grzesiek

YoungWinston wrote:
Blimey. That's a question and a half; and the answer will likely depend on what you need to do/send.
For straight messaging, there's JMS, but for more esoteric stuff you might want to involve a database, so you may want to look at JDBC (or even something like Hibernate). EJBs generally use servlets, or there's also straight HTTP, even raw sockets.
I suspect to need to rein in your question a bit and come up with some specifics.
Winston
Edited by: YoungWinston on Jan 13, 2011 5:26 PM
Too slow, as usual :-)So:
Blimey. That's a question and a half; and the answer will likely depend on what you need to do/send.Plain text, just statements ;)
For straight messaging, there's JMS, but for more esoteric stuff you might want to involve a database, so you may want to look at JDBC (or even something like Hibernate).Yes, JMS is what might solve my problem. Even if there will be any database(?), the only ones I would be considering are H2, Derby, HSQLDB.
I suspect to need to rein in your question a bit and come up with some specificsA little more details? Ok....
Firstly, ordinary user via web app creates text file, and when it's ready - starts second app in separate JVM (separate JVM is needed due to risk of OutOfMemoryError or any other crashes).
Second app (standalone) is going to process this file (it might take hours/days/weeks) and inform web-app about his progress (about 5 messages per minute).
Of course all those messages are going to be saved in log file/ database (log file should be easier way to go).
Note that many standalone instances of second app are going to be run simultaneously (I think that this is the place to use some database - to store info about all instances: whether they finished successfully or not: eg. due to some crashes)
Thanks for you time and effort
All of You helped me already ;)

Similar Messages

  • Communication between two portlets - Java Portlet JSR168

    Communication between two portlets
    Hi All,
    i want to be question how do communication between two portlets. Exam:
    I have 2 portlets in a portal together: a Menu portlet & a Content portlet, now i want when i click to an link of portlet Menu then my Content portlet will get param from link that.
    i'm develop by Oracle Jdeveloper tool & OracleAS 10g.
    Thank a lot !

    Hello,
    I assume you are not using Weblogic Portal, correct? If you are using Weblogic Portal, you could use events to communicate between two JSR168 portlets, but this only works in Weblogic Portal.
    If you are not using Weblogic Portal, the only way to communicate between two JSR 168 portlets is to put an attribute in the session in one portlet, and retrieve it from the session in the other portlet. For example, to set a value in your Menu portlet, given a javax.portlet.PortletRequest variable "request", and an object you want to send to the content portlet in the variable "menuChoice":
    javax.portlet.PortletSession session = request.getPortletSession(true);
    session.setAttribute("menuChoice", menuChoice, javax.portlet.PortletSession.APPLICATION_SCOPE);
    Then, in your content portlet to retrieve the value of the menuChoice variable you would do this:
    javax.portlet.PortletSession session = request.getPortletSession(true);
    Object menuChoice = session.retAttribute("menuChoice", javax.portlet.PortletSession.APPLICATION_SCOPE);
    Kevin

  • Communication between two MVC's

    Hi.
    I want a communication between two MVC's, offcourse in one project.
    What I have:
    MainWindowView (MVC)
      |
      +--> MenuView (MVC)In my Menu MVC there is a button Logout. When this one is pressed the model had to tell the MainWIndowView that he can close.
    How can I do this?
    Statix.

    I have a solution... but I don't know if this is a neat one..
    This is my MenuModel:
              case 3:
                   MainWindowController.closeMainWindow();
                   LoginModel loginModel = new LoginModel();
                   LoginController loginController = new LoginController(loginModel);
                   break;
              ...This one communicates directly with a public static void closeMainWindow () method which disposes the view (JFrame)
         public static void closeMainWindow (){
              mvcView.dispose();
         }     Is this a solution so I stick to the MVC pattern??? I hope so... I wouldn't know another way...
    Thanks in advance!

  • Communication between two clients

    In Java Networking, communication between server-client or bwtween server-multiple clients is general. But How will be the communication between two cients, means two clients can send & receive messages to & from each other(being guided by server).

    Sorry,
    I didn't get your reply clearly.
    I want, if Server is running, and two clients(two instance of a same program) are opened, whatever message(string)client1 send to Server,then the Server needs to send those to client2.Again, the some response should come from client2 to client1 thru Server.
    How can I implement this?
    If you have idea, or some sample code about this, please let me know.
    Regards.

  • Communication between two Macs Server

    Communication between two Macs Server:
    Can they work together and communicate and interact normally in a PowerMac network, OS X 10.5.8 Server installed, and a MacPro computer that is running Server 4.0.3 on Yosemite? Had to do some additional implementation?
    Regards

    from the JavaDocs:
    http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/ServletContext.html
    getContext
    public ServletContext getContext(java.lang.String uripath)
    Returns a ServletContext object that corresponds to a specified URL on the server.
    This method allows servlets to gain access to the context for various parts of the server, and as needed obtain RequestDispatcher objects from the context. The given path must be begin with "/", is interpreted relative to the server's document root and is matched against the context roots of other web applications hosted on this container.
    In a security conscious environment, the servlet container may return null for a given URL.
    Parameters:
    uripath - a String specifying the context path of another web application in the container.
    Returns:
    the ServletContext object that corresponds to the named URL, or null if either none exists or the container wishes to restrict this access.
    See Also:
    RequestDispatcher

  • Communication between Two WebLogic instances on the same machine

    Hi,
    We're having a problem with communication between two copies of Weblogic on
    the same machine. They are configured with seperate ports (regular and SSL).
    Independantly, they run fine. I can access EJBs running on either of them.
    The problem is that a bean in one of them has code which attempts to access
    an EJB on the other one. The procude fails when trying to obtain the initial
    context. This same code works if compilied independantly of WebLogic on the
    same machine.
    Are there any known issues regards communication between two running
    instances of Weblogic on the same machine?
    Thanks in advance,
    Randy Yarger
    marchFIRST
    [email protected]

    Thanks for the prompt reply.
    There is one IP address (internal address 10.227.1.34) one the machine. WLS1
    is set up at ports 7001 and 5133. WLS2 is setup at ports 7004 and 7005.
    When WLS1 attempts to obtain a context to WLS2 with the URL
    t3://10.227.1.34:7004/ it pauses for a long period of time. Running truss
    on the both WLS processes shows communication occuring between the two
    followed by long periods of silence. Finally WLS2 spits out the error
    ConnectionException[7001,7001,5133,5133,7001,7001] (paraphrased, I can get
    the entire error if it would help).
    After another long pause, WLS1 quits trying with the error 'Server
    10.227.1.34:7004 not found' (again paraphrased).
    Among the things we've tried:
    * Changing the URL from the IP to 127.0.0.1
    * Enabling/disabling SSL on either or both WLSs.
    * Changing the server name in WLS2's copy of weblogic.properties from
    'myserver' to 'myserver2' (previously they were both 'myserver')
    * Upgrading WLS2 to 5.1.0sp5 (Tried upgrading WLS1, but was getting class
    not found errors and quit because that WLS is being used by other people)
    This is a Solaris server. WLS1 is running 5.1.0 and WLS2 is running 5.1.0sp5
    Any suggestions would be appreciated.
    Best,
    Randy Yarger
    marchFIRST
    [email protected]
    "Michael Girdley" <[email protected]> wrote in message
    news:[email protected]...
    >
    >
    There should not be. What is your network configuration? Are they on
    separate IP addresses?
    Thanks,
    Michael
    Michael Girdley
    BEA Systems Inc
    "Randy Jay Yarger" <[email protected]> wrote in message
    news:[email protected]...
    Hi,
    We're having a problem with communication between two copies of Weblogicon
    the same machine. They are configured with seperate ports (regular andSSL).
    Independantly, they run fine. I can access EJBs running on either of
    them.
    The problem is that a bean in one of them has code which attempts toaccess
    an EJB on the other one. The procude fails when trying to obtain theinitial
    context. This same code works if compilied independantly of WebLogic onthe
    same machine.
    Are there any known issues regards communication between two running
    instances of Weblogic on the same machine?
    Thanks in advance,
    Randy Yarger
    marchFIRST
    [email protected]

  • Using 1394 to perform communication between two PCs

    Hi all,
    Does anybody knows how to use a 1394 (firewire) to implement a communication between two computers using Labview ?
    Do I need a special toolkit for this ?
    Thanks
    Eduardo

    Currently, if you have installed NI-VISA, you should have the 1394 Passport already installed and running. This gives you the ability to communicate with 1394 instruments via your 1394 instruments. This is important because this helps determine how you will communicate from one computer to another. If you want to use the VISA and communicate using the FireWire INSTR, then you need to find or create drivers for your 1394 ports that allow you to communicate with them as 1394 instruments. There might be other ways to do this, but this is probably the most simple. Once you've got the pcs set up, you can just use VISA to communicate with your other devices.
    Logan S.

  • A point to point communication between two EJB

    How do we make a point to point communication between two ejb? Must i use mdb or session bean?
    Because i have a problem: how can i send a message to a specific EJB that i choose?
    Thanks

    Yes....U should post a message from EJB1 to a queue and listener can be the second EJB (Better if its an MDB).
    Whats the problem U r facing?
    -Rais

  • Two-way forest trust between two (single domain) forests with multiple identical user ID's

    Domain and forest levels - Windows 2003 (they both have one 2008 R2 DC)
    We need to create a two-way forest trust between two separate single-domain forests. The problem is that these two forests already access each others resources through a S2S. Users have the same login names and passwords on both forests/domains. Now, we
    are combining their infrastructures and need to set up a trust. From what I'm reading, you can't create forest trusts if you have the same SIDs, user ID's, or computer name in each of the forests.
    I'm looking into AD migration tool to copy the userSIDs (SID history?) between forest/domain, deleting the user ID's in the domain we migrated from, and then setting up the trust, but I'm leery about doing it this way as there is no easy 'recovery' should
    something go wrong. 
    Any suggestions for the easiest way to setup this forest trust?

    Hi,
    To eliminate your worries, two user accounts have the same user name doesn’t mean that they have the same SID. Moreover, the user’s SID remains the same even after it has been renamed.
    The SID for domain account/group consists of a
    Domain Identifier and a Relative Identifier. Domain Identifier is unique in every domain within a forest, and a Relative Identifier is unique within domain. It is unlikely that two user accounts with or without the same account
    name from two forests have the same SID.
    The Technet article you mentioned is talking about duplicate SIDs instead of “duplicate computer name or user account”, I will submit a change request to Microsoft about this.
    If there are duplicate SIDs when you create forest trust, you need to delete one of them as the article guides.
    Here are some related articles below for your references:
    How Security Identifiers Work
    http://technet.microsoft.com/en-us/library/cc778824(v=WS.10).aspx
    Security Identifier Structure
    http://technet.microsoft.com/en-us/library/cc962011.aspx
    Security Identifier
    http://en.wikipedia.org/wiki/Security_Identifier
    I hope this helps.
    Amy Wang

  • Communication between two Machines

    I just want to know whether is there any way possible where I can enable communication between two machines.
    To be more clear , suppose if i click on a button then it send a pop up or a message box on another machine in the network.

    Look for "Distributed Notifications".

  • Communicating between two javafx files

    hi,
    i have two javafx files and i want the two to communicate
    that is on pressing a button in one i want the control to be transffered to the other...
    Hw can i do this,
    can any one help

    Hi,
    If you mean communicating between two database, you can create DATABASE LINK.
    http://download.oracle.com/docs/cd/B14117_01/server.101/b10759/statements_5005.htm
    Thanks

  • Communicating between two machine

    hi all
    how in oracle i can communicate between two machine via ip address.
    my oracle version is--->
    Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Prod
    PL/SQL Release 10.1.0.2.0 - Production
    CORE 10.1.0.2.0 Production
    TNS for 32-bit Windows: Version 10.1.0.2.0 - Production
    NLSRTL Version 10.1.0.2.0 - Production
    Message was edited by:
    bp

    Hi,
    If you mean communicating between two database, you can create DATABASE LINK.
    http://download.oracle.com/docs/cd/B14117_01/server.101/b10759/statements_5005.htm
    Thanks

  • Communication Between Two WebApps

    Hi,
    I have a situation where I want to invoke another web application from my web app, collect the result from this call (to another web application) and use it in my screen.
    e.g. I have a screen where I accept Customer information. In second screen I want him to specify his Geography information (another WebApp). And the selected result should be set in the Customer information, screen.
    WOuld be interested in knowing - what are the various possibilities exists?
    I know that one way is to do it with the sendRedirect. But my requirement also includes getting results from another web apps.
    The constraint here is that, these two web apps work on two different databases and it is not possible to just pass keys and access information from database.
    This essentially mean that we have to somehow pass objects between web applications.
    If any of you have some different solution or know of certain limitations - please share.
    Thanks in Advance.

    The application requires screen level integration:
    1) Screen level integration, because from first application I have to invoke second application page. Information collected from this page should be passed back to first page.
    Secondly, the first application need the information from the second application screen (object model differs in the two applications).

  • Communicating between two Computer via USB

    Hello,
    I want to connect two PCs to synchronize two different LabView VIs running on these Computers.
    The perfect way would be, that the VI on PC 1 sends boolean Value to the VI on PC 2, where this value is read out and can start some process.
    My Problem is that I do not have a 'normal' network and all serial Ports (but not USB) are occupied.
    I would appreciate any advice or suggestion.
    One of my ideas is going in the direction of an USB to 9pin serial Adapter plus a null modem adapter/cable. But I have no Idea if this would work.

    I would suggest USB-Ethernet adapters and an Ethernet cross-over
    cable.
    The communications between computers will be faster, and you can
    use your software across a larger network later on without
    modifications (just change IP addresses).  Your communications will be
    message based rather than character based, so you won't have to
    constantly poll the RS232 port for characters.
    Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
    If you don't hate time zones, you're not a real programmer.
    "You are what you don't automate"
    Inplaceness is synonymous with insidiousness

  • Applet to Applet communication between two seperate threads and jsp pages

    Hi,
    have two java applets running on two separate jsp pages. I am trying to have one applet talk to the other applet. I have tried putting the applets in a static hashtable, but I found out (through trial and error) that the memory is not shared between the applets. Needless to say the appletcontext object will not work as well. I have also tried to put the applet threads into a thread group, but it seems that the second applet can't find the first applet's threads. Is there a funky way that I need to create the threads for the threadgroup? Is there a way or type of object that I can use that will share the static memory between plugins? I am using 1.6 in IE. Or am I looking at this wrong and there is an easy way to do this and I am not seeing it.
    Thanks,
    Marc

    Hi Mylene,
    I hope I have understood your problem correctly. I can try to give you a tip. The times I've had to do a pop-up, for instance to show details or a part of the data in a table, I call a javascript function with the required parameters (an ID for details or an array of rows) when the button is pressed or a link is clicked. The function then builds a URL with all the paremeters and uses it to call the standard window.open function. After that the request is handled "as usual", ie as if you didn't actually do a pop-up but simply displayed a new page. The content of the pop-up is a jsp with all the required code to build the table and/or display the data. The contents of the table or data are retrieved with the help of the parameters sent.
    I'm not sure if the portal kit provides some kind of standard functionality for this, but in the cases I've worked with J2EE solutions this has been the most common way of solving the problem.
    I hope this helps.
    kind regards,
    Dionisios

Maybe you are looking for