This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes This weeks Giveaway Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "This weeks Giveaway" Watch "This weeks Giveaway" New topic
Author

This weeks Giveaway

Carl Trusiak
Sheriff

Joined: Jun 13, 2000
Posts: 3340
This week we are giving away 4 copies of the book Professional Java EAI.
The best part, the Author, Matjaz Juric will be on line to answer your questions.
Everyone give Matjaz a warm JavaRanch welcome.
Thanks to the people at Wrox for the books.
Marcos Maia
Ranch Hand

Joined: Jan 06, 2001
Posts: 977
Hi,
It would be great to win this book... if I really receive it after all!!!
Axel Janssen
Ranch Hand

Joined: Jan 08, 2001
Posts: 2164
Hi Matjaz,
Sounds really interesting that what I read in amazon.
Do you think one has to have profound knowledge in more advanced topics like EJB, JCA, RMI, CORBA, JMS? Or is the book a good overview-companion to get familiar with those technologies?
Regards Axel
Matjaz Juric
Author
Ranch Hand

Joined: Aug 02, 2001
Posts: 65
Hi everybody,
I'm glad to be here with you. Allow me to write a few sentences about the book “Professional Java EAI”. As the name suggests, the book is about EAI = Enterprise Application Integration. The book addresses two important topics:
1.How to integrate applications within the company
2.How to achieve integration between companies (often called intra-EAI or B2B – Business to business)
In both cases the book is focused on Java; more exactly on the J2EE platform. The fact is namely that companies who adopted J2EE usually had several existing applications written in other technologies than Java. The fact is also that enterprise applications cannot exist isolated. The trend today is to integrate the applications within the company. The integrated information system, which provides instant access to information, is very important for each company success. And there is more: to build successful B2B integration (Web Services), it is crucial that companies have well integrated applications. Only then the Web Services can function effectively. According to GartnerGroup this is a key success factor.
The question obviously is how we can achieve integration. In the book we describe the process of integration based around J2EE. We present the various stages:
-data level integration
-application interface level integration
-business method level integration
-presentation integration
-B2B integration
Each stage builds on the previous and provides a higher level of integration. In each stage we cover the relevant technologies. For data level integration we cover JDBC, XML, XSLT and JMS. We answer questions such as how to move data from one database to another. Should we use plain text or XML? How can we transform data? How can XSLT help? …
For application interface level and business method level we cover CORBA, RMI-IIOP, EJB, Java Connector Architecture, COM bridges, Transactions and Security. For example – how to access applications written in other programming languages than Java? How to access EJBs from C++ and other languages? How to integrate with Microsoft Windows COM+? How to propagate transactions and security contexts to other applications? What is X/Open DTP? How can Java Connectors be used? …
For presentation integration we cover JSP/Servlets, XML, XSLT and portal servers. For example: should we use JSP/Servlet centric design or front controller design? How can XML/XSLT help to make UI client independent? When to use a portal server? …
And finally for B2B we take a look at SOAP, UDDI, and WSDL through the new Java APIs for XML (JAX*): JAXP, JAXM, JAX/RPC, JAXB, and JWSDL. For example: how to use the mentioned APIs, how to develop a Web Service from an EJB, etc.
Well, I hope you’ve got an overview of the book. Now, I would like to hear your opinions and your integration problems.
Cheers,
Matjaz


Matjaz Juric<br />Author of <a href="http://www.amazon.com/exec/obidos/ASIN/186100544X/qid%3D1008676221/sr%3D8-1/ref%3Dsr%5F8%5F5%5F1/103-4928879-8274265" target="_blank" rel="nofollow">Professional J2EE EAI</a> and <a href="http://www.amazon.com/exec/obidos/ASIN/1861005083/ref=ase_electricporkchop" target="_blank" rel="nofollow">Professional EJB</a>
Matjaz Juric
Author
Ranch Hand

Joined: Aug 02, 2001
Posts: 65
Hi Axel,
Originally posted by Axel Janssen:
Do you think one has to have profound knowledge in more advanced topics like EJB, JCA, RMI, CORBA, JMS? Or is the book a good overview-companion to get familiar with those technologies?

I don't think you need profound knowledge in EJB, JCA, etc. You should be familiar with Java language and some knowledge of J2EE. Each chapter provides enough overview information for each technology to get started. However, the book is not a "beginning" type and it also provides a lot of advanced stuff, which you need in real-world problems (and once you are familiar with the technology). We believe that the book covers all relevant technologies for EAI (Enterprise Application Integration) - and it covers them from the integration standpoint.
Cheers,
Matjaz
Ruilin Yang
Ranch Hand

