Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!

G Par

Greenhorn
+ Follow
since Jul 11, 2011
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by G Par

Hi All,
I am new to j2ee world and altough I have gained significant therotical knowledge, I lack practical experience. Please bear with my potentially stupid questions. I am familiar with servers like Tomcat, Glassfish, Jboss (obviously cause I could download them for free to learn stuff
My questions:
1. can I use the opensource version of Tomcat, Glassfish, Jboss in production applications ?
2. Are there licensed versions of these products?
3. Are there any limitations/drawbacks of using opensource in production? E.g. limitations of number of users they can support?
4. If you run into issues using these opensource servers in production, what options are there for support and do we pay for them?
5. Are there any other good open source app servers, or which ones are the best? How do you decide one is better than other?
6. If o/s run fine in production, why do people go for expensive licensed software like Websphere or Weblogic? I would guess they have some nice vendor extensions, but wouldn't a vast majority of application needs be satisfied by the standard J2ee specs?

Appreciate any response.

Thanks
6 years ago
Thanks for your reply. I included webserver.jar but the same error persists. I am not sure I understand where exactly you suggested setting classpath in my eclipse helios.
I have set the clsspath via Run>RunConfigurations>Tomcat 7.0>Classpath Tab as shown in the diagram. I hope this is correct. Please advice what I am missing.
After spending hours I am not able to get this simple Hello World program in Struts 2 to work in Eclipse. But I have been able to get it to work in Netbeans and without an IDE. So Eclipse is really testing my patience here. I think it is something related to setting classpaths in eclipse but just can't figure it out. I don't know why it is so non-intutive in eclipse when it was a piece of cake in NB.
Appreciate any help.

The screenshot of eclipse runtime path is below.

The Web.xml is as follows


The struts.xml is as follows


Action is simple as follows


So basically it should have invoked the action MessageAction (which it does beautifully in NB and without IDE)

But in eclipse I get the below error I get the below error.
Dear All,
I am a new comer to threading so please bear with my potentially dumb question.
From what I have read in books the main use of threading is that tasks can be run in parallel and slow tasks won't hog the cpu.
But I can't think of practical scenarios in business applications when tasks need to run in parallel.
Most of these books give examples like word processor or printing which are really system applications.
When we talk about business application can somebody give examples of where they have used multithreading to do parallel tasking and how was this justified?

Few things I can imagine
1. Do multi tasking when there are multiple large running queries in your code that are not necessarily related and can be run in parallel
2. Do multi tasking when interfacing with external systems

But if you are not going outside the "boundaries of a java program" are there valid reasons to do multitasking?

THanks
Hey Guys,
I am a newbie in the whole java distributed world, so please bear with my ignorance. I had the exact same problem mentioned above (ClassCastException) and I was literrally scouring the web for the last 8 hours for a solution. Dozens of blogs say the same thing, that it has to do with the libraries in your path, but do not say exactly what libraries. Plus most of them are from old Jboss 5.0. I had this problem with Jboss 6 which deals with whole different set of libraries. So I had to do lot of trial and error. Just keep adding missing Jars (aout 20 of them) one at a time and removing ones that caused conflict and see if it hits. Finally after wasting many hours some random combination of libraries did hit which made me happy, but also sad. Here's why.. Are problems in distributed java just like this?, obscure and without much documented or logical approach? I mean, where in Jboss documentation is it mentioned that to do a remote call to jboss you need x, y and z jars and why are those needed ? Is it all just hit, miss and google? Is that how people solve problems in java? I am getting a bit demotivated by this. Would love to hear from veterans on this.

Thanks
Girish
6 years ago
Thanks Hubbs, That does make the action self conainted but with the added "drawback" (is it really?) of needing If branching to differentiate modes plus passing the mode from web page via request, that means more coupling with servlet api.
6 years ago
oh cmon guys, I didn't think it was that arcane a question that nobody would bother to reply. I really need to know from experts what's the best practive here. Appreciate a response.
6 years ago
Hi All,
I am struggling with designing an ideal solution for Action/Form.

The requirement is roughly like this:
You have a Customer page appearing first with data pre-populated.
Followed by Bank Details page , also pre-populated
and finally, Address page

So I could come up with something like this:
Customer.jsp contains html:form with action mapping CustomerAction->CustomerActionForm
Bank.jsp contains html:form with action mapping BankAction->BankActionForm
Address.jsp contains html:form with action mapping AddressAction->AddressActionForm

the Action forms have logic to save data submitted from respective forms.

The problem is to pre-populate the respective ActionForms before the pages are opened, I have to retrieve customer data before customer action, supplier data before supplier action and so on.. I would probably have to retrieve supplier data inside customer action after it is succesfully saved. I find that quite non-intuitive and non-reusable.
Alternative approach is to retrieve all the ActionForms and store them in session even before the first form. But this has disadvantage of retrieving all data up-front which means if the user cancels in between it's a waste.

Can anybody suggest any other design?

Thanks
Girish
6 years ago
Hey Guys,
You are not going to believe what I found. I had the same problem as everybody else has mentioned above. After 3 hours of trying all the solutions mentioned above and not success and almost uprooting all my hair I finally gave up on eclipse and went to netbeans and then guess what? I found some special characters in the file which I could not see in eclipse. Then I realized the tablib declaration that I had copied from some place was rich text and it put the " in some special form. It looked normal but I guess behind the scene it wasn't. Only after opening it in a different editor I could see it. Then removing th line and re-typing it directly in eclipse did the trick. Talk about wasting 3 hours of your life
But glad I could share it with you so nobody else go thru this again