Harsha Ka

Ranch Hand
+ Follow
since Mar 14, 2010
Harsha likes ...
Eclipse IDE Java
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
3
Received in last 30 days
0
Total given
5
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Harsha Ka

Bill Gorder wrote:
Also unless you are really partial to XML I would find some more modern examples as they tend to be annotation based. The framework world is moving away from XML configuration. I personally find the annotation based configuration much easier to write and read. Others may have differing opinions, but at least try both. Some sub-projects like Hibernate Envers do not even have XML support and there has not been enough demand to justify anyone to implement it.



Many thanks. I do plan to try out both xml and annotation based examples.
I am trying out simple examples with Hibernate and wrote a Hibernate mapping xml with two fields name and age. Part of the xml looked like this.



I was not able to run this as the schema validation was failing with the below exception.


Error parsing XML: XML InputStream(8) The content of element type "class" must match "(meta*,subselect?,cache?,synchronize*,comment?,tuplizer*,(id|composite-id),discriminator?,natural-id?,(version|timestamp)?,(property|many-to-one|one-to-one|component|dynamic-component|properties|any|map|set|list|bag|idbag|array|primitive-array)*,((join*,subclass*)|joined-subclass*|union-subclass*),loader?,sql-insert?,sql-update?,sql-delete?,filter*,resultset*,(query|sql-query)*)".
Initial SessionFactory creation failed.org.hibernate.InvalidMappingException: Could not parse mapping document from resource

I finally figured out that I needed to have an id which needs identifies every unique row. Below is the xml which worked



So was wondering if "id" is mandatory for every table to use it in Hibernate.

Thanks in advance for your help..
I know multiple Inheritance is not supported in Java.. But I guess since all classes extend Object in a way, multiple inheritance is supported. Any other guesses to this puzzle?
9 years ago


10 years ago
I had faced a similar issue. This can occur if there is version mismatch in the jars you have used.This got resolved when I downloaded the libs from this tutorial's sample WAR file.
10 years ago
I believe it is not possible to forward a request from one web application to another, but only use
10 years ago
Also is the piece of code inside all.providers.ProviderServlet servlet class or a class method called from this servlet ? If it is under some other servlet the servlet config parameter will not be available.
10 years ago
You can try Microsoft security essentials.. Its free for legit version of Windows
10 years ago

surya chintalapudi wrote: how to Implement a stack operations using ArrayList (Note:- java.util.stack need not be used)



I believe you are trying this for "educational purposes only".Otherwise as Ulf mentioned,its redundant. For implementing a stack, you'll need to provide methods to push and pop elements other than creating a new stack. Also stack follows LIFO(Last In First Out) i.e. the last element inserted will be the first to be popped out. Think of how you can achieve this using an ArrayList.
10 years ago

Rob Micah wrote:
Also the reason I can't use a connection pool is that the pool attempts to log in every so often with the last provided credentials. But once a user changes their password this causes repeated failed logins.


Which credentials are you talking about?
10 years ago
A way of doing this would be to create distinct groups/names for the different user experience and map this in your user preference table. In your action class fetch this value, set it as request parameter and forward the control to the JSP, where suitably using the conditional tags, create form elements based on the user group name.
10 years ago
You can probably keep the credentials configurable in a properties file, read this and use it for your JDBC connections.
10 years ago
The compiler error is because Java forces all the local variables to be initialized before you can access them.Since there is a possibility that the try-block can throw exception, the "token" variable might not have been initialized. You can try initializing token to null.

10 years ago
One possible way is using getAttributeNames() to get all the objects and iterate over these and check the key, and if the object key is matching your regex validation, remove this object.
10 years ago