XModem via TCP for Java

I am sure that many of you experienced developers have read requests in the past concerning implmentation of Ward Christenen's XModem protocol over a TCP socket. If not, well... you are about to...
This is a major hack... but it is starting to come together... thanks to Fred Potter for his source code to start this project...
Objective:
Basically, I want to create a console application which accepts an incoming connection and starts the receive mode for a XModem file transfer. I am using CGTerm (for Commodore retrocomputing) but can test with HyperTerminal as well...
The user who connects to the server selects SEND and the FILE to send for a XModem file transfer... and the transfer begins...
The incoming blocks of 128 bytes are written to a file
After the transfer is over the server disconnects the client terminal.
Here is what I have so far:
import java.net.*;
import java.lang.*;
import java.io.*;
// X-Modem Server implementation via TCP/IP socket
public class XServer {
public static FileWriter fw;
public static void main(String[] args) throws IOException {
// define the file
try {   
fw = new FileWriter("filename.txt");
} catch (Exception e) {
System.out.println(e);
System.exit(0);
int port = Integer.parseInt(args[0]);
ServerSocket server = new ServerSocket(port);
System.out.println("X-Server v1.0 - waiting for connection");
Socket client = server.accept();
// Handle a connection and exit.
try {
InputStream inputStream = client.getInputStream();
OutputStream outputStream = client.getOutputStream();
new PrintStream(outputStream).println("Go to send file mode!"); // sent to client
System.out.println("Ready to receive file via X-Modem...");
* BEGIN TRANSFER HERE!
// set the debug flag
XModem.debug = true;
* Here we are instantiating a new InputStream that represents the remote
* file that we are receiving. In this single line we are attempting to
* start the flow.
* Behind The Scenes: We're sending a NAK across the serial line repeatedly
* until we finaly start seeing the data flow. If we don't see the data
* flow, then we throw an exception.
System.out.println("Sending NAK to start receive mode...");
InputStream incomingFile;
try {
incomingFile = new XModemRXStream(inputStream, outputStream);
} catch (IOException e) {
System.out.println("ERROR! Unable to start file transfer!");
e.printStackTrace();
return;
System.out.println("Starting file transfer...");
* Here we are reading from the incoming file, byte by byte, and printing out.
* Behind The Scenes: Internally, the read() method is handling the task of
* asking for the next data block from the remote computer, processing it (i.e.
* parsing, running checksums), and then putting it in an internal buffer. Not
* all calls to read() will request a new data block as each block contains at
* least 128 bytes of data. Sometimes you will only hit the buffer.
try {
for (;;) {
int c = incomingFile.read();
if (c==-1)
break; // End of File
// print character / byte
System.out.print(c+",");
// write to file
try {       
//System.out.print(".");
fw.write(c);
} catch (Exception e) {
System.out.println(e);
System.exit(0);
} catch (IOException e) {
System.out.println("error while reading the incoming file.");
e.printStackTrace();
return;
// done
System.out.println("File sent.");
new PrintStream(outputStream).println("");
new PrintStream(outputStream).println("transfer successful!");
} finally {
//client.close();
// save the file
try {   
fw.close();
System.out.println("file saved.");
} catch (Exception e) {
System.out.println(e);
System.exit(0);
* XModem keeps track of settings that the Receive and Transmit Stream classes will
* reference.
* <p>Copyright: Copyright (c) 2004</p>
* @author Fred Potter
* @version 0.1
class XModem {
public static boolean debug = false;
* XModemRXStream is an easy to use class for receiving files via the XModem protocol.
* @author Fred Potter
* @version 0.1
class XModemRXStream
extends InputStream {
// CONSTANTS
private static final int SOH = 0x01;
private static final int EOT = 0x04;
private static final int ACK = 0x06;
private static final int NAK = 0x15;
private static final int CAN = 0x18;
private static final int CR = 0x0d;
private static final int LF = 0x0a;
private static final int EOF = 0x1a;
// block size - DON'T CHANGE - I toyed with the idea of adding 1K support but the code is NOT there yet.
private static final int bs = 128;
// PRIVATE STUFF
private int ebn; // expected incoming block #
private byte[] data; // our data buffer
private int dataPos; // our position with the data buffer
private InputStream in;
private OutputStream out;
* Creates a new InputStream allowing you to read the incoming file. All of the XModem
* protocol functions are handled transparently.
* As soon as this class is instantiated, it will attempt to iniatate the transfer
* with the remote computer - if unsuccessful, an IOException will be thrown. If it
* is successful, reading may commense.
* NOTE: It is important not to wait too long in between calls to read() - the remote
* computer will resend a data block if too much time has passed or even just give up
* on the transfer altogether.
* @param in InputStream from Serial Line
* @param out OutputStream from Serial Line
public XModemRXStream(InputStream in, OutputStream out) throws
IOException {
this.in = in;
this.out = out;
// Initiate the receive sequence - basically, we send a NAK until the data
// starts flowing.
init:for (int t = 0; t < 10; t++) {
if (XModem.debug) {
System.out.println("Waiting for response [ try #" + t + " ]");
long mark = System.currentTimeMillis();
out.write(NAK);
// Frequently check to see if the data is flowing, give up after a couple seconds.
for (; ; ) {
if (in.available() > 0) {
break init;
try {
Thread.sleep(10);
catch (Exception e) {}
if (System.currentTimeMillis() - mark > 2000) {
break;
// We have either successfully negotiated the transfer, OR, it was
// a failure and timed out. Check in.available() to see if we have incoming
// bytes and that will be our sign.
if (in.available() == 0) {
throw new IOException();
// Initialize some stuff
ebn = 1; // the first block we see should be #1
data = new byte[bs];
dataPos = bs;
* Reads the next block of data from the remote computer. Most of the real XModem protocol
* is encapsulated within this method.
* @throws IOException
private synchronized void getNextBlock() throws IOException {
if (XModem.debug) {
//System.out.println("Getting block #" + ebn);
// Read block into buffer. There is a 1 sec timeout for each character,
// otherwise we NAK and start over.
byte[] buffer;
recv:for (; ; ) {
buffer = new byte[bs + 4];
for (int t = 0; t < 10; t++) {
System.out.println("\nReceiving block [ #" + ebn + " ]");
// Read in block
buffer = new byte[buffer.length];
for (int i = 0; i < buffer.length; i++) {
int b = readTimed(1);
// if EOT - don't worry about the rest of the block.
if ( (i == 0) && (b == EOT)) {
buffer[0] = (byte) (b & 0xff);
break;
// if CAN - the other side has cancelled the transfer
if (b == CAN) {
throw new IOException("cancelled");
if (b < 0) {
if (XModem.debug) {
System.out.println("Time out... NAK'ing");
out.write(NAK);
continue recv;
else {
buffer[i] = (byte) (b & 0xFF);
break;
int type = buffer[0] & 0xff; // either SOH or EOT
if (type == EOT) {
if (XModem.debug) {
System.out.println("EOT!");
out.write(ACK);
break;
int bn = buffer[1] & 0xff; // block number
int bnc = buffer[2] & 0xff; // one's complement to block #
if (
(bn != ebn) && (bn != (ebn - 1)) ||
(bn + bnc != 255)) {
if (XModem.debug) {
System.out.println("NAK'ing type = " + type + " bn = " + bn +
" ebn = " +
ebn + " bnc = " + bnc);
out.write(NAK);
continue recv;
byte chksum = buffer[ (buffer.length - 1)];
byte echksum = 0;
for (int i = 3; i < (buffer.length - 1); i++) {
echksum = (byte) ( ( (echksum & 0xff) + (buffer[i] & 0xff)) & 0xff);
if (chksum != echksum) {
out.write(NAK);
continue recv;
out.write(ACK);
if (ebn == 255) {
ebn = 0;
else {
ebn++;
break;
// We got our block, now save it in our data buffer.
data = new byte[bs];
for (int i = 3; i < (buffer.length - 1); i++) {
data[(i - 3)] = buffer;
dataPos = 0;
public synchronized int read() throws IOException {
// If at the end of our buffer, refill it.
if (dataPos == bs) {
try {
getNextBlock();
catch (IOException e) {
throw new IOException();
// If we're still at end of buffer, say so.
if ( dataPos == bs) {
return -1;
int d = data[dataPos];
if (d == EOF)
return -1;
dataPos++;
return d;
* A wrapper around the native read() call that provides the ability
* to timeout if no data is available within the specified timeout value.
* @param timeout timeout value in seconds
* @throws IOException
* @return int an integer representing the byte value read.
private int readTimed(int timeout) throws IOException {
long start = System.currentTimeMillis();
for (; ; ) {
if (in.available() > 0) {
return (in.read());
try {
Thread.sleep(10);
catch (InterruptedException ex) {
//if (System.currentTimeMillis() - start > timeout * 1000) {
if (System.currentTimeMillis() - start > timeout * 5000) {
return -1;
Here was the output...
Original file:
(Commodore CBM SEQ file exported to PC using DirMaster)
��
� �
� ��� �� �� ��� ��
� �� �� ���� �� ��� ��
� ��� ����������������������������������������������
�� ����� ������� ����� �� ����� ������ ����� ���
� �� ������ ������ ��� ��� �� ��� ���� �� ������
� � ���
����
� � ��OWERED BY �OLOR 64 ��� V8
�UNNING �ETWORK64 V1.26A

�UPPORTING 38400 �AUD �ATES
�����/����/�������

�ESTING �CHO-�ET V1 BETA

�EATURING �ESSAGES, �ILES,
�ET�AIL, AND �NLINE �AMES!
�YS�P: � � � � � � � � �

�RESS ANY KEY TO LOGIN\C�
The result when the file was uploaded and received by my XServer:
? ? ??OWERED BY ?OLOR 64 ??? V8
?UNNING ?ETWORK64 V1.26A
?UPPORTING 38400 ?AUD ?ATES
?ESTING ?CHO-?ET V1 BETA
?EATURING ?ESSAGES, ?ILES,
?ET?AIL, AND ?NLINE ?AMES!
?YS?P: ? ? ? ? ? ? ? ? ?
?RESS ANY KEY TO LOGIN\C?
The result is different!
Can someone help me along here... I have been trying to figure out how to do this for approx. a year or so... it has been a very slow process.
I could use a guru to help me out so I can write the upload and download routines for my Commodore BBS PETSCII Emulation Server.
Visit http://www.retrogradebbs.com for details.
Thanks.
Please help out a dedicated developer who is in over his head...
-Dave

Ok. Fair enough. What about general information about Xmodem. This is a hard project because of how obscure the legacy technology is that I am having to implement using Java and MySQL.
I have two major issues which I have to figure out how to troubleshoot and debug, if possible.
1. The 23+ blocks exception when a file is being received
2. The exception which is thrown immediately if I try to receive a binary file instead of an ASCII file.
I read that telnet is a 7-bit technology and that is why Xmodem, which is an 8-bit technology is not that popular as a viable protocol via telnet, whereas Kermit is, since it was developed for 7-bit systems, i.e. mainframes and minicomputers.
Is this correct?
If that is the case, why does www.serio.com have a viable X-Y-ZModem library available (for several hundred $$$ of course) which can be used with both RS-232 serial ports and TCP socket ports? Obviously, it can be done. They are the ONLY company with this library for sale for Java to do this. I cannot justify that $$$ amount for a mere hobby (writing the BBS emulation server for supporting Commodore PETSCII (CG) callers via CGTerm or a native C-64 terminal program using Jim Brain's TCPSER middleware, which emulates a Hayes modem via telnet for telBBSing/retrocomputing.
I really want to learn how to implement a file transfer protocol, since back in the 80s, I used Xmodem, Punter, Y/Z Modem, etc., a lot to upload and download files via modem at baud rates of 2400, 14.4, 19.2, and 38.4, respectively.
It's fun to learn how the old skool gurus of telecommunications technology did it. It is one thing to run a BBS which supports these technologies and features, and it is an entirely other thing to learn how to design and develop them yourself for implementation into a project such as I taken on.
It CAN be done. It WILL be done. However, I have just started my exhaustive research on how it needs to be done. I have read up as much as I could on XModem by Ward C., the father of the protocol.
But, I have no information to help me figure out why the communications are acting as they do so far.
Can someone please download the xserver.zip file on my website at:
www.retrogradebbs.com/projects/xserver.zip
Compile it. Run it. Connect using HyperTerminal, Netrunner, or another telnet terminal emulation program which supports Xmodem file transfers using WinSock.
See what happens. With finals due in the next two days, this project will have to be put on hold until after I submit my two final projects.
If anyone knows what needs to be done to support both ASCII and BINARY file transfers via Xmodem via a socket instead of a modem with RTS/CTS hardware flow control, please respond.
I know for a fact that this can be done.
- Dave

Similar Messages

  • For weeks I have been viewing a doggy day care via their web cam.  This weekend I upgraded to Lion and have been unable to view the center since.  I get an error message for java webcam class not found.  All of my software is up to date--suggestions?

    For weeks I have been viewing a doggy day care center via their web cam.  This weekend I upgraded to Lion and have been unable to view the center.  I get an error message for Java plug-in 1.6.0_29 ....webcam class not found.  Any suggestions on how to fix this?

    Sorry, don't know what else to suggest unless there's a URL to the problem stream that someone here can try. Otherwise we can't test it to try and determine what might be wrong.
    BTW, make sure they're testing it with a Mac, not with a Windows system. If they test only with Windows, what they say is or is not working doesn't mean much.
    Regards.

  • How to create a report with data using the Crystal Reports for Java SDK

    Hi,
    How do I create a report with data that can be displayed via the Crystal Report for Java SDK and the Viewers API?
    I am writing my own report designer, and would like to use the Crystal Runtime Engine to display my report in DHTML, PDF, and Excel formats.  I can create my own report through the following code snippet:
    ReportClientDocument boReportClientDocument = new ReportClientDocument();
    boReportClientDocument.newDocument();
    However, I cannot find a way to add data elements to the report without specifying an RPT file.  Is this possible?  I seems like it is since the Eclipse Plug In allows you to specify your database parameters when creating an RPT file.
    is there a way to do this through these packages?
    com.crystaldecisions.sdk.occa.report.data
    com.crystaldecisions.sdk.occa.report.definition
    Am I forced to create a RPT file for the different table and column structures I have? 
    Thank you in advance for any insights.
    Ted Jenney

    Hi Rameez,
    After working through the example code some more, and doing some more research, I remain unable to populate a report with my own data and view the report in a browser.  I realize this is a long post, but there are multiple errors I am receiving, and these are the seemingly essential ones that I am hitting.
    Modeling the Sample code from Create_Report_From_Scratch.zip to add a database table, using the following code:
    <%@ page import="com.crystaldecisions.sdk.occa.report.application.*"%>
    <%@ page import="com.crystaldecisions.sdk.occa.report.data.*"%>
    <%@ page import="com.crystaldecisions.sdk.occa.report.document.*"%>
    <%@ page import="com.crystaldecisions.sdk.occa.report.definition.*"%>
    <%@ page import="com.crystaldecisions.sdk.occa.report.lib.*" %>
    <%@ page import = "com.crystaldecisions.report.web.viewer.*"%>
    <%
    try { 
                ReportClientDocument rcd = new ReportClientDocument();
                rcd.newDocument();
    // Setup the DB connection
                String database_dll = "Sqlsrv32.dll";
                String db = "qa_start_2012";
                String dsn = "SQL Server";
                String userName = "sa";
                String pwd = "sa";
                // Create the DB connection
                ConnectionInfo oConnectionInfo = new ConnectionInfo();
                PropertyBag oPropertyBag1 = oConnectionInfo.getAttributes();
                // Set new table logon properties
                PropertyBag oPropertyBag2 = new PropertyBag();
                oPropertyBag2.put("DSN", dsn);
                oPropertyBag2.put("Data Source", db);
                // Set the connection info objects members
                // 1. Pass the Logon Properties to the main PropertyBag
                // 2. Set the Server Description to the new **System DSN**
                oPropertyBag1.put(PropertyBagHelper.CONNINFO_CRQE_LOGONPROPERTIES, oPropertyBag2);
                oPropertyBag1.put(PropertyBagHelper.CONNINFO_CRQE_SERVERDESCRIPTION, dsn);
                oPropertyBag1.put("Database DLL", database_dll);
                oConnectionInfo.setAttributes(oPropertyBag1);
                oConnectionInfo.setUserName(userName);
                oConnectionInfo.setPassword(pwd);
                // The Kind of connectionInfos is CRQE (Crystal Reports Query Engine).
                oConnectionInfo.setKind(ConnectionInfoKind.CRQE);
    // Add a Database table
              String tableName = "Building";
                Table oTable = new Table();
                oTable.setName(tableName);
                oTable.setConnectionInfo(oConnectionInfo);
                rcd.getDatabaseController().addTable(oTable, null);
        catch(ReportSDKException RsdkEx) {
                out.println(RsdkEx);  
        catch (Exception ex) {
              out.println(ex);  
    %>
    Throws the exception
    com.crystaldecisions.sdk.occa.report.lib.ReportSDKException: java.lang.NullPointerException---- Error code:-2147467259 Error code name:failed
    There was other sample code on SDN which suggested the following - adding the table after calling table.setDataFields() as in:
              String tableName = "Building";
                String fieldname = "Building_Name";
                Table oTable = new Table();
                oTable.setName(tableName);
                oTable.setAlias(tableName);
                oTable.setQualifiedName(tableName);
                oTable.setDescription(tableName) ;
                Fields fields = new Fields();
                DBField field = new DBField();
                field.setDescription(fieldname);
                field.setHeadingText(fieldname);
                field.setName(fieldname);
                field.setType(FieldValueType.stringField);
                field.setLength(40);
                fields.add(field);
                oTable.setDataFields(fields);
                oTable.setConnectionInfo(oConnectionInfo);
                rcd.getDatabaseController().addTable(oTable, null);
    This code succeeds, but it is not clear how to add that database field to a section.  If I attempt to call the following:
    FieldObject oFieldObject = new FieldObject();
                oFieldObject.setDataSourceName(field.getFormulaForm());
                oFieldObject.setFieldValueType(field.getType());
                // Now add it to the section
                oFieldObject.setLeft(3120);
                oFieldObject.setTop(120);
                oFieldObject.setWidth(1911);
                oFieldObject.setHeight(226);
                rcd.getReportDefController().getReportObjectController().add(oFieldObject, rcd.getReportDefController().getReportDefinition().getDetailArea().getSections().getSection(0), -1);
    Then I get an error (which is not unexpected)
    com.crystaldecisions.sdk.occa.report.lib.ReportDefControllerException: The field was not found.---- Error code:-2147213283 Error code name:invalidFieldObject
    How do I add one of the table.SetDataFields()  to my report to be displayed?
    Are there any other pointers or suggestions you may have?
    Thank you

  • How do I transfer a sound file via TCP?

    I have a .wav file that I'm trying transfer via TCP.  Using LV 8.5, I modified the "Sound File to Output.vi" example to send the data across a TCP connection to a client vi.  But, I've encountered numerous errors along the way with trying to convert the sound data which is a  1-D array of waveform double.  I've attached my server and client VI, but essentially, what I tried to do is break down the array into the y and dt components, send those over the TCP connection, rebuild the waveform client-side, and then play the waveform.  Is there something I'm missing?  Do I need the timestamp information as well and send that over too?  Please let me know how this can be accomplished.  Thanks!
    Attachments:
    Streaming Music - Server.vi ‏97 KB
    Streaming Music - Client.vi ‏65 KB

    One thing to clarify: While the Sound Output Write does not need the dt information, the dt information wouold be required when you use the Configure VI in order to set up the rate.  However, you only need to send that parameter once. Thus, it would seem to me that you want to change your client code so that it checks to see if it receives a special command or something to indicate the start of a new song that may have been sampled at a different rate. If this is the case, then you can reconfigure the sound output. Otherwise, all that you're listening for is just song data that you send along to the Sound Output Write.

  • ANN: Oracle XML Parser for Java v2.0.0.1

    A new maintenance release of the Oracle Parser for Java is
    available for download. It has the following fixes and changes:
    Bug fixes for #920536, i.e. Cannot access element attributes via
    XSLT; #898423. i.e. ElementDecl's in DTDs; #774774, i.e. DOM
    extensions using XSL pattern matching; #863890 i.e. SAX
    IOException not thrown.
    New APIs in the following new interface:
    1. oracle.xml.parser.v2.NSResolver
    - resolveNamespacePrefix( find the namespace definition in scope
    for a given namespace prefix )
    New APIs in the following classes:
    1. oracle.xml.parser.v2.XMLNode
    - selectNodes( Selects nodes from the tree which match the given
    pattern; client can provide an NSResolver implementation to
    resolve namespace prefixes in the pattern ).
    2. oracle.xml.parser.v2.ElementDecl
    - getParseTree( Returns the root Node of Content Model parse
    tree, which could then be traversed node by node using
    getFirstChild() and getLastChild(). The Node types are: PLUS,
    COMMA, ASTERISK, ELEMENT, QMARK ).
    This is the first beta patch release for v2.
    Oracle XML Team
    http://technet.oracle.com
    Oracle Technology Network
    null

    unzip -l appsborg2.zip | grep 9.0.4
    0 04-18-03 20:10 .xdkjava_version_9.0.4.0.0_production
    do i still need to do that step?No, you do not have to since "XML Parser for Java v9.0.4" is already installed as part of appsborg2.zip

  • Can I leverage JDom or Dom4J for java mapping in PI 7.0?

    Hi,
    since we know that PI 7.0 is based on jdk1.4 which officially allows DOM and SAX,but could I using the open source API like JDom or Dom4J via importing the related jar file to PI IR for java mapping?Anyone tried that?

    Hi ,
             I tried importing jar files into PI7.0 I was able to do so.
    First add the external jar file for JDOM into build path in eclipse (or NWDS). I did this in eclipse.
    Again I tried to import the same jar file into project within eclipse. Then the jar file will be broken into class files.
    Now compile the JDOM code you wrote and do project ->build all. This will generate the class file for your source code in addition to the class files formed earlier. Now exit from eclipe. Move to source folder of the eclipse. there you will find the .java file and the set of class files which were imported into the project earlier. Copy these files to separete folder say "myclass". Now again move to "bin" folder of your eclipse settings and obtain the .class file for the source code you have written. Copy this class file to the  "myclass" folder. Now using WINZIP zip all files into one ZIP file within "myclass" folder. Finally import this ZIP into PI 7.0 server. Run the mapping code using test tab. If you are getting any linkage error then you need to obtain correct external jar for JDOM parser else the mapping should run fine.
    Regards
    Anupam

  • How to Ping Hardware via TCP/IP

    I need to ping a device to check connectivity via TCP/IP.  I'm currently using a 3rd party control that has a memory leak.  Is there a way to do this within Labview without using a 3rd Party control?

    [SOLVED]
    Hi
    I need to check several devices by pinging them.
    I don't want to use the windows console method with parsing.
    If I use the ping.llb described under the second link above the labview runtime is crahing latest after 12 hours without any replies. Ping frequency was 400 ms, 1 second would be OK but not nice.
    After all the crashs I decide to use the .net Framework which includes an own Ping class.
    Attached you can find this, at the moment test,  VI which is running in a mini project on my PC.
    For testing purposes I set the delay time constant low, later my wish is something between 400-100ms.
    Problem: If you open the WinXP task manager the used memory of process "labview.exe" is rising rapidly until .net throw an exeption.
    How can I prevent that the memory is rising until a crash occur??? If I reduce the time the memory usage is rising as well, just slow....
    Here is the link to the class description: http://msdn.microsoft.com/en-us/library/system.net.networkinformation.ping.aspx
    Thanks for your help
    Tim
    SOLUTION: I connected the "close reference" on the wrong wire....
    It seems to run even with 0 ms time constant (for testing). I have attached the corrected version.
    Message Edited by computerkammer on 05-17-2008 08:31 AM
    Attachments:
    pingdotnet1.vi ‏17 KB

  • Socket communication via TCP-IP

    Hi,
    I am new to CF and would like to establish TCP-IP socket
    communication with a remote server. How can I exchange XML messages
    with a remote server / port via TCP-IP. Do I need to use the event
    gateways of does CF offer another way of setting up socket
    communication ?
    Many thanks in advance !
    John

    Do I need to use the event gateways of does CF offer another way
    of setting up socket communication ?
    I would say, yes, use the socket gateway that ships with
    Coldfusion. However, it has a functionality I cannot really
    understand. If you are a client setting up a socket to connect to
    the gateway, the gateway expects your code to have, beforehand, a
    value for the variable
    originatorID. Yet,
    originatorID is a large, unique integer that the gateway
    code generates when you connect. That seems to me to be a
    chicken-and-egg dilemma.

  • Problems with JNDI lookup for java:comp/env/ejb

    Hi all,
    I'm using OC4J 9.0.3 and I have problems when looking up for the local
    EJB context.
    I have a SLSB which refers to another SLSB via a JNDI mapping like
    shown below. Both services are deployed within one EAR file.
    (snippets of ejb-jar.xml and orion-ejb-jar.xml)
    <ejb-jar>
    <enterprise-beans>
    <session>
    <ejb-name>ServiceABean</ejb-name>
    <home>com.coi.ServiceAHome</home>
    <remote>com.coi.ServiceA</remote>
    <ejb-class>com.coi.ServiceABean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    <ejb-ref>
    <ejb-ref-name>ejb/some/sub/packages/ServiceB</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>com.coi.ServiceBHome</home>
    <remote>com.coi.ServiceB</remote>
    </ejb-ref>
    </session>
    </enterprise-beans>
    </ejb-jar>
    <orion-ejb-jar>
    <enterprise-beans>
    <session-deployment location="global/some/sub/packages/ServiceA" name="ServiceABean">
    <ejb-ref-mapping name="ejb/some/sub/packages/ServiceB" location="global/some/sub/packages/ServiceB" />
    </session-deployment>
    </enterprise-beans>
    </orion-ejb-jar>
    The ApplicationInitialContextFactory will be used (prepared by the container),
    so the lookup for ServiceB within a method of ServiceA should work as follows:
    public class ServiceABean implements SessionBean
    public void someMethod()
    InitialContext con = new InitialContext(); // will be of class ApplicationContext
    Context localEjbContext = (Context)con.lookup( "java:comp/env/ejb" );
    ServiceBHome serviceBHome = (ServiceBHome) PortableRemoteObject.narrow(
    localEjbContext.lookup( "some/sub/packages/ServiceB" ),
    ServiceBHome.class );
    The problem is now, that the lookup for "java:comp/env/ejb" doesn't work
    and throws a NameNotFoundException.
    To figure out what's actually happening during lookup I debugged a little bit and
    tried a few things:
    1. A lookup for "java:comp" works fine. It returns an instance of class FlatMapContext
    which consists of a hash map which itself contains an entry for "env".
    2. So a lookup for "env" on that FlatMapContext also works and returns an instance of SubContext.
    3. A lookup for "ejb" using this SubContext causes a NameNotFoundException
    with message "java:comp/env/ejb not found".
    4. A lookup like con.lookup( "java:comp/env" ) throws also a NameNotFoundException
    with message "java:comp/env not found (not inside a J2EE module, for instance a Web-App,
    EJB, or Application-Client)".
    Does anyone know something about this?
    Regards
    --thomas

    Hi Debu,
    Great! 9.0.4 will be released in june/july this year, right? Sorry for my ironical reaction, but does that mean, that I don't have any chance to get my whole stuff running in 9.0.3? I cannot believe that. Isn't there a wordaround I could apply? A setting or whatever to substitute the daft FlatCtx by something else that is implemented according to the spec?
    Regards
    --thomas

  • I have problem in transfeering data using field point via tcp

    I am reading the values from the filed point, which is connected, to the RT controller and transferring the values to the client PC via TCP at a specified acquisition rate.
     Case1 when the acquisition rate is 0.1 minutes I get the values from the controller correctly i.e. 5v, 5v, and the chart shows no change. The timed out of the TCP read is default value i.e. is 250ms
     But when I change the acquisition rate to .5 minutes I get the values as 5v, 0v, 5v, and 0v. The time out of the TCP read is same as first case. The inputs to the field point are at the constant 5v.
    Please tell how to solve the problem so as to see the plot in the chart continuously as inputs for the field points the read
    ing are at constant rate of input 5v.

    Suresh,
    Since this question deals with using the LabVIEW TCP/IP functions, you are better off posting it to the LabVIEW discussion forum.
    Regards,
    Aaron

  • When i have a ticked box for Java script i'm still not able to acess things on the i player. Why is this?

    I have tried to load Java Script so that i can watch things on the BBC i player. I have followed the instructions for loading Java Script as told on the BBC i player i.e i have a ticked box for Java Script but i still can't watch things on the i player. I seem to be doing something wrong, but not sure what it is!

    What error are you getting when you try ? If you are getting a network timeout then try temporarily turning off your firewall and antivirus software until the download has completed. Or you could downloading the update via a browser : https://discussions.apple.com/message/16436025#16436025

  • How 2 connect webdynpro for java to R/3 system

    could any one tell me . how 2 connect web Dyn pro for java to connect to R/3 system????

    Hi,
    Pls check threads like
    Read R/3 table in Webdynpro
    Changing R/3 data in webdynpro
    or go via Jco
    http://help.sap.com/saphelp_nw04/helpdata/en/6f/1bd5c6a85b11d6b28500508b5d5211/frameset.htm
    JCO
    Eddy
    PS. Reward useful answers and earn points yourself

  • Lotus Notes connectivity in WebDynpro for Java

    Hi,
    in case we want to implement some content stored in an Lotus Notes database. For example a simple corporate phonelist. What are our options to get these data represented in our portal if we dont want to use the standard "Notes DB web-enabled" output.
    Is it possible to develope for example a webDynpo for Java application which connects via JCo(??) to Notes, greps the data there and interacts with it so that we can use the standard portal UI-Elements?
    Do you know where to find some specified information for that issue?
    Thanks and best regards
    Markus Armbruster

    Hello Markus,
    I already tested several options for connecting Web Dynpro to Lotus Notes/Domino. You may use Java technology (IIOP) or web technology (simple HTTP/XML or HTTP/SOAP).
    in order to use IIOP, simple include NSCO.jar in the lib path of your SAP J2EE engine instances. Then you are able to use the classes stubs for NotesFactory(), NotesSession() etc. within WD.
    if you use HTTP then connect using web services. The data is then transferred e.g. via XML or DXL.
    I have some samples running in case you need more information I can send you the source.
    Regards
    Michael

  • CVS extension no longer available via "Check for Updates" ?

    Hi,
    It seems that CVS (or any other Versioning support tools) SQLDev extension are no longer available via "Check for Updates".
    I've just downloaded 2.1.1.64 and tried to setup whatever extensions we used to use and they simply do not appear in the list.
    Can this extension be downloaded as a bundle and installed from local file? Where from?
    Oracle SQL Developer 2.1.1.64
    Version 2.1.1.64
    Build MAIN-64.45
    IDE Version: 11.1.1.2.36.55.30
    Product Version: 11.1.1.64.45
    Java(TM) Platform 1.6.0_11
    Oracle IDE 2.1.1.64.45
    Versioning Support 2.1.1.64.45
    Cheers
    Arek
    Edited by: Arek on Oct 12, 2010 7:11 PM

    Thank you, Sue. Much appreciated.
    FYI. I've just downloaded SQLDev 3EA release and I'm still facing the same problem.
    Default Update Centers available are:
    1) Oracle SQL Developer ( http://www.htmldb.oracle.com/pls/otn/f?p=raptor:updates )
    2) Oracle Extensions ( http://www.oracle.com/ocom/groups/public/@otn/documents/webcontent/162031.xml )
    3) Third Party SQL Developer Extensions ( http://www.oracle.com/ocom/groups/public/@otn/documents/webcontent/162031.xml )
    When I mark the first two all I get at the next screen is two entries:
    Oracle Product Extensions for SQL Developer   (Hide) (- which is simply a header I suppose)
    Oracle Rdb Extension 7.3 (Details)
    The CVS extension jars can be copied from previous SQLDev installations (download used to work a couple of releases back), but it should be still available for download via "Check for Updates" or bundled with the product itself.
    Regards
    Arek
    Edited by: Arek on Oct 15, 2010 2:05 PM

  • Database access tool for Java Development

    Hi,
    A couple of days back, our SAP's database (MSSQL) was corrupted and downed the Java Stack.
              During the Java development, normally after a newly created table was deployed via Java Dictionary, Java developer will access the database via the MSSQL Enterprise Manager to view/delete/update data. Unlike the ABAP development, all database access was done via SE16 in SAPGUI. It was believed that the Java Development kind of direct access to the database via the MSSQL Enterprise Manager was causing some MSSQL tables to be corrupted, and thus downed the Java Stack.
    1. Is there any tool like SE16 to access database during the Java Development?
    2. If no, what kind of recommendation/tool to access database for Java Development?
    Any help would be much appreciated. Thanks.
    julius

    Julius,
    There are no industry recommended open source DB tools.
    Normally it depends upon the developer preferences that how he/she wants to see the tool usability.
    I can suggest you to go through the below link:
    http://sourceforge.net/search/?type_of_search=soft&words=SQL+Tools
    You can find many open source SQL tools, which you have to test and select one among them.
    I can suggest you to use:
    1) TOra
    2) Easy SQL
    3) SQuirrel
    "Choose a Tool which is easy to use and efficient, Dont worry about Look n Feel"
    Best of Luck

Maybe you are looking for