Joined: Jan 06, 2002
Posts: 150
I have a legacy system (A Web application)written with CGI, Perl, HTML and using Oracle database. I do not want to rewrite it. I want to spend minimum to access to this legacy system through my java application client (which is the client application to my J2EE application server).
Would you please tell me what is the best solution to access this legacy system through my java application client ?
Thanks
Ruilin
JeanLouis Marechaux
Ranch Hand

Joined: Nov 12, 2001
Posts: 906
Matjaz,
Does the book mention O/R mapping (CocoBase, Toplink...) or do you think it is out of concern ?


/ JeanLouis<br /><i>"software development has been, is, and will remain fundamentally hard" (Grady Booch)</i><br /> <br />Take a look at <a href="http://www.epfwiki.net/wikis/openup/" target="_blank" rel="nofollow">Agile OpenUP</a> in the Eclipse community
Tiger Scott
Ranch Hand

Joined: Mar 01, 2001
Posts: 223
Matjaz:
Does the book deal with any specific implementation of EAI or it deals with JCA in general. What I want to know also is- are any specific JCA implementaions already available.
Thanks
Sanjay
Ram Dhan Yadav K
Ranch Hand

Joined: Aug 13, 2001
Posts: 321
Hi Matjaz,
its good to have you here. We have EAI tools from IONA, BEA, VITRIA, Webmethods etc. Are these EAI's different form what you have mentioned in your book. If different is there any effort by these companies to implement the JCA architecture. Do you provide any examples related to any one of these EAI providers? What do you think is the difference between the existing EAI products and the ones which are JCA compatible?
thaks,


Ram Dhan Yadav (SCJP, SCWCD, SCJA-I, IBM EC(483))
"We are what we repeatedly do. Excellence, then, is not an act, but a habit."
Matjaz Juric
Author
Ranch Hand

Joined: Aug 02, 2001
Posts: 65
Hi Rulin,
Originally posted by Rulin Yang:
I have a legacy system (A Web application)written with CGI, Perl, HTML and using Oracle database. I do not want to rewrite it. I want to spend minimum to access to this legacy system through my java application client (which is the client application to my J2EE application server).
Would you please tell me what is the best solution to access this legacy system through my java application client ?

I'm afraid choosing the best solution for integrating your legacy systems is not so easy. First of all, why would you want to access a Web application from a java application client? Anyway, there are several possible solutions:
- CORBA
- JMS/MOM
- Direct database access
- Even JCA, although probably the last choice.
Which you choose depends on how your application is designed, if it supports APIs, on performance, type of communication, etc.
Cheers,
Matjaz
[ February 05, 2002: Message edited by: Matjaz Juric ]
Matjaz Juric
Author
Ranch Hand

Joined: Aug 02, 2001
Posts: 65
Hi Bill,
Originally posted by Bill Bailey:
Does the book mention O/R mapping (CocoBase, Toplink...) or do you think it is out of concern ?

The book does not cover third party O/R products; however it covers CMP 1.1 and CMP 2.0 persistence models.
Cheers,
Matjaz
Matjaz Juric
Author
Ranch Hand

Joined: Aug 02, 2001
Posts: 65
Hi Sanjay,
Originally posted by Sanjay Bahal:
Does the book deal with any specific implementation of EAI or it deals with JCA in general. What I want to know also is- are any specific JCA implementaions already available.

The book covers J2EE platform (and related technologies) for the purposes of EAI. It does not cover only JCA but also all other technologies. For JCA it addresses it in general and shows an example on SAP resource adapter. Please see my previous message for more information on what's in the book.
Cheers,
Matjaz
Matjaz Juric
Author
Ranch Hand

Joined: Aug 02, 2001
Posts: 65
Hi Ram,
Originally posted by Ram Dhan Yadav K:
We have EAI tools from IONA, BEA, VITRIA, Webmethods etc. Are these EAI's different form what you have mentioned in your book. If different is there any effort by these companies to implement the JCA architecture. Do you provide any examples related to any one of these EAI providers? What do you think is the difference between the existing EAI products and the ones which are JCA compatible?

The EAI tools from the companies you've mentioned are all targeting a certain EAI problem. Our book is about EAI with J2EE platform - and it covers all relevant technologies, not only JCA (see my previous message). JCA (Java Connector Architecture) addresses the problem of accessing EIS systems through a common interface. A little simplified, JCA is for EIS systems what JDBC is for databases.
Cheers,
Matjaz
Ruilin Yang
Ranch Hand

