Ramon Bonet

+ Follow
since Jun 02, 2013
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ramon Bonet

Hi all,

Trying to run the application into browser, the following error appears:

javax.naming.NameNotFoundException: name hibernate/TFCappDS is not associated with this context

I connect to data Source with JNDI lookup, my app server is VMware vFabric tc Server, and I'm using Hibernate as the ORM framwork.

The fact is, I really don't know what name should I put as a jndi name.

Furthermore, I read in some places that is necessary to define JNDI lookup name as a <resource> in server.xml file from Server directory, and then to reference JNDI from Server's web, in context.xml from the same directory. But I have no idea about how to create this server resource, or what values should I write considering my server and ORM cases (VMware vFabric tc Server, Hibernate)

All my current code about JNDI and dataSource bean is this, at Spring xml file:

And I added the following resource, inside server.xml VMware tc Server file:

But It still does not recognize jndi name as a part of this context.

About this, I have two questions:

Can someone tell me if I have the correct values of 'url' and 'driverClassName' parameters, considering postgres??

Does Anyone know if there's something more to do, after editing servlet-context.xml and server.xml like this, to get JNDI-lookup name finally recognized? Or am I just simply wrong from de begining?

Very grateful to everyone
10 years ago
Only if necessary, here is pom.xml:

and finally my DAO interface and implementation, only if necessary:

Dao Interface:

Dao implementation

and Client.java data access object:

I'm sure all group dependency versions at pom.xml are updated, and I'm really lost founding a solution.

Can someone help me?
10 years ago
Hi all,

The following error appears when I try to enter at my main url application localhost:8080/springmvc/, with VMware vFabric tc server 2.8.2 previously executed, using STS last version:

These are a chain of concatenated errors:

note: my Spring xml context configuratior is servlet-context.xml

HTTP 500 state, exception at Servlet.init()

Root cause:

org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'org.springframework.dao.annotation.PersistenceExc eptionTranslationPostProcessor#0' defined in servlet-context.xml

": Error creating bean with name 'sessionFactory' defined in servlet-context.xml

org.springframework.beans.BeanInstantiationExcepti on: Could not instantiate bean class [org.springframework.orm.hibernate3.annotation.Anno tationSessionFactoryBean]: Constructor threw exception

java.lang.NoClassDefFoundError: org/hibernate/cfg/AnnotationConfiguration
org.springframework.orm.hibernate3.annotation.Anno tationSessionFactoryBean.<init>

There is something I should know about defining a PersistenceExceptionTranslationPostPorcessor in my xml Spring file? Or maybe error begins with defining the AnnotationSessionFactoryBean bean?

Here are the servlet-context.xml:

I'm sure that errors are between <jee:jndi-lookup> and <tx:annotation-driven> elements

( POST CONTINUE IN THE FIRST THREAD REPLY with the rest of code files)
10 years ago
Issue fixed: packagesToScan needs the 'orm' artifact, from 'org.springframework' group dependences, and it has to be a 3.2.2 version or newer

Using maven, at pom.xml file, include de newest version of org.springframework, inside <properties> element before <dependency> declarations:

3.2.3.RELEASE is the current last version

Then include the following dependency:

REMEMBER: all artifacts of the same group Id dependencies must have the same version. So if you are using others org.springframwork artifacts, be sure they are running under ${org.springframework-version} value version (3.2.3.RELEASE in this case)

Thread solved!

10 years ago

Trying to connect Hibernate 3 with my Spring application, I wrote this bean at servlet-context.xml:

No errors, except packagesToScan. I have no idea about how to create a setter for 'packagesToScan', where it has suppose to be created, or how to set it.

I read in some forums looking for an answer, that application has to be implemented under a recent Spring version, 3.1 or upper, but I already have 3.2.0.RELEASE version, as 'Help' main-menu option indicates me

Any Idea?
10 years ago
Okay, so I guess I'll use no-prefix for <mv> name space. Thank you very much!
10 years ago
Thanks Mark, understood. All depends if there is a prefix defined at namespaces delcaration or not, you have to include the prefix in all declarations below or not.

But the fact is I already have one 'xmlns' declaration without prefix included among others. Take a look:

I'm not able to write more than one xmlns values without prefix, only once. The rest have to include a ':'prefix.

Is there any way to write multiple xmlsn-non-prefix values?

Pd: note I write the initial bean declaration of servlet-context.xml with the 'beans' prefix, because this is how bean namespace is defined right now

10 years ago
Hello community. I'm a newbie Spring user developing my first Spring MVC application.

The following code, located at servlet-context.xml:

Gives me this error:

The matching wildcard is strict, but no declaration can be found for element 'props'

The same error occurred with <bean> element, but it was fixed including 'beans' prefix <beans:bean ..>

My two questions are: How can I fix the 'props' element error? and How can I avoid using 'beans' prefix in every <bean> xml declaration?

Just to mention that I already has the 'bean' xmlns and schema-location declarations, like this:

And if I write the schema location like this, instead of previous delcaration:

In booth cases if I don't put the 'beans' prefix, like this

I have the same error:

The matching wildcard is strict, but no declaration can be found for element 'bean'.
Cannot locate BeanDefinitionParser for element [bean]

Very thankful for your help
10 years ago