Writing a custom RMI Activator process

Hello Group,
I am in the process of implementing a custom RMI activation scheme, in which remote Activatable objects will be hosted in a custom EXE process, instead of the standard Java.exe/Javaw.exe. I intend to use JNI to create the JVM in this custom EXE process and then load Java classes. I have used JNI to create JVMs in native processes before, but have no experience writing custom RMI activation systems.
Has anyone attempted this before, and knows if there are any gotchas that I should know early on?
Thanks,
Ranjit

I have a breakthrough. I am able to host a simple RMI server inside a custom EXE. All I do is inside the main of a Win32 EXE, create the JVM and use JNI to call the ‘main’ of a Java class I wrote below.
This class runs (some undocumented) code to bootstrap the RMI machinery. Hereafter my EXE process process remains alive and is available to service RMI requests. Using this approach, I wouldn’t need to recompile java.c inorder to rename it as long as my custom JNI code is able to parse in all the VM options passed in by RMID in order to create the JVM.
I was missing the crucial step of calling back into rmid (the Activator) and registering the newly created group, only after which would rmid start creating instances of the remote object. Your advice that I carefully read the spec helped!
public class Host {
public static void main(String[] args) throws Exception {
Class clsInputStream = Class.forName("sun.rmi.server.MarshalInputStream");
Constructor ctor = clsInputStream.getConstructor(InputStream.class);
Method readObj = clsInputStream.getMethod("readObject", null);
Method readLong = clsInputStream.getMethod("readLong", null);
// Instantiate MarshalInputStream
Object in = ctor.newInstance(System.in);
// Read all the data passed in by the Activator (rmid)
ActivationGroupID id = (ActivationGroupID) readObj.invoke(in);
ActivationGroupDesc desc = (ActivationGroupDesc) readObj.invoke(in);
long incarnation = (Long) readLong.invoke(in);
// Create the ActivationGroup
ActivationGroup grp = ActivationGroup.createGroup(id, desc, incarnation);
// Callback into rmid to register the group.
ActivationGroup.getSystem().activeGroup(id, grp, incarnation);
// rmid will now invoke ActivationGroup.newInstance to create the RMI server
Thanks,
Ranjit

Similar Messages

  • PublishWorkflow error when workflow contains custom code activity

    I've failed to get a custom code activity working within Workflow Manager 1.0 even though I believe I've performed all of the guidance steps provided.
    As other posts, I get the usual 'cannot create unknown type' error:
    client.PublishWorkflow( workflowName, @"..\..\TestWorkflow.xaml" );->
    Cannot create unknown type '{wf://workflow.windows.net/$Current/$Activities}SendMailActivity'.
    The activity is implemented as:
    namespace SharedActivities
    public sealed class SendMailActivity : CodeActivity
    I've created an AllowedTypes.xml file containing the following:
    <?xml version="1.0" encoding="utf-8" ?>
    <AllowedTypes>
    <Assembly Name="SharedActivities">
    <Namespace Name="SharedActivities">
    <Type>SendMailActivity</Type>
    </Namespace>
    </Assembly>
    </AllowedTypes>
    The SharedActivities assembly has the following Post Build event command line
    net stop "Workflow Manager Backend"
    %systemroot%\system32\inetsrv\appcmd stop apppool /apppool.name:"WorkflowMgmtPool"
    xcopy /y "$(TargetPath)" "C:\Program Files\Workflow Manager\1.0\Workflow\WFWebRoot\bin"
    xcopy /y "$(TargetPath)" "C:\Program Files\Workflow Manager\1.0\Workflow\Artifacts"
    copy /y $(ProjectDir)AllowedTypes.xml "C:\Program Files\Workflow Manager\1.0\Workflow\WFWebRoot\bin"
    copy /y $(ProjectDir)AllowedTypes.xml "C:\Program Files\Workflow Manager\1.0\Workflow\Artifacts"
    %systemroot%\system32\inetsrv\appcmd start apppool /apppool.name:"WorkflowMgmtPool"
    net start "Workflow Manager Backend"Execution output : 1>------ Rebuild All started: Project: SharedActivities, Configuration: Debug Any CPU ------
    1>  SharedActivities -> D:\Dev\Prototypes\WorkflowTest\SharedActivities\bin\Debug\SharedActivities.dll
    1>  The Workflow Manager Backend service is stopping.......
    1>  The Workflow Manager Backend service was stopped successfully.
    1>  
    1>  "WorkflowMgmtPool" successfully stopped
    1>  D:\Dev\Prototypes\WorkflowTest\SharedActivities\bin\Debug\SharedActivities.dll
    1>  1 File(s) copied
    1>  D:\Dev\Prototypes\WorkflowTest\SharedActivities\bin\Debug\SharedActivities.dll
    1>  1 File(s) copied
    1>          1 file(s) copied.
    1>          1 file(s) copied.
    1>  "WorkflowMgmtPool" successfully started.
    1>  The Workflow Manager Backend service is starting.
    1>  The Workflow Manager Backend service was started successfully.
    1>  
    ========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
    The assembly containing the custom activity is loaded into the Workflow host process.
    I've configured my machine (development) to allow unsafe types.
    I've also
    uploaded my project so you can verify the implementation.
    Thanks in advance, Adam

    I did following step in your VS project.
    Remove SendMailActivity from TestWorkflow.Xaml
    Commented out "[assembly: XmlnsDefinition("wf://workflow.windows.net/$Current/$Activities", "SharedActivities")]
    " line from SharedActivities assemblyInfo.cs file
    build the project
    Added SendMailActivity activity in TestWorkflow.xaml
    run the program.
    Above steps seems to be working for me..

  • Who owns the activation process - Apple or Sprint?

    I have a Sprint iPhone 4S with the original SIM card.   the only way I've gotten it to activate is through a complete restore via DFU mode (very similar to this discussion in 2012; iPhone 4S US/Sprint unable to activate!)
    An incremental update to 8.1.1 makes it ask to activate again :/
    I went to my local Sprint store today and they say they can't do anything about it and that I must go to an Apple Store.
    I'm trying to avoid getting bounced around here.   Who "owns" the activation process?   Is it Apple or Sprint?
    Who ultimately correct this annoying activation behavior when it activates from a full restore?
    I should not that I am not using the phone component of the iPhone and do not have a Sprint account. (for the record, I was a pretty happy Sprint customer back in the 90s... )

    udance4ever wrote:
    hey quick update on this front - i finally got a iPhone 5s so my 4S if officially a "glorified iPod Touch" (admittedly a good one at 64GB) - so I'm not going to bother using the phone component in it for now.
    Sure a bit irked and just grateful the days of "carrier locked phones" is fading behind us more and more every day (I bought a 2nd hand Verizon 5s and a happy camper on T-Mobile - didn't have to go through any hoops!)
    anyone know if I can close this thread as "no longer needs an answer" somehow?
    Yeah you mark one of the responses as 'Solved My Question'.

  • My iphone 5 is making me complete the whole activation process over again whenever I turn it off and sometimes when I turn the screen off. Also my icloud will not connect. Help!

    Basically yesterday my iphone started requiring me to go through the activation process (connecting to wifi, logging in to itunes,etc.) I have tried r

    I have tried restarting it but each time it requires me to log in again.

  • Replacement Needed. This iphone is not able to complete the activation process and needs to be replaced. Please visit your nearest apple store or authorized service center.

    Probably will never ever think of buying a locked phone from AT&T cause its one of the worst system integrations ever that these companies could think of.
    The entire problem started when I put in a request with at&t to unlock my iphone 4s (ios7) which did get approved. I performed the entire instructions they asked me to do, which is to backup and restore. After doing those instructions my iphone gave me an error message below
    The SIM card inserted in this iPhone does not appear to be supported.
    The SIM card that you currently installed in this iPhone is from a carrier that is not supported under the activation policy that is currently assigned by the activation server. This is not a hardware issue with the iPhone. Please insert another SIM card from a supported carrier or request that this iPhone be unlocked by your carrier. Please contact Apple for more information.
    Basically saying that at&t hasn't still unlocked the iphone which a really helpful apple executive was able to confirm. I initiated another unlock process from at&t in order to unlock the iphone, just to be sure that its not something wrong from my end. The nice at&t lady stayed on chat with me to unlock the iphone step my step while I was calling the apple tech too. And the apple tech confirmed again that the iphone is locked to at&t.
    Now, just a few minutes ago I tried another restore to see if any progress is being made and to my surprise I got an error message saying
    Replacement Needed. This iphone is not able to complete the activation process and needs to be replaced. Please visit your nearest apple store or authorized service center.
    I feel like I am just going around these two different "money hogger" companies which set certain rules and regulations to screw a regular phone buyer. I purchased this iphone in USA and trying to unlock in India, is it really this hard to simply unlock a device.
    For now I am going to try to call a apple office in india (apprently we don't have very many out here) and see if they can help me. But any other assistance regarding unlocking an iphone 4s would be helpful. I have however, tried checking IMEI.info, called up apple, talked to at&t (which always say go talk to apple) I do have a case number from apple as well in case an apple executive reads this discussion forum (case number: 566383594)
    Thanks

    You got a confirmation from AT&amp;T that it was authorized. Is this correct? - Yes i did get an email authorization on the 21st.
    Then you connected the phone to a computer with the latest version of iTunes installed. You clicked on the phone's name in iTunes, then clicked "Backup Now". - Yes
    When that finished you clicked "Restore iPhone" (NOT "Restore Backup") - Yes
    Are you with me so far? - Yes.
    And @ Varjak is right that after the 3rd restore I get the replacement error. 
    Plus I have NEVER jailbroken the iPhone. To give you another update, I spoke to a really nice apple tech in India who was atleast able to get me out of the replacement error by doing a recovery mode option. However, the lastest restore still gives me the same error
    The SIM card inserted in this iPhone does not appear to be supported.
    The SIM card that you currently installed in this iPhone is from a carrier that is not supported under the activation policy that is currently assigned by the activation server. This is not a hardware issue with the iPhone. Please insert another SIM card from a supported carrier or request that this iPhone be unlocked by your carrier. Please contact Apple for more information.
    Message was edited by: jabgars

  • Formatted Search - Restrict to Only One Customer on Activity Window

    Hello Experts:
    Am trying to create a formatted search to provide a suggested RMA Number on the Business Partners > Activity window in a UDF.
    While in Activity, the user should get a list of ONLY the one customer they are currently working with.  So if C0001 is being used in the Activity window, the list should show all suggested RMA numbers just for that customer of C0001, not any other customer. 
    When I use the following it shows all customers.
    --FMS 6BP Automated RMA Number
    SELECT
    T1.[CardCode] + ' - ' + ltrim(str(T0.[ClgCode]))
    FROM OCLG T0
    INNER JOIN OCRD T1
    ON T0.CardCode = T1.CardCode
    ORDER BY
    T1.CardCode Desc,
    T1.[CardCode] + ' - ' + ltrim(str(T0.[ClgCode])) Desc
    When I put in WHERE T1.CardCode = $[$ 9.0.0 ] in the right place it shows nothing...
    Any ideas on how to make only the one current customer in Activity window appear in the list???
    Thanks in Advance - Zal

    Thanks Istvan and Gordon...
    Istvan - that is the same as my SQL - just do not know how to show the $[$... correctly in this forum - it always goes to that http thing.
    Gordon - tried to use your SQL but it gave me an error of "Internal Error (-1003) Occured [Message 131-183] every time I tried to click on the magnifying glass.  However, due to your last line in the SQL it gave me an idea that eventually they were OK with - namely, the highest number to the top of T0.ClgCode...
    Thanks again guys - Zal

  • Tried upgrading to new OS 5, and now itunes won't continue the activation process, what do I do?

    I recently tried upgrading my iphone 4 to the new OS 5, and now itunes won't continue the activation process. It keeps say that an unexpected error has occured, Error 310. I am very frustrated and now have no phone to call apple, and there website is no help. What do I do?

    Hi seth fromhollywood,
    I found this in internet, I hope it helps:
    Error
    -310
    Name
    SmFHBlockRdErr
    OS
    Mac OS
    Error Title
    smFHBlockRdErr
    Message
    Error occurred during _sGetFHeader.
    Risk Level
    9
    for resolution look here ...

  • How to fix this error "this iPad is not able to complete the activation process. Please press Home and start over. If the issue persists, please visit your nearest Apple Store or Authorized service provider for more information or replacement"?

    How to fix this error "this iPad is not able to complete the activation process. Please press Home and start over. If the issue persists, please visit your nearest Apple Store or Authorized service provider for more information or replacement"? When I plugged in my iPad this popped up!

    Hi csreddy, 
    If you are receiving a message to contact an Apple Retail Store or Authorized Service Provider for help updating from iOS 3, click on the link below to initiate that support:
    Update the iOS software on your iPhone, iPad, and iPod touch - Apple Support
    http://support.apple.com/en-us/HT204204
    Update your device using iTunes
    If you can’t update wirelessly, or if you want to update with iTunes, follow these steps:
    Install the latest version of iTunes on your computer.
    Plug in your device to your computer.
    In iTunes, select your device.
    In the Summary pane, click Check for Update. 
    Click Download and Update.
    If you don't have enough free space to update using iTunes, you'll need to delete content manually from your device.
    Find out what to do if you get other error messages while updating your device.
    Last Modified: Jan 12, 2015
    Apple - Find Locations
    https://locate.apple.com
    Contact Apple for support and service - Apple Support
    http://support.apple.com/en-us/HT201232
    Regards,
    - Judy

  • Short dump while activating process chain

    Please let me know the cause of short dump while activating process chain.. when trying to activate local process chains in metachain it is causing dump

    Can you share more details about error.
    Have you done any changes to local chain? or is this is new chain?
    Try to remove meta chain from schedule, later activate your local chain and meta chain.
    schedule your meta chain.

  • Memory could not be allocated for the activation process. Please close all applications and try agai

    I have just had a Windows XP failure and took the opportunity to replace with Windows 7.  After I reinstalled PhotoShop CS(1) the message "Memory could not be allocated for the activation process. Please close all applications and try again"  is shown and forces PhotoShop to close.  I have 4Gb of Ram installed and a total of about 10Gb of Page File space on three partitions of a 500Gb HDD.  The system is not heavily loaded!  However, I cannot access Photoshop to check scratch disk allocation.  How to fix???
    Back to top

    Yes, there are many forums, and it can be confusing. Your question has the best chance of being answered if it is in the proper place. I think it is there now.
    Pattie
    http://forums.adobe.com/message/5092533#5092533  is your post address
    Download and installation forum:
    http://forums.adobe.com/community/download_install_setup

  • Memory could not be allocated for the activation process. Please close all applications and tr again

    Hello,
    Just purchased a new laptop:
    Intel Core 2 quad
    4gb memory
    1000 HDD
    Photoshop CS 8.0 disc dead/scratched/unreadable.  So I copied my Adobe folder from my Program Files Folder on my PC and pasted on laptop.  When I try and run PS I get the error message "Memory could not be allocated for the activation process. Please close all applications and try again". Which I do then Photoshop closes.
    Can anyone help (in layman terms please)?

    Not really. You are essentially FUBARd. Without a proper install, there is usually no way on to get the licensing stuff working. You might be able to get there by installing any other CS product, so PS could latch on to the licensing system that would be already in place, but otherwise it's a lost cause. Simply copying over the executables is normally not enough. I will admit though, that I skipped CS, so there may be some tool somewhere that I don't know about can do this post facto...
    Mylenium

  • Customer Down Payment Process

    Hi,
    Please guide me in the customer down payment process.
    I have made a 10000 as down payment to our customer in F-29.
    After that i created Customer invoice using F-22.
    After that i paid invoice amount thrugh f-39 with the clearing of down paymet.
    Now my down payment was fullly utilized and inovice was also paid.
    If i see in FBL5N the customer balance zero.
    why should i again do the transaction in F-32.
    Please guide me
    Sateesh

    Hi Sateesh,
    in f-32 you will clear the open items.
    the process will be like this.
    1.fist u got the downpayment..so u will post at f-29
    system will creat a customer open item here.
    2.then u will rise the Customer invoice at f-22
    3.then you have to clear the down payment at f-39.
    4.then you have to clear the customer open item at f-32.
    here you will clear the Customer open item where u have in step 1.
    now chekc the balence.
    thanks.

  • Error in 'eMail Response - Process Message' --- Error running sub-process 'eMail Response - Create Activity' at step 'Create Activity Process'.(

    Hi,
    When I was simulating the 'eMail Response - Process Message', I had been getting the below error when entering to 'Create activity Process' step.(provided all the inputs per testmode.xml file)
    Error running sub-process 'eMail Response - Create Activity' at step 'Create Activity Process'.(SBL-BPR-00183)
    I increased the log level to 5 and got the below message in log file
    ObjMgrBusServiceLog    InvokeMethod    4    0000000251b51f04:0    2013-06-10 01:30:12    Begin: Business Service 'XML Hierarchy Converter' invoke method: 'DocToHier' at 12cc4240
    ObjMgrBusServiceLog    Error    1    0000000251b51f04:0    2013-06-10 01:30:12    (xmlcnvsv.cpp (548)) SBL-EAI-00246: XML Hierarchy Converter error - empty input message, expecting an XML document in <Value> of input arguments
    I was wondering I could not find 'XML Hierarchy Converter' business service in 'eMail Response - Process Message' and 'eMail Response - Create Activity' sub process.
    Can any body help me out in this regard.
    Thanks in advance..
    Jagadeesh

    Hi Naresh,
    yes, I am using the delete polling strategy. Here is the .jca file:
    <adapter-config name="Pozadavky" adapter="Database Adapter" wsdlLocation="Pozadavky.wsdl" xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">
    <connection-factory location="eis/DB/PozadavkyConn" UIConnectionName="PozadavkyConn" adapterRef=""/>
    <endpoint-activation portType="Pozadavky_ptt" operation="receive">
    <activation-spec className="oracle.tip.adapter.db.DBActivationSpec">
    <property name="DescriptorName" value="Pozadavky.Pozadavky"/>
    <property name="QueryName" value="PozadavkySelect"/>
    <property name="MappingsMetaDataURL" value="Pozadavky-or-mappings.xml"/>
    <property name="PollingStrategy" value="DeletePollingStrategy"/>
    <property name="PollingInterval" value="120"/>
    <property name="MaxRaiseSize" value="1"/>
    <property name="MaxTransactionSize" value="10"/>
    <property name="NumberOfThreads" value="1"/>
    <property name="ReturnSingleResultSet" value="false"/>
    </activation-spec>
    </endpoint-activation>
    </adapter-config>

  • Not able to complete activation process.

    After updating my iPad2 to ios8.0.2., I lost my ability to connect to my cellular network, with an error message reading "Not able to complete activation process.
    Does anyone know of a fix for this problem?

    Try a reboot press & hold power button & menu button hold both down until you see Apple Logo you will not lose any data. Bsydd uk

  • ITunes fails to launch but is an active process in the task manager

    When I try to open iTunes 7.0 it won't launch. But if I open the task manager is shows up as an active process. If I click "end process" it won't close. iTunes will only open up if my ipod is connected to the computer. ????
      Windows XP  

    See:
    *http://kb.mozillazine.org/Browser_will_not_start_up
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode
    A possible cause is security software (firewall) that blocks or restricts Firefox or the plugin-container process without informing you, possibly after detecting changes (update) to the Firefox program.
    Remove all rules for Firefox from the permissions list in the firewall and let your firewall ask again for permission to get full unrestricted access to internet for Firefox and the plugin-container process and the updater process.
    See:
    * https://support.mozilla.com/kb/Server+not+found
    * https://support.mozilla.com/kb/Firewalls

Maybe you are looking for

  • How can I password protect pdf files that intend on email

    How can I password protect a pdf file that I intend on emailing?

  • How to update FixedAsset with  BAPI_FIXEDASSET_CHANGE

    Hi I'm using  BAPI_FIXEDASSET_CHANGE to update Cost Center, return message show it's update but when I check AS03, no update make it. Data exported through BAPI Company Code ZZ01 Asset   5102591 TIMEDEPENDENTDATA-BUS_AREA      = US02 TIMEDEPENDENTDAT

  • ITunes keeps crashing in Windows 8.1

    Hi Guys, I'm currently having major problems with my 1st Generation iPod Touch. The problem I'm having is that I've done a restore on my iPod and it's put everything back on but to finalise the restore and verify it, iTunes recgonises my iPod Touch l

  • Extensions grayed out in photoshop cc 2014

    I am trying to manage extensions in Photoshop CC 2014, specifically to add the Rad Lab panel of actions, but the "extensions" tab under window is grayed out. Any advice?

  • Problem with my floppy drive

    Today i tried to use my old floppy drive. I tried to format some floppies with Kfloppy but it says something like: Internal error: device not correctly defined. Ideas how to fix this?