Joined: Jan 06, 2002
Posts: 150
Matjaz,
Thanks a lots for providing the possible solutions:
- CORBA
- JMS/MOM
- Direct database access
- Even JCA, although probably the last choice.
I am trying to use a typical Java Swing application client program to access the legacy system. To me JMS/MOM may be promising. Would you please give me more light on this choice.
Thanks,
Ruilin
Ram Dhan Yadav K
Ranch Hand

Joined: Aug 13, 2001
Posts: 321
Hi Matjaz ,
Thanks for clarification, suddenly it dawned to me that EAI is different from EIS.
Well, hope i will win your book.
thanks,
Murali Nanchala
Ranch Hand

Joined: Mar 14, 2001
Posts: 74
Originally posted by Rulin Yang:
I have a legacy system (A Web application)written with CGI, Perl, HTML and using Oracle database. I do not want to rewrite it. I want to spend minimum to access to this legacy system through my java application client (which is the client application to my J2EE application server).
Would you please tell me what is the best solution to access this legacy system through my java application client ?
Thanks
Ruilin

Hi Rulin,
From what I understand of your question is that you want to wrap the whole legacy system (services et. al.) in a J2EE compliant environment and provide a client for accessing it.
Since the most important part of your system is the Database, you could build a new J2EE application, use it to access the Database and run it in any J2EE Application Server of your choice.
This can prove to be the most appropriate solution for your problem. And the best parts are:
1. you could reuse your SQL from the legacy system
2. you dont need to write a client if you provide a web service
Think about it..
Murali


"It is almost always answered in the API" - Murali Nanchala
Ruilin Yang
Ranch Hand

Joined: Jan 06, 2002
Posts: 150
Murali,
Thanks. I think what you suggest is a robust solution. However, it may involve fairly large amount of work to rewrite the logic.
The lagacy Web application is an account system. For example, a check account for various customers. If the java swing based application client (of a newly developed J2EE) can access to the lagacy system to check the account balance of a customer, that would be enough. I am looking for the minimum work to achieve this.
Please help
Thanks
Ruilin
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
Matjaz, As moderator of this forum I just wanted to welcome you.


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Doug Wang
Ranch Hand

Joined: Oct 05, 2001
Posts: 445
Hi Ruilin,
Maybe you should try URL or URLConnection classes from java.net package. That is the minimum work addressing your issue.
[ February 06, 2002: Message edited by: Doug Wang ]

Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep
Dieter Cailliau
Greenhorn

