|
Sponsored Links
Resources
Enterprise Java Research Library
Get Java white papers, product information, case studies and webcasts
|
News
News
News
|
Messages: 90
Messages: 90
Messages: 90
Printer friendly
Printer friendly
Printer friendly
Post reply
Post reply
Post reply
XML
XML
XML
|
 |
JPetStore: A Pet Store from the Open Source Community
JPetStore is a completely rewritten Pet Store application based on Sun's original J2EE Pet Store. The primary difference is that JPetStore uses a design competetive and comparable to the Microsoft .Net Pet Shop --but without its shortcomings. JPetStore is vendor independent and based completely on open source freeware (Struts and others).
Read the whole story at the iBATIS JPetStore website.
* NO stored procedures
* NO generated code
* NO HTML in the database
* Model-View-Controller based presentation layer
* Based on open source freeware
* Line count differentiated only by coding conventions
What do you think?
|
|
Message #52386
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
Wheres the online demo and performance benchmarks?
|
|
Message #52389
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
I can prepare an online demo, that's no problem.
As for performance benchmarks, as the white paper explains, I was unable to conduct them in a manner consistent with the .Net Pet Shop. Unfortunately I don't have 2 Compaq Proliant servers sitting around the house (1 x Dual Xeon + 1 x Quad Xeon).
I have access to loads of gigantic Sun hardware and a number of smaller x86 boxes, but nothing that is close to what Microsoft used. I also don't have access to the load testing software (expensive).
If you or anyone else can help, I'd be happy to benchmark it and post the results.
Cheers,
Clinton
|
|
Message #52396
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
Unfortunately I can't help there.
Have you tested jpetstore against sun's version? Perhaps use jMeter to test jpetstore and sun's petstore in your current environment?
|
|
Message #52399
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
Written using Struts, no EJB. Interesting.
|
|
Message #52405
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
I also noted the non use of EJB most specifically entity beans. Does it make sense to use DAO for this kind of work. I am hearing more buzz about DAO and just wondering where it fits in.
|
|
Message #52408
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
Hi Jim,
DAO is a wonderful pattern with or without EJBs. The DAO implementation used by JPetStore is little more than an Abstract Factory implementation tweaked for a persistence layer.
The flexibility can be seen in the DaoFactory.properties file where by simply manipulating a single property, data caching can be enabled or disabled. It would be just as easy to plug in a totally different persistence mechanism (e.g. TopLink).
Normally I separate the DAOs for different business objects, but there were so few BOs in JPetStore that it wouldn't make sense to split a couple hundred lines of code into many separate classes.
Cheers,
Clinton
|
|
Message #52412
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
I had a quick look at the src of the app - it looks like a web centric web application.My question is can the j2ee's transaction , scalability bla bala... be guaranteed and kept without using ejbs? I am using Sun Petstore1.3.1 as guideline in my application and could not see much that can be reduced to .Net like petstore without losing the many aspects of j2ee promises.
Faisal
|
|
Message #52413
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
If one moves business logic from Struts' Action classes in to separate Beans then adding SLSB facade can be done easy (when and if necessary).
For persistance I would consider OJB (future apache jakarta project). Performance may suffer a bit but maintainability will be better, plus OJB will provide JDO compliant API in the future.
The author (Clinton Begin) deserves a lot of credit for putting this stuff together and sharing it with the Java community. The source contains a PDF that describes his approach, make sure you take a look as it definitely contains more substance than an 'opinion' published by some 'senior Java architect'.
I'd be interested to see some benchmarks with Linix/Tomcat/PostgreSQL config. I'd expect you can easily scale to 2000 users on more or less decent hardware but it'd be interesting to see specifics. Thanks
-- Igor
|
|
Message #52420
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
This is excellent!
What I would like to see is a performance benchmark comparing JPetStore and PostgreSQL on Linux to the .net PetShop and MSSQL under XP on the same hardware.
|
|
Message #52428
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
<quote>
I had a quick look at the src of the app - it looks like a web centric web application.My question is can the j2ee's transaction , scalability bla bala... be guaranteed and kept without using ejbs? I am using Sun Petstore1.3.1 as guideline in my application and could not see much that can be reduced to .Net like petstore without losing the many aspects of j2ee promises.
Faisal
</quote>
Sun's Petstore is a demonstration of how all possible J2EE technologies can be used in a single application. Using Petstore as a reference to find out how a particular J2EE technology can be used is good ,but as a guideline to design your app is bad.
I would say that you need to evaluate your needs as far as transactions, scalability, failover, load balancing and all the fancy stuff that ejb's supposedly promise.
You can also acheive load balancing with your web server or at a hardware level using routers.
Similarly you don't need ejb's to ensure transactions. Any decent OR tool is fine, and if your database needs are fairly simple (few tables) you can stick to SQL and JDBC.
|
|
Message #52434
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
Great!!!
you can run it by this steps:
1. drop the war file that came with it in webapps of resin2 (free download from caucho.com)
2. change SimpleDataSource.properties, to point it in your db
3. run 2 ddl scripts to your target db.
4. fire your browser, and load the application.
and there you go!
|
|
Message #52464
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
ONLINE DEMO NOW AVAILABLE! Re: JPetStore.....
Great effort!
The response is quite fast for the hardware configuration. I wonder whether .NET version of PetStore can run on the same hardware.
Cheers
K. Sivakumar
|
|
Message #52466
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
ONLINE DEMO NOW AVAILABLE! Re: JPetStore.....
Hm. Interesting. We've (my company) decided to develop two web applications using only java web technology and a good persistency layer and thus skipping all the EJB stuff. Our reason was that JSP offers good scalability and the persistency layer takes care of distributed caching problems and as a result I do not have to worry about the EJB hassle: just a nice MVC logic on top of a clean BM based on a good persistency layer.
Now, this works great, but I always was asking myself "shouldn't we have used EJB"? This kinda confirms that our decision wasn't that bad.
As I said: interesting.
Tom
|
|
Message #52481
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
<snip>
As for performance benchmarks, as the white paper explains, I was unable to conduct them in a manner consistent with the .Net Pet Shop. Unfortunately I don't have 2 Compaq Proliant servers sitting around the house (1 x Dual Xeon + 1 x Quad Xeon).
</snip>
Would it be possible to run the .NET petshop on your hardware configuration, instead of running your petshop on Microsofts hardware configuration?
--
jonmartin.solaas@mail.link.no
|
|
Message #52493
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
I have just checked out the site and given the ridiculously low hardware being used, I must say that this stuff is too cool.
I really wonder where that 'senior java architect' (one silly Jonathan Gibbons) who has ordered us to move to .NET will make of all this.
Well done Clinton !
|
|
Message #52504
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
Give the guy a break, he said no such thing. He said future projects will be more likely to use .NET because of marketing and business factors. You lot jumped down his throat and assumed he was talking technical merit.
|
|
Message #52515
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
Getting some errors when trying to sign in or clicking on the cart icon...
|
|
Message #52527
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
And as Murphy would have it, on the first day of deployment..... :-)
I've posted a complete description and a workaround for the bug. It was totally an error on the part of the programmer (who Me?). :-)
Thanks Dat.
Cheers,
Clinton
|
|
Message #52548
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
ONLINE DEMO NOW AVAILABLE! Re: JPetStore.....
Very Impressive response for the kind of hardware used.
|
|
Message #52554
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
A couple of proprietary JAR files such as IBATIS.JAR without source code make it difficult to learn from this implementation of PetStore. Why not provide us with all the source code and treat it like a true open source solution.
|
|
Message #52557
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
I'd bet the jars you refer to are the common iBATIS jars listed in binary and source form on his site. Therefore, yes, it is a truely open source solution.
An another note, I too am interested in its performance. I wonder how the use of a project like OSCache would compare to cached versions of the .NET and J2EE petstore. Using OSCache in my current project has done wonders.
Don
|
|
Message #52558
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
I think its there.. check out the menu on the left,
under 'Common' you can download the jar, with source.
TK.
|
|
Message #52560
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
Hi Ted,
You can find all the source for the iBATIS common libraries at the following link. Sorry it was hard to find. Rest assured, you have access to all of the source code.
http://www.ibatis.com/common/common.html
Cheers, :-)
Clinton
|
|
Message #52563
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
That was fast ...impressive! All the credit man!. Sun 's Perstore team should see this and learn how to make things more practical with less complexity though their Petstore id more like a tutorial and how to .
|
|
Message #52566
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
Great contribution for Java and .NET community!
Sounds like many people were wondering about No EJB arcitechture. I agree with R V, here is one of the reference about EJB decision making facotors.
http://www.theserverside.com/resources/articles/Is-EJB-Appropriate/article.html
Anyway, the intention of the app is the comparison between J2EE and .NET, and it's in JPetStore whitepaper's Conclusion section.
thanks again, Clinton!
Tak
|
|
Message #52590
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
What´s OSCache? It´s a persistence layer? Is it comparable to Oracle´s BC4J?
|
|
Message #52593
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
Hi all,
The bug discovered this morning has been fixed.
Cheers,
Clinton
|
|
Message #52594
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
OSCache, found at http://www.opensymphony.com/oscache/, is, as I use it, an output caching system. It is probably most similiar to JCACHE and JCS (http://jakarta.apache.org/turbine/jcs/) in that they are allow for disk and memory caching, however, OSCache is the only cache I have found for output caching - whole and partial pages pages.
For example, if you have a section of your page like a nav bar generated dynamically, you add <cache:cache key="navbar" /> around it and the output generated by all the content in that tag will be cached. It allows you, like ASP.NET does, the ability to cache portions of your pages that change infrequently. In addition to portions, you can use its servlet filter to cache whole pages, very useful if you have dynamically generated binary content like pictures and graphs.
Don
|
|
Message #52638
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
Hi,
I think someone above asked me to make a comment, so here goes. This is long, and if you didn’t like my paper then don’t bother reading it.
The petshop is a small project. Both Java and .Net examples have been produced and compared using number of code lines and speed of operation. The current trend in software is to use application servers, code generators and standard libraries for much of a project's work. Comparisons of lines of code are pretty dubious, which is why the Java community laughed at Microsoft’s marketing attempt. This rewrite is very useful as it proves how irrelevant Microsoft’s claims are. A different thread has already mentioned at great length the ridiculous nature of Microsoft’s performance claims, and the irrelevance within the comparison.
I think what is great is that we have a well written Java web site. The author rightly discarded much of the J2EE spec and ‘made up’ his own solution. I mean this as a complement, replace ‘made up’ with ‘carefully designed’, he selected a solution and wrote the bits that needed writing, and used open source for the rest. This is hopefully how every software project does things. I.e. appropriate tech, with reuse where possible and useful.
I also note people are amazed by the performance of the live site used as the demo system. I had a 5 hour Java batch process running on wintel late last year. Upgrading the PC reduced this to about 42 minutes duration – and that was with about 5 meg of data being emailed and FTP’ed, i.e. there was an I/O component. I think this shows that PC platforms are able to handle many server type functions already, and that over the next few years the increase in performance will astound us all – i.e. what it actually means for our software performance.
How to measure .NET V’s Java usefully? Some folks use lines of code but code generators mess up that metric, as do third party libraries and even in-house libraries. Some use speed on the same hardware. But that is a ridiculous comparison as new hardware costs far less than highly skilled development teams. So speed is not the measure.
Maybe we should use scalability? What happens if you take the same system and ramp it up to 10000 concurrent users? Again, a silly comparison. Create a web farm, and use load-balancing hardware to preserve sessions to the same servers, if you want session fail-over then persist or duplicate session data. Again, hardware is relatively cheap. What about maintenance? Maintaining a large web farm is costly compared to a large server. True, but upgrading a large server is costly compared to upgrading a web farm. You can argue both ways.
Back to scalability, we still have a bottleneck in the database box. Microsoft says use SQLServer, and we all say use Oracle if you have the money. Let’s face it, any big corporation will select Oracle over SQLServer if they have the skills and the budget. Does this effect the choice of .Net V’s Java, not at all? Does it effect the choice of .Net V’s Unix? Not at all. We are already at the web farm stage, separating the web servers from the db server, so its network based anyway. BUT, with EJB I hear you cry, we have in memory caching. Frankly I don’t care. Database caching has 20 years of evolution behind it, and I have still to hear how EJB works with a system having collaborating data center’s distributed in Hong Kong and London and New York – i.e. running the same system with database level replication. So scalability is a tricky one to measure as well. There are solutions in both .Net and Java, but basically we leave it to the database.
[Aside: why haven’t I mentioned MySQL – it scales, it’s free, it has transactions and is proven. Because big finance corporations do not use it.]
Cost! Who can argue with cost? I certainly can’t – well actually I can. Linux is near enough free, as are Jboss and the JDK’s and JVM and IDE’s. .Net costs you 18K per CPU per SQLServer (ish), 2K for the OS, and 1K each for dev licenses of visual studio (well 600 to 1500). But for scalability we have already said we are using Oracle on a Unix server! Crickey, that is expensive. So say this costs 100K, with another 60K for failover – h/w and s/w(I’m guessing as its about 3 years since I was involved in Oracle licenses on Solaris platforms). So the project base cost is 160K, with another 20K for web farm hardware (PC based), and then there is network bandwidth (say 20K), and we probably want to host it (can’t remember costs for that). Do we still care about how much the .Net dev licenses cost? Do we still care how much Microsoft operating systems cost?
OK, cost is not an issue if we are worrying about scalability and can buy Oracle. If you can’t afford Oracle then I agree linux/mysql/postgres etc are a winner – but they couldn’t afford to employ many techies if they can’t afford Oracle. So lets drop scalability and move to smaller projects. Say the petstore.
I have impoverished clients, who want a simple web server. Linux, Tomcat, MySQL – good. Or for cheaper staff, Linux, perl/php, MySQL. Yikes I’ve just scrubbed Java. Let’s say my staff know Java. OK, we have a clear case where JAVA HAS WON!
Now let’s say I want to have clients who can pay me a living wage. Say that’s 50k per consultant per year. Say the project takes 3 staff at this level, so the client is paying 150K just on staff for a 3 man year project (and these are very cheap techies). How important is the 34K setup for Microsoft server (including hardware)? Depends on the client. It does not depend on the technology.
So to summarize: Good job, let’s hope that Microsoft shuts up about the bleedin pet store. Does it prove Java is better? No, it proves Java is just as appropriate, especially if you ditch EJB and don’t worry about application servers.
I have not touched on vendor lockin, because I agree 100% that it is the biggest worry for any project. But I look at Microsoft Office and I don’t see users really worrying very much. And every techie I work with wishes that Netscape would simply die off so that they can code for IE and not worry about being cross platform. It’s a strange old world.
Jonathan
|
|
Message #52678
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
Hi Clinton,
With regards to your iBATIS Common Library,
is there any developer guide, example (other than JPetStore), doc, etc? To help kick start with your library.
Gabriel
PS: Cool work & well done!!
|
|
Message #52679
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
You have done a great job by simplifying the J2ee petstore example.
I was trying to run the jpetstore.war using Tomcat 4.0.1 along with Oracle 8.1.5.
- I loaded the war file in webapps folder of tomcat.
- Modified the SimpleDataSource.properties file to point
to Oracle
#Oracle
JDBC.Driver=oracle.jdbc.driver.OracleDriver
JDBC.ConnectionURL=jdbc:oracle:thin:@localhost:1521:ORCL
JDBC.Username=new
JDBC.Password=new
- created the tables and loaded data successfully by running the scripts available for Oracle
When I run the application in the browser I get the following error
Apache Tomcat/4.0.1 - HTTP Status 500 - No action instance for path /shop/index could be created
--------------------------------------------------------------------------------
type Status report
message No action instance for path /shop/index could be created
description The server encountered an internal error (No action instance for path /shop/index could be created) that prevented it from fulfilling this request.
--------------------------------------------------------------------------------
Did I miss out on something? Please help
|
|
Message #52684
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
could be oracle driver issue.
Try putting your classes12.zip into CATALINA_HOME/common/lib/
It's work for me :-)
|
|
Message #52685
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
Hi Gabriel,
Since I am using Oracle as backend in my present web application I have already loaded classes12.jar in the CATALINA_HOME\commom\lib folder of tomcat. I have been able to connect to oracle otherwise.
Anything else that I might try out.
thanks
Panchalee
|
|
Message #52687
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
Well a second thought !
Have you made some additions in the server.xml in CATALINA_HOME\conf for context path or jdbc resources?
Which version of tomcat are you using?
|
|
Message #52688
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
Hmm.. funny?
Try email me your printStackTrace and do an offline discussion, before we bored "The J2EE Community" with this issue.
gabrielchua@yahoo.com
|
|
Message #52710
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
I have to say Clinton has done a great job for the Struts community. I have done quite a number of Struts projects but his design has made Struts programming so clean and simple. I experimented his library on a different project and it worked just beautiful. For the Oracle driver, I put it in WEB-INF\lib but failed to load until I renamed the file extension from .zip to .jar. For the action instance problem, it's an action pathing issue in my case. It worked fine after I made the necessary correction.
|
|
Message #52717
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
I've looked at it. good job. I've been hoping for someone to write an "appropriate" Pet Store ever since the .NET PetShop came out -- one that uses the appropriate levels of abstraction instead of the monstrously over-engineered J2EE PetStore.
Contrary to popular belief, my opinion is that lines-of-code ARE a very important measure when dealing with implementation techniques. The less lines of code, it shows a mixture of thought on the programmer and expressive power in the language & libraries. Since the PetStore *is* so simple, it really doesn't make much sense for the J2EE solution to have so many more lines of code when we know the Java class libraries are pretty much on par to the .NET class libraries, and how C#/Java are also pretty much on par.
|
|
Message #52724
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
Jonathan,
Awesome.. Wow.. Perfect blend of practicality( price,development effort ) & theory ( technology etc )
I enjoyed it..I feel the same.
BTW
>>Does it prove Java is better? No, it proves Java is just as appropriate, especially if you ditch EJB and don’t worry about application servers.
I really can't agree with this.
Yes EJB is not for every application. But that doesn't mean that we should ditch that..
Except this rest all were.. good Keep it up.
~Murali Varadarajan
|
|
Message #52760
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
Gabriel:
Unfortunately I never expected to release the Common library outside of my own little community (in which the developers are already familiar with it). So I suppose I've been a little slow in writing docs for it. Luckily, all of these very flattering comments are driving me to write up better documentation for both JPetStore and the iBATIS common library.
I'd really like to get some performance benchmarks though, so I'm kind of torn!
Thanks for the encouragement!
PS: For the Oracle driver issue....the way I've solved it (since Tomcat 3.x) was to do as Clifford Cheng said --rename the classesXX.zip to classesXX.jar (in WEB-INF/lib).
Cheers!
Clinton
|
|
Message #52767
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
Hi Clinton, Gabriel, Clifford
I could successfully run the jpetstore using tomcat 3.2.1 but failed to run it using Tomcat 4.0.1.
I tried using a fresh installation of Tomcat 4.0.1 with JDK1.3.1_02 on Windows NT and only the jpetstore application war
path set to %JAVA_HOME%\bin;%CATALINA_HOME%\bin
classes12.jar (not classes.zip) in the Web-inf\lib
SimpleDataSource.properties set to point to Oracle
I get the following action/instance error:
Apache Tomcat/4.0.1 - HTTP Status 500 - No action instance for path /shop/index could be created
--------------------------------------------------------------------------------
type Status report
message No action instance for path /shop/index could be created
description The server encountered an internal error (No action instance for path /shop/index could be created) that prevented it from fulfilling this request.
--------------------------------------------------------------------------------
PrintStackTrace looked like
2002-07-05 17:04:41 action: Error creating Action
> instance for path '/shop/index', class name
>
'com.ibatis.jpetstore.presentation.action.IndexAction'
> java.lang.NoClassDefFoundError
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:120)
> at
>
org.apache.struts.action.ActionServlet.processActionCreate(ActionServlet.java:1631)
> at
>
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1577)
> at
>
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:492)
> at
>
javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
> at
>
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
> at
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
> at
>
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
> at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
> at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> at
>
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> at
>
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201)
> at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
> at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> at
>
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> at
>
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
> at
>
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
> at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
> at
>
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
> at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
> at
>
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
> at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
> at
>
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
> at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
> at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> at
>
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> at
>
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
> at
>
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
> at
>
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> at
>
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> at
>
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1011)
> at
>
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106)
> at java.lang.Thread.run(Thread.java:484)
I have been using tomcat 4.0.1 for a struts based application I am developing using Oracle as backend. It works fine. Gabriel has been trying to help me with it.
Well Clifford you said its a pathing issue - what did you exactly do to solve it. Do I need to set the classpath variable to point to struts.jar? Please assist me to solve this.
Thanks and regards
Panchalee
|
|
Message #52779
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
Hi guys,
I could run the jpetstore.war in tomcat 3.x and tomcat 4.0.4 but it fails to run in tomcat 4.0.1
Really don't know why? Has anyone tried with tomcat 4.0.1?
regards
Panchalee
|
|
Message #52784
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
Panchalee,
Sorry for being unclear. I didn't actually try the jPetstore myself. Clinton's codes are so clean and well-structured that I simply browsed through them and understood how they work (without EJB it's a typical Struts application). Instead, I tried his library on another project and got that 'No action instance ... could be created' message which later on found out to be a pathing issue (I said in my case). However, when I worked further I realized that every time I got the map sql xml files wrong the same message came back. I haven't got a chance to step through Clinton's library source codes but believe that is something to do with loading the xml's through the DAOMgr in the action objects (again in my case). I would suggest to bring Clinton's library source codes into an IDE and try to step through them. By the way, I used Tomcat 4.0.3 and Oracle 8.1.7.
Clifford
|
|
Message #52785
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
Hi all,
Under some app/web servers there may be issues resolving relative paths that are based on a classpath resource. Such a case in JPetStore exists with the SQL Maps. I know that this doesn't work on some web servers, such as iPlanet Web Server (Sun One Web Server) and also WebLogic can have problems if you don't expand the WAR file (I'm not sure about Tomcat 4.0.1).
There is a workaround that you can try: Simply modify the PetStoreMapDao.properties (WEB-INF/classes/properties/) file to use an absolute path rather than a relative one (there is an example in the properties file that is commented out).
In the case of JPetStore, SQL Maps are the only thing that require a file path.
Panchalee: You might be getting a NoClassDefFound exception because the SqlMap and the PetStoreMapDao are static class members that are instantiated during the class loading. If any exception is thrown, the class can't be loaded, hence the exception. In any case, I suppose there is some room for improvement in my handling of fatal errors... :-)
Cheers,
--
Clinton Begin
|
|
Message #52802
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
Clinton,
I've been trying to append an 'order by' parameter to a select statement in a SQL Map for resorting html tables. Is there a SQL Map attribute for this purpose? In the affirmative, could you give some hints or perhaps a few lines of sample code?
Thanks.
Clifford
|
|
Message #52810
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
Hi Clifford,
A static order by is easy, you can just set it in the mapped statement SQL in the SQL Map XML file. I assume you're looking for a dynamic order by clause though. Unfortunately at this time there is no easy/clean way to do that. However, that would be a next step for the SQL Map API is dynamic query generation (including order by).
The only workaround I can think of for now is to have a separate mapped statement for each order by. You could reuse the parameter and result maps. This could get really ugly if you have many order by possibilities or if you have multiple order bys. If you only have a few though, it may not be an unreasonable temporary solution.
I know this is far from elegant. There are a number of possibilities for improvement. I'll just have to decide which is the easiest/cleanest way. Suggestions welcome...
An example XML map would look like:
<result-map name="result" class="com.ibatis.jpetstore.domain.Category">
<property name="categoryId" column="CATID" />
<property name="name" column="NAME" />
<property name="image" column="IMAGE" />
<property name="description" column="DESCN" />
</result-map>
<mapped-statement name="getCategoryList" result-map="result">
select * from CATEGORY
</mapped-statement>
<mapped-statement name="getCategoryListOrderByName" result-map="result">
select * from CATEGORY order by NAME
</mapped-statement>
<mapped-statement name="getCategoryListOrderById" result-map="result">
select * from CATEGORY order by CATID
</mapped-statement>
|
|
Message #52815
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
I tried to use MySQL as a backend, and added the following lines into the file of SimpleDataSource.properties ==>
#MySQL
JDBC.Driver=org.gjt.mm.mysql.Driver
JDBC.ConnectionURL=jdbc:mysql://localhost/petstore
JDBC.Username=wang
JDBC.Password=test
While I try to enter the petstore, and meet:
javax.servlet.ServletException: Servlet execution threw an exception
...
root cause
java.lang.ExceptionInInitializerError
at com.ibatis.common.dao.jdbc.JdbcDaoTransactionPool.getTransaction(JdbcDaoTransactionPool.java:40)
Caused by: java.lang.RuntimeException: SimpleDataSource: Error while loading properties. Cause: org.gjt.mm.mysql.Driver
at com.ibatis.common.jdbc.SimpleDataSource.initialize(SimpleDataSource.java:135)
at com.ibatis.common.jdbc.SimpleDataSource.(SimpleDataSource.java:91)
at com.ibatis.common.jdbc.DbConnectionPool.(DbConnectionPool.java:21)
at com.ibatis.common.jdbc.DbConnectionPool.(DbConnectionPool.java:17)
... 39 more
I am sure the classpath to mySQL JDBC driver is correct. Any help?
Thanks,
James X Wang
|
|
Message #52819
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
As far as I know MySQL does not support Transactions.
|
|
Message #52823
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
Hi Clifford,
First of all, excellent work!
I tried running the application in Win2k, Tomcat 4.0.3, Postgre 7.2.1. The application works but right at the startup I get the following message:
Starting service Tomcat-Standalone
Apache Tomcat/4.0.3
PARSE error at line 1 column 1
org.xml.sax.SAXParseException: The markup in the document preceding the root ele
ment must be well-formed.
Starting service Tomcat-Apache
Apache Tomcat/4.0.3
What could be causing the Parsing Error?
Thanks! :)
|
|
Message #52824
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
Hi Clinton,
Forget this problem. It was related to Tomcat 4.0.3.
I upgrade to Tomcat 4.0.4 and it's smooth as silk!
Thanks for sharing your code to the community.
More power to you!!! :)
|
|
Message #52830
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
James:
I got this error message when the class file of my JDBC driver wasn't available to my web server (tomcat). I solved the problem by dropping the appropriate jar files in tomcat's lib directory. Maybe the same will also solve your problem.
Good luck!
Jonathan Rich
|
|
Message #52832
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
James:
In addition, did you "unjar" the MM.MySQL JDBC driver? It won't work in the JAR format. Also, once unjarred, where did you put the class files?
There's really only one line of code that could cause the exception that is being reported (from SimpleDataSource):
Class.forName (jdbcDriver).newInstance();
Generally the exception you reported would occur when the driver cannot be found (NoClassDefFoundException). Sorry for the vague error message that was reported. I used a Exception.getMessage() instead of Exception.ToString() like I usually do for the "Cause:". I can't wait to start making use of JDK 1.4 exception chaining! :-)
Cheers,
Clinton
|
|
Message #52849
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
Bob Farmer: MySQL does now support transactions via InnoDB, but there referential integrity aint there yet (last time I looked, blink and stuff changes).
Clinton: for result specs and searches etc take a glance at the jasper reports stuff, long time since I looked, but they had some specs.
Jonathan
|
|
Message #52874
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
Clinton,
Yes, I meant dynamic reordering. Thanks for your efforts anyway.
Clifford
|
|
Message #52883
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
James,
Jonathan was right about InnoDB. However, if you want other features such as unicode support, stored procedures, triggers and views, they are not available with MySQL at least prior to 4.0.1 according to my knowledge. If you want a no cost but full-featured database, why not take a look into Postgresql?
Clifford
|
|
Message #52933
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
Clinton,
First of all, thanks for the great work!
I put the JPetStore to work on W2K with SQL Server 2000 and Tomcat 4.0.4 (because that's what I already had). I adapted the PostgreSQL scripts, and used the JDBC driver for SQL Server that comes with JRun 4, from Macromedia. It should also work with the free JDBC driver from MS. Everything worked well.
By looking at the code, I noticed that you didn't use the standard authentication and authorization services, as described in the Servlet 2.3 spec, and available in Tomcat 4.
Coincidentally, the most elaborate part of JPetStore is the management of user signon/signoff, with the orchestration of different Struts actions, otherwise unrelated, in order to redirect the user to the sigon form, and then back to the "new order" form.
I believe such logic could be entirelly carried out by the web container, provided it implements the security framework specified by Servlet 2.3 spec. I realize that such support is NOT required for Servlet 2.3 web containers, only recommended. But since it IS required for web containers taking part in a J2EE 1.3 environment, I think it can be safely used.
What do you think?
|
|
Message #52938
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
Hi Rogerio,
That is a fantastic observation! I hope I can effectively explain my reasoning.
First and foremost is that the J2EE security services are container managed, which is inherently not portable. For example, how would a JPetStore facilitate the creation of new users in a portable way?
Second, the JPetStore user/password is not really a security requirement as much as it is a account/profile management requirement. Therefore I place it more in my business domain than in my security domain. A small part which is related to security is ensuring that a user cannot see or use another users account/cart etc. Luckily thanks to session management provided by the Servlet API, this is pretty much free (session spoofing and plain-text passwords can be protected by using a secure protocol e.g. https/ssl).
Does that make sense? Thoughts welcome...
Cheers, :-)
Clinton
|
|
Message #52976
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
Hi All,
Thanks for your kind suggestion. I will run PostgreSQL instead of mySQL.
James
|
|
Message #53038
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
How can you include the phrase "superior design" and "no stored procedures" in the same argument?!
Stored Procedures should be a major component in achieving maximum performance, whether on MS SQL Server or Oracle. Compiled query language such as PL/SQL or T-SQL will ALWAYS yield the highest performance and security... period!
|
|
Message #53040
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
Hi Clinton,
Tomcat has a configurable "JDBCRealm" (in server.xml), which is used to look up user ids and roles in a database. You specify the table and column names for a users table ("Signon" in JPetStore) and a roles table.
This is, of course, not portable, but it allows the use of existing database tables, is easy to configure, and similar mechanisms should exist in other app servers or web containers. Also, in J2EE 1.3, the JAAS API allows for the plugability of custom login modules. (Unfortunately, Tomcat 4 still doesn't have a "JAASRealm".)
Apart from the above, which is really only a deployment issue, I don't see any portability problems (am I missing something here?).
As for your second point, I also thought it wasn't a security requirement at first! But then I realized that it actually is, although in an unusual way for this type of web application. Basically, you would have to add a "UserRoles" table to the JPetStore database, define a "customer" role , and put somes JSPs (NewOrderForm.jsp, etc.) under a security constraint (in web.xml); for the Signon page, it would be necessary to create an empty, but protected, JSP, that just forwards to index.jsp; in code, use the "request.getRemoteUser()" method to obtain the user name. Well, you get the picture :-)
Cheers,
Rogerio
|
|
Message #53046
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
<quote>
How can you include the phrase "superior design" and "no stored procedures" in the same argument
</quote>
Hope you were being sarcastic with your comment.You seem to be mixing up design with performance. While good performance is a desired goal of any design it's not the only one. You also have ease of development, scalability , robustness and maintainability.
If performance were the only measure we would still be coding in C.
|
|
Message #53047
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
Terry:
If performance was the only measure of success in software development, JPetStore would have been written to that effect. Unfortunately it is not.
To demonstrate why the JPetStore design is superior, I would like to call your attention to this fact:
If I wanted to use stored procedures in JPetStore I would have to write a single Java class to do so (e.g. PetStoreStoredProcDao). The class would be about 300 lines of code (being generous) and to plug it in, I would modify a single line in one properties file (DaoFactory.properties). Most importantly, understand this: I would *NOT* have to change a single line of code elsewhere in the application because JPetStore is layered properly.
THAT is superior design!
The same cannot be said of Microsoft's .Net Pet Shop, in which you would be required to heavily refactor at least 7 classes (scouring over 1300 lines of code), which are all mixed up with business objects and hard-coded persistence code. Sounds like a nightmare, no? Imagine the MS design in a real enterprise app.
Now, should we talk about the HTML in the database now or later? ;-)
Best regards,
Clinton
|
|
Message #53049
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
Terry:
As for security (I forgot to address that), I don't think this is the best place to discuss Microsoft and their security history. However, I did find this link funny:
http://www.theregister.co.uk/content/4/26086.html
Point being: stored procs have nothing to do with security.
Cheers,
Clinton
|
|
Message #53233
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
No problem with PostgreSQL, while I use mySQL as a backend DB, here is the wrong message:
==================
Error!
Unhandled Exception: com.ibatis.common.dao.DaoException: Column 'DESCN' not found.
===========
Actually, the column "desc" exsits in the table of Category or Product. Any suggestion?
Thanks,
James
|
|
Message #53279
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
Thanks.
Your persistent framework is simple and elegant. I'll use it my java development.
BTW I'm looking into MS "Object spaces" persistent framework. Seems like your mechanism has much in common with that.
|
|
Message #53301
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
Hi,
I'm new to J2ee arena, could you kindly provide the steps to assembling and deploying the JPetstore to run on an J2ee application server (for example: Bea, Sun, JBoss...) and using the Oracle db. I have the App Server & the Db setup.
Thanks in Advance,
J2ee rookie
dc_truong@yahoo.com
|
|
Message #53362
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
Hi David,
Here are some simple deployment instructions....
DATABASE: If you are using PostgreSQL, Oracle or PointBase, simply run the provided DDL and data load SQL against the database.
BEA WEBLOGIC 6.1sp3 or 7.0
1) Unzip jpetstore.war into <weblogic>/config/<mydomain>/applications/jpetstore/
2) Configure your database in <jpetstore>/WEB-INF/classes/properties/SimpleDataSource.properties
3) In WL Console (tree) navigate to <mydomain> | Web Applications | Deployments | Web Applications (click)
4) Choose "Configure a New Web Application"
5) Enter full path to the web application (where jpetstore.war was unzipped as above)
6) Click Apply
7) Select your deployment target(s) and apply
TOMCAT 4.04
1) Unzip jpetstore.war into <tomcat>/webapps/jpetstore/
2) Configure your database in <jpetstore>/WEB-INF/classes/properties/SimpleDataSource.properties
3) Start Tomcat
Let me know if you have any questions.
Cheers,
Clinton
|
|
Message #53363
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
Xijun:
I have verified that JPetStore 1.0.1 (current version) only references the "DESCN" column, it never refers to "DESC". Could it be a typo during the MySQL DDL port?
Cheers,
Clinton
|
|
Message #53647
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Possibly a mismatch between the Common bin and src dists?
Hi Clinton,
I tried your application on Tomcat 4.0.4 and it works like a charm ... great work!
I have one problem though ... I downloaded the source to your common lib and it seems that it includes a wrong version of Logger (and ProcessQueueThread) - it compiles but I get an unhandled Nullpointer error in method run() each time it tries to log something :(
On the other hand, if I replace the Logger class with the one from the binary distribution everything works fine.
I'd really like to see the correct version as this package makes for a great tutorial :)
gg,
Marino
|
|
Message #53679
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Possibly a mismatch between the Common bin and src dists?
Hi Marino,
I'll be putting up a new version of the common lib sometime in the next week or two. The new version will include an ANT build.xml so that you can easily recompile if you need to. I'll also ensure that I put the right version of the Logger in that distribution.
Thanks for letting me know.
Note: For anyone using SQL Maps, the new version will support inline parameter maps and dynamic SQL properties for use with dynamic "order by" clauses or anything else that needs to be dynamic in your mapped statements (group by, select columns etc.)
Cheers,
Clinton
|
|
Message #53689
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Possibly a mismatch between the Common bin and src dists?
I'm still LMAO about this:
"System Configuration
Hardware: Pentium 233, 64MB RAM, 2 x 3 GB IDE (but it's energy efficient!)
Software: Mandrake Linux 7.1, Apache Tomcat 4.0.4, PostgreSQL 7.2, JDK 1.3.1
Total Cost: about $150 Canadian for the hardware.....so about $13.50 USD. ;-)"
Could you provide some ECPerf bbop/$ figures for us? ;-)
Peace,
Cameron Purdy
Tangosol, Inc.
|
|
Message #53797
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Possibly a mismatch between the Common bin and src dists?
Hi Cameron,
I don't think I'll do that, only because it wouldn't prove anything about JPetShop. It would be more of an exercise in benchmarking Tomcat, JBoss and Linux on a ridiculously minimal hardware configuration. That said, I'd be interested in it too! But I think it would be best tested by the teams that run those projects. Try contacting the Tomcat or JBoss teams.
PS: I can give you the dollar figure though -- $0. So all other things being equal, the platform would effectively be infinitely valuable. The only way someone could beat that performance/price would be to pay YOU to run their app server software. (And some of them should!) ;-)
Cheers,
Clinton
|
|
Message #54118
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Possibly a mismatch between the Common bin and src dists?
NOTE: It appears as though some messages have disappeared from this thread!!! This is a response to Arun, who posted a question/comment about using a single DAO vs using multiple DAOs.
-----------------------------------------------------
Hi Arun,
Thanks for your very kind support! :-)
You are correct, and I have always done exactly what you are suggesting in "real" projects. If you have a look at the DaoFactory.properties file, you'll notice that it is set up to allow for multiple DAO implementations. In the case of JPetStore though, it simply did not make sense to break up less than 300 lines of code into 7 (or so) classes (this would be a simple refactoring if needed later).
Generally what I do is (like you suggest) create a "BaseXXXXDao" (e.g. BaseMapDao) which other DAO implementations can extend. Most of the time it works very well to have a separate DAO class for each business object. And sometimes it makes sense to have multiple DAOs for a BO (e.g. separate reads and writes) or to have a single DAO for multiple BOs (where it simplifies the implementation, like in JPetStore).
Originally I did start with multiple DAOs in JPetStore. I had a BaseMapDao class, from which more specific implementations were extended. For example: AccountMapDao, CategoryMapDao, ItemMapDao, OrderMapDao etc. I refactored them into a single class because it seemed to simplify the code at the time.
Excellent observation Arun! Thanks for raising it. I'm thinking of releasing an updated version of JPetStore that will address suggestions like yours.
Cheers,
Clinton
|
|
Message #54144
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Possibly a mismatch between the Common bin and src dists?
Hi Clinton,
I am looking forward to the new Common Library.
Thanks for sharing your work to the community ;)
More Power to IBATIS!!!
Allan
|
|
Message #54167
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Possibly a mismatch between the Common bin and src dists?
Clinton,
Look forward to the new version. By the way, is there a way to define multiple datasources in the properties files (e.g. SimpleDataSource.properties) for connecting to e.g. different schemas on Oracle from the same application?
Thanks
Clifford
|
|
Message #54201
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
Possibly a mismatch between the Common bin and src dists?
Clifford:
No there is not. However, you can instantiate as many SimpleDataSources as you like and pass a Map (properties) to the constructor with whatever configuration you need.
Cheers,
Clinton
|
|
Message #55867
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
o-r mapping api
Hi Clinton ,
We are planning a small new project , I thought of using some kind of o-r mapping .
Actually I liked your approach to o-r mapping.
What other open source tools/api you feel are the best in o-r mapping space.
How do you rate them and why.
Thanks.
Arun
|
|
Message #55989
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
o-r mapping api
Arun, please email me directly and I'll try to answer your question as best I can. I fear my answer may be much too long to crowd this thread with.
Cheers,
Clinton
|
|
Message #56015
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
o-r mapping api
Hi Clinton,
Can you please copy me on your reply on this thread?
My e-mail address is: allanyao@optonline.net
Thanks!
Allan
|
|
Message #58179
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
Clinton has done quite a great job on his conversion from Sun's version. This is a great example of when not to use EJB's if desired, and show very good performance in regards to that decision.
It is also a great example on using other open source tools to help instruct those new to these technologies just how to create a web application with fluidity and function.
Well Done !
Peter
|
|
Message #63907
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
I really pleased that there is starting to be some common sense in the J2EE community. I developed something very similar a year or so back but it was rejected by a Sun consultant as it wasn't the J2EE way. The whole EJB thing has been a debacle. The evolution of programming languages should be to make it easier to develop & maintain business logic. EJB seems to go the other way. I have been developing in J2EE for over a year and feel that C programming & debugging was easier than J2EE - there must be some experienced programmers who agree with me out there?
Look at the thread on on J2EE complexity holding J2EE back http://www2.theserverside.com/discussion/thread.jsp?thread_id=15228.
|
|
Message #64266
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
Hi Clinton
Great job!
I have a question about your DB O-R mapping layer. Is it compatible with jdk 1.4? I was trying to compile the source for that with jdk 1.4 code and got some compilation errors.
Thanks in advance!
|
|
Message #65416
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
Hi sjt,
Yes, that is a limitation right now, but very easy to resolve. The only class that has trouble is the SimpleDataSource. JDBC 3.0 introduced some new methods that SDS doesn't implement. However, I could do this quite easily.
As interest in JDK 1.4 grows, I'll start maintaining 2 versions at a time --the current release (1.4) and one down (1.3).
If you send me an email, I'll send you a special JDK 1.4 version.
Cheers,
Clinton
|
|
Message #65603
Post reply
Post reply
Post reply
Go to top
Go to top
Go to top
|
 |
