Saeed Amer

Ranch Hand
+ Follow
since Jan 20, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Saeed Amer

update - I solved the issue by deploying the missing jar files in the domain's lib folder

-=====

Hello there

I have not done any java/web development in many years but now at work I have been asked to take over for a colleague who left the company.

I have installed WLS 9.2 on my PC and have created required Domain and configured the JDBC Data Source, etc.

Now I am trying to build and deploy WebServices application (which I copied as-is from my x-colleagues's PC) to this WLS 9.2.

While deploying, I am getting following error:



I know this information may not be enough. So please let me know what other information should I provide to get help in resolving this error.

Thanks in advance!
10 years ago
Thanks Tsang but that does not address/answer the question I have.

I am expecting the code both in JSP and the Java class to get same number of connections - regardless of what happens with them later.

I am not sure JSP is getting 15 connections (instead of 45) due to some setting in WebLogic configuration.

Regards
10 years ago
JSP
From command line like this:



Regards
10 years ago
JSP
Yes the "closing connection" part has been intentionally left out.

I am wondering why the two (Java Class and the JSP with same code) are behaving differently?

Best regards

10 years ago
JSP
Hello

Java class returns 45 database connections and same code in JSP returns 15 connections. Here is what I am trying to do.

I have created a DataSource in WebLogic. The Maximum connection capacity is set to 15. I have created three managed servers clustered and I have targeted the DataSource to all three Managed servers in the cluster. I have a java class (client) which requests database connection in a loop and it stops/errors-out when the total number of connections reaches 45 (15 connections each provided by the three Managed Servers in the cluster). When I put the same code in the JSP, I only get 15 connections max. I am not sure what is wrong.

Here is the code - please excuse me for the quality of code. This code is not mine. I am trying to investigate why the DataSource connection count stops at 15 in the JSP.

========== Java Class Start =============

========== Java Class End =============

========== JSP Start =============

========== JSP End =============

Any clues?

Regards
10 years ago
JSP
Great - thank you for so simple explanation.

Regards,
Saeed
15 years ago
Hi there

I am almost 100% sure that method-chanining is supported in Java. I said "almost" because following chaining doesn't compile.

Here is the original piece of code:


I wanted to do something like this:


but this code doesn't compile.

OR in other words, why can't I do the following:



Could someone please elaborate the concept why Java compiler is not allowing to do this?

Regards,

Saeed
15 years ago
I am also glad it worked but I wonder the way I fixed it is the right way to do it or not?

I searched for properties and configuration files on my computer and there was no other copy of hibernate.cfg.xml except for the one in "src" folder and an identical copy in the "bin" folder (copied by Eclipse). The only copies of "hibernate.properties" files were the ones that came with the Hibernate distribution and these directories (where I unzipped them) are not on my classpath.

I still wonder if there is a way to "ask" hibernate which configuration/properties file it was look at (even if it was not hibernate's fault :-) )? I'll do some search to find the answer to this question but if you can point me in the right direction, it will save me valuable time.

Thank you Cameron and thank you everyone else who responded and helped.

Regards,
Saeed
Hi Tushar,

I have already tried this option too but it did not make any difference.

I solved the problem by replacing following line with the one below it:


Modified line:


So I am not sure which configuration OR properties file Hibernate was reading before this change. Perhaps that is why setting "hibernate.hbm2ddl.auto" to "update" didn't work.

I checked my classpath and there was no properties file and there was only one copy of configuration file (one copy of same file in the bin folder copied by Eclipse).

Do you know how can I check which file was Hibernate using?

Thank you!

Saeed
OK, I believe I have solved the problem by making following change:

before:

after:


Now if someone could let me know which file would Hibernate look for (and where) by default if it is not mentioned as I did above, it will be great.

Thanks everyone.

Regards,
Saeed
Thank you both!

I have done the "Clean Build" already - made no difference.

I do not have any "hibernate.properties" file in the classpath although there are some copies of this file that came with the hibernate distribution.

I have verified that Eclipse copies the modified (updated) hibernate.cfg.xml file into the "bin" folder (where it keeps the compiled code). Both the XML files (in my "src" folder and the "bin" folder) are identical. I have also searched for other copies of hibernate.cfg.xml but there is none other the two (in src and bin folder). If I change the cfg file, and run the main method, I see that the updated file has been copied by Eclipse to the bin folder.

Since I am running main method from within Eclipse, I am not sure what does "deploy" mean in this scenario? I don't have a web application but it is a plain core java class that I am using to test and learn Hibernate.

Thank you both of you once again. If there is anything else I may try, please do let me know. I wanted to move forward and start developing the web app I am ultimately going to develop but if I stuck on this issue.

Regards
Saeed
Hi Paul,

I have double checked and I have only one copy of hibernate.cfg.xml. And I am running this TestHoney's main method from within Eclipse (it is not a web app) so I guess possibility of not deploying correct hibernate.cfg.xml doesn't exist. This cfg file is exactly what I have posted above.

I still see following lines in the output:



Is it possible that Hibernate is using default value of this "hibernate.hbm2ddl.auto" property?

Thanks

Saeed
Hi there,

This is in relation to my previous post (re: hibernate.hbm2ddl.auto) but I thought to start a new thread and present the question in a different way. Maybe "hibernate.hbm2ddl.auto" has nothing to do with the issue I have.

The issue is that when I run my main method to test this simple Hibernate sample, all existing data in the table Honey is deleted. Following is my hibernate.cfg.xml. Could someone please tell me which property is causing the exiting data in the table to be deleted?



Here is my test class:



Here is what I see when I run the main method of my test class:



Look at the last line in output above - 0 row(s) found. There were few existing rows but after this run, they are gone. Not sure what is causing this.

Please look at lines 113-116. Since I have completely removed "hibernate.hbm2ddl.auto" property, what is causing this output now? Is it due to this part that my existing data is being deleted?

I am using Hibernate 3.3.1 and MySQL and perhaps needless to mention that I am a Hibernate-newbie.

Regards,

Saeed
No luck! It didn't make any difference. Data is still being deleted on each run.

Thanks,

Saeed
Thank you for your response Cameron!

I removed the line (previously I tried by commenting it out - I guess it is same as removing it) but the result is the same. In my TestHoney class (listed above), I am only inserting rows and then listing them. So, for each run, I should see 6 rows added to previous count but I only see 6-rows. Which means, this change made no difference. Here is modified hibernate.cfg.xml:



There is only one copy of this file in the classpath. Any other thoughts?

And yes, I am a newbie and I am absolutely going to go through your Hibernate guide/tutorial.

Thanks again and if there is anything else I may try to fix this problem, please do let me know.

Regards,

Saeed