Joined: Jan 17, 2002
Posts: 11
Hi Matjaz,
a question for really clever guys like you must be one:
question is a topic itself
(i'm sorry for the forwarding, but as a programmer i can not duplicate a question on many places)
Matjaz Juric
Author
Ranch Hand

Joined: Aug 02, 2001
Posts: 65
Hi Rulin,
Originally posted by Rulin Yang:
I am trying to use a typical Java Swing application client program to access the legacy system. To me JMS/MOM may be promising. Would you please give me more light on this choice.

The idea is to wrap and reuse the existing application. Now, there are several ways to do this. The most common way is to add one or several wrappers, through which you can access the functionality of your legacy application programmatically (that is through an API). I assume that your legacy application currently does not provide an API. Therefore you will have to add one.
One possibility is to use JMS/MOM. You will have to add support for MOM product in your legacy application. Then you will be able to develop a Java Swing client, which will use JMS to send a message request to your legacy application and get a response.
A very similar approach can be used with CORBA. With CORBA you add interfaces to your legacy application and use RMI-IIOP (or Java IDL) from Java Swing application to access the legacy system.
The main difference between the two approaches is that JMS/MOM uses asynchronous and CORBA synchronous communication. The question is however, if it is worth adding interfaces to your legacy application. Does the application contain business logic which you cold reuse? Or do you want to reuse data stored in the DB mainly? If you only want to reuse data then direct database access can be the solution.
The third option is to use the so called “client emulation” technique. Your Java Swing application can pretend that it is a regular user. This technique is in EAI known as screen scrapping (or terminal emulation).
Hope this will help in further discussion. Cheers,
Matjaz
Matjaz Juric
Author
Ranch Hand

Joined: Aug 02, 2001
Posts: 65
Thanks Thomas, I'm glad to be here too.
Originally posted by Thomas Paul:
Matjaz, As moderator of this forum I just wanted to welcome you.

Cheers,
Matjaz
Matjaz Juric
Author
Ranch Hand

Joined: Aug 02, 2001
Posts: 65
Originally posted by Doug Wang:
Maybe you should try URL or URLConnection classes from java.net package. That is the minimum work addressing your issue.

This might be a good idea. That's what I meant as “client emulation” technique in my answer. However keep in mind that Java Swing client will not be very easy to develop and that this solution is not "clean". Any change in your legacy application user interface will require modifications in Java Swing client too.
Cheers,
Matjaz
Matjaz Juric
Author
Ranch Hand

Joined: Aug 02, 2001
Posts: 65
Hi Dieter,
Originally posted by Dieter Cailliau:
a question for really clever guys like you must be one:
question is a topic itself
(i'm sorry for the forwarding, but as a programmer i can not duplicate a question on many places)

I have to admit that I didn't get the complete understanding of your EJB from your description. However your solution is interesting. Maybe this quote from EJB 2.0 spec will help you:
"10.5.11 Non-reentrant and re-entrant instances
An entity Bean Provider can specify that an entity bean is non-reentrant. If an instance of a non-reentrant entity bean executes a client request in a given transaction context, and another request with the same transaction context arrives for the same entity object, the container will throw an exception to the second request. This rule allows the Bean Provider to program the entity bean as single-threaded, non-reentrant code.
The functionality of entity beans with container-managed persistence may require loopbacks in the same transaction context. An example of a loopback is when the client calls entity object A, A calls entity object B, and B calls back A in the same transaction context. The entity bean’s method invoked by the loopback shares the current execution context (which includes the transaction and security contexts) with the Bean’s method invoked by the client.
If the entity bean is specified as non-reentrant in the deployment descriptor, the Container must reject an attempt to re-enter the instance via the entity bean’s component interface while the instance is executing a business method. (This can happen, for example, if the instance has invoked another enterprise bean, and the other enterprise bean tries to make a loopback call.) If the attempt is made to reenter the instance through the remote interface, the container must throw the java.rmi.RemoteException to the caller. If the attempt is made to reenter the instance through the local interface, the container must throw the javax.ejb.EJBException to the caller. The container must allow the call if the Bean’s deployment descriptor specifies that the entity bean is re-entrant.
Re-entrant entity beans must be programmed and used with caution. First, the Bean Provider must code the entity bean with the anticipation of a loopback call. Second, since the container cannot, in general, tell a loopback from a concurrent call from a different client, the client programmer must be careful to avoid code that could lead to a concurrent call in the same transaction context. Concurrent calls in the same transaction context targeted at the same entity object are illegal and may lead to unpredictable results. Since the container cannot, in general, distinguish between an illegal concurrent
call and a legal loopback, application programmers are encouraged to avoid using loopbacks. Entity beans that do not need callbacks should be marked as non-reentrant in the deployment descriptor, allowing the container to detect and prevent illegal concurrent calls from clients."
Doug Wang
Ranch Hand

Joined: Oct 05, 2001
Posts: 445
Hi Matjaz,
Thanks for your informative replies.
So there are two important kinds of integration:
One should be called internal EAI, and the other should be called intra-EAI. Does your book address these two big issues respectively?
I like the way of integration stage by stage. But what I am wondering is, does this book cover embedded application integration?
Matjaz Juric
Author
Ranch Hand

Joined: Aug 02, 2001
Posts: 65
Hi Doug,
Originally posted by Doug Wang:
So there are two important kinds of integration:
One should be called internal EAI, and the other should be called intra-EAI. Does your book address these two big issues respectively?

Yes, it does.
Originally posted by Doug Wang:
I like the way of integration stage by stage. But what I am wondering is, does this book cover embedded application integration?

What exactly do you mean under embedded application integration?
Cheers,
Matjaz
Ruilin Yang
Ranch Hand

Joined: Jan 06, 2002
Posts: 150
Matjaz/Doug
Thanks.
If I use URL/URLConnection, I have to do some code in the server side to read InputSteam and write outStream. I am not sure how I can do it. My legacy system my not allow me to do any coding.
I could use AppletContext.showDocument (URL+data) to get some information, but I have to set the security for applet.
Thanks
If you could elaborate more.
Thanks
Ruilin
Dieter Cailliau
Greenhorn

Joined: Jan 17, 2002
Posts: 11
dear matjaz
thanks for your reply. You're not the first to point me to the meaning of re-entrant. I slowly begin to understand it is certainly not what i hoped that it would be. Though i wonder what it's good for, that a bean is non re-entrant in the first place.
If you're still round, maybe go back to the thread with my question, there's more explanation added. Where i really need an answer is: what happens if one entity bean (with pk "12") is accessed by two clients, and all it's methods are transaction required. Are two threads going toghether over the bean, and is the transaction enforced in the database by the database mechanisms, or is it the j2ee container who denies access to the second thread because it knows the first thread is in transaction?
(the thread + extra info)
Matjaz Juric
Author
Ranch Hand

Joined: Aug 02, 2001
Posts: 65
Rulin,
Originally posted by Rulin Yang:
If I use URL/URLConnection, I have to do some code in the server side to read InputSteam and write outStream. I am not sure how I can do it. My legacy system my not allow me to do any coding.

Please look at the following links, they might help:
http://www.ecs.umass.edu/ece/wireless/people/emmanuel/java/networking/urls/readingWriting.html
http://home.att.net/~baldwin.rick/Advanced/Java556.htm
http://www.javaworld.com/javaworld/jw-03-2001/jw-0323-traps.html
Matjaz Juric
Author
Ranch Hand

Joined: Aug 02, 2001
Posts: 65
Hi Dieter,
Originally posted by Dieter Cailliau:
Where i really need an answer is: what happens if one entity bean (with pk "12") is accessed by two clients, and all it's methods are transaction required. Are two threads going toghether over the bean, and is the transaction enforced in the database by the database mechanisms, or is it the j2ee container who denies access to the second thread because it knows the first thread is in transaction?[/URL]

As far as I know, the following happens if two or more clients access the same entity bean, each in a transaction:
- The first client accesses the entity bean in a transaction; the container delegates the transaction to the database. If optimistic locking is used (which is the case in most servers today) read locks are put on the data. Otherwise read/write locks are used.
- The second client accesses the same entity bean in a transaction. If optimistic locking is used, the second client can access the bean (the data), because it can put read locks on the same data. If pessimistic locking is used, the second client has to wait until the first one release the locks.
- The real interesting thing happens when one of the clients wants to modify the data (write). If optimistic locking is used, the read locks have to be upgraded to read/write locks. Only one client can do such upgrade. (If pessimistic locking is used, no upgrade is necessary).
- In certain situations this can lead to deadlocks, for example if both clients are waiting to upgrade their read locks to read/write locks. This is usually handled by database lock prevention mechanisms. In most databases a timeout can be specified. This timeout would cancel one of the locks, making it possible for the other client to upgrade locks to read/write.
This scenario can get quite complicated and I outlined it only. How much access is granted to simultaneous clients also depends on the transaction isolation level. There are also differences in details between app servers and DBMS.
Hope this will help,
Matjaz
Doug Wang
Ranch Hand

Joined: Oct 05, 2001
Posts: 445
Originally posted by Matjaz Juric:
What exactly do you mean under embedded application integration?
[/QB]

Matjaz,
Sorry for the ambiguity of my question(Iam from non-English country).
I mean how to integrate java-enabled device into enterprise application, something like using j2me and j2ee together.
Does your book cover that? Thanks.
Ruilin Yang
Ranch Hand

Joined: Jan 06, 2002
Posts: 150
Doug,
I think using HTTP protocol is still a good choice for such integration. This is I always trying to do.
Please correct me if I miss anything.
Thanks
Ruilin
Angela Margot
Ranch Hand

Joined: Feb 07, 2002
Posts: 80
Gosh it'd be cool to win this book!


Angela Margot <img src="smile.gif" border="0"> <br />Sr. Software Engineer<br />SCJP2 SCWCD MCSD MCP
JeanLouis Marechaux
Ranch Hand

Joined: Nov 12, 2001
Posts: 906
Matjaz,
I guess your book is full of relevant examples for all the technologies it deals with.
On what "tool" are these examples based.
Are they vendor independant, or did you choose to use WebLogic, Websphere, Oracle 9iAS.... with the specificities it can sometimes imply ?
Ruilin Yang
Ranch Hand

Joined: Jan 06, 2002
Posts: 150
Matjaz,
Thanks for the URL for URLConnection class. With this class I think I can get specific pages of a remote site with URL + data for a purticular page. Do you think I can login to an account. For example, with URLConnection, do you think I can login to my javaranch account ? or ligin to my account of J2EE discussion group in Yahoo ? How to do it ? please give me some API.
I beleive I will not be able to navigate, but only to get specific page each time.
Please correct me and elaborate.
Thanks
Ruilin
Matjaz Juric
Author
Ranch Hand

Joined: Aug 02, 2001
Posts: 65
Hi Bill,
Originally posted by Bill Bailey:
On what "tool" are these examples based.
Are they vendor independant, or did you choose to use WebLogic, Websphere, Oracle 9iAS.... with the specificities it can sometimes imply ?

Most of the examples in the book are prepared for BEA WebLogic 6.1, because by the time of writing the book it was the only EJB 2.0 (and J2EE 1.3) compliant app server (at least I didn't know of any other). However, the examples should also work on any other server, without modifications.
Cheers,
Matjaz
 
GeeCON Prague 2014
 
subject: This weeks Giveaway