JPetStore: A Pet Store from the Open Source Community
NOTE TO ALL: Please do not post questions here any more. I will not be monitoring this thread after today. From now on, please send me email directly.
You can find my contact information at http://www.ibatis.com
|
|
 |
New content on TheServerSide.comNew content on TheServerSide.comNew content on TheServerSide.com |
 |
 |
Reza Rahman explores the features of the proposed JSR 299, Contexts and Dependency Injection for Java EE (CDI). When approved, it promises to be a key feature of Java EE 6.
(November 2, Article)
SAML is an XML-based standard for exchanging authentication and authorization data between security domains. The single most important problem that SAML was created to solve is the Web browser Single Sign-On problem. Many organizations are debating whether to stay with version 1.1 or move to 2.0. This article makes observations about both options.
(September 28, Article)
Joe Ottinger takes a look at how people learn, and applies it to the practice of programming. He notes that understanding how people learn is an essential part of working in a programming team.
(September 22, Article)
Stephen Maryka gave us an article about the Asynchronous Web and posed a number of questions that get examined like an approach to delivering Asynchronous Web capabilities through extensions to existing Java EE technologies.
(July 14, Article)
JavaServer Faces Flex goal is to provide users capability in creating standard Flex components, part of flexSDK which is open sourced through MPL license, as normal JSF components. This article by Ji Hoon Kim will provide an overview of creating a simple multilingual JSF page consisting of JSF Flex tags.
(June 29, Article)
In this session Jeff explores the key characteristics of successful SOA projects. He covers some of the patterns, and anti-patterns, tool sets, and strategies that he himself learned the hard way. Last, he provides a strategy and blueprint for achieving a high likelihood of success in your SOA project.
(June 23, Tech Talk)
Ari Zilka, CTO of Terracotta, Inc., talks about the new features in Terracotta 3.1, announced during JavaOne and available now.
(June 15, Tech Talk)
In this Tech Talk, Josh Long explores an integration challenge using Spring Integration and walks through the implementation, employing and expanding on the basic patterns of Enterprise Application Integration to tie together components into a function integration solution, and then demonstrates how Spring Integration helps address the integration requirements.
(June 15, Tech Talk)
In this Tech Talk, David Geary teaches you: The basics of Google Web Toolkit; How to implement Ajax-enabled applications in Java; Internationalization; Hooking into the browser history mechanism; Remote procedure calls.
(June 4, Tech Talk)
Jon Kern discusses the best architecture/technical solutions and ensure that they are repeated by all developers. By tackling the architecture up-front in a serial manner, subsequent parallel development will be much more manageable and predictable.
(May 28, Tech Talk)
This keynote describes the frustrations of modern knowledge workers in their quest to actually get some work done, and solutions for how to guard yourself against all those distractions. Neal Ford talks about environments, coding, acceleration, automation, and avoiding repetition as ways to defeat the misguided attempts to sap your ability to produce good work.
(May 26, Tech Talk)
Gil demonstrates how new, aggressive uses of already abundant compute capacity by common applications offer competitive value for application designers.
(May 21, Tech Talk)
Chris Keene introduces WaveMaker as a new way to automate the ability to generate Hibernate classes in order to more quickly bring OR mapping into an application.
(May 19, Article)
In this session Nati Shalom demonstrates how to take a standard Java EE web application and scale it out or down dynamically without changes to the application code. Seeing as most web applications are over-provisioned to meet infrequent peak loads, this is a dramatic change because it enables growing your application as needed, when needed, without paying for unutilized resources.
(May 19, Tech Talk)
Mastering EJB was one of the original and most influential EJB books in the industry. Mastering EJB III now returns with two new expert co-authors, updated for EJB 2.1 and 30% new chapters including security, integration, best practices, open source, and more.
(Book PDF Download)
The Application Server Matrix is a detailed listing of J2EE vendors and their application server products, with information on latest version numbers, J2EE spec support and licensing, pricing, platform support, and links to product downloads and reviews.
(Application Server Comparison Matrix)
|
|