-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Error : Parameter uname does not exist as a named parameter
PostPosted: Fri Nov 21, 2008 8:40 am 
Newbie

Joined: Fri Nov 21, 2008 7:10 am
Posts: 1
Hello everybody

I get an error after deploy a war file in Oracle OAS 10g (10.1.3.10).

I am using spring and hibernate 3.0. The database is Oracle 10.

If i deploy it in jboss 4.0.2 it works fine
but when I deploy in Oracle OAS 10g (10.1.3.10) and try to access the data base i have the next error

I send the stacktrace and the method who fails

500 Internal Server Error
java.lang.IllegalArgumentException: Parameter uname does not exist as a named parameter in
[from aut.bus.Usuario u where u.username = :uname]
at org.hibernate.impl.AbstractQueryImpl.setParameter(AbstractQueryImpl.java:356)
at org.hibernate.impl.AbstractQueryImpl.setString(AbstractQueryImpl.java:636)
at aut.dao.impl.hibernate.UsuarioDaoImpl.getByUserName(UsuarioDaoImpl.java:39)
at aut.service.impl.UserDetailsServiceImpl.loadUserByUsername(UserDetailsServiceImp
l.java:56)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

public Usuario getByUserName(String username) throws DataAccessException {

Usuario usuario;
LogUtils.loguearMetodo(log,username);
Session sesion = sessionFactory.getCurrentSession();
Query query = sesion.createQuery("from aut.bus.Usuario u where u.username = uname");
query.setString("uname",username);
usuario = (Usuario)query.uniqueResult();
return usuario;
}


Oracle´s developer page says the librarie oracle.toplink is in conflict with hibernate.

I remove in the orion-application.xml but it doens´t work

My orion-application is the next

<orion-application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/oracleas/schema/orion-app
lication-10_0.xsd" deployment-version="10.1.3.1.0"
default-data-source="jdbc/OracleDS" component-classification="external"
schema-major-version="10" schema-minor-version="0" >
<web-module id="registro" path="registro.war" />
<persistence path="persistence" />
<imported-shared-libraries>
<remove-inherited name="oracle.toplink"/>
</imported-shared-libraries>
<principals path="principals.xml" />
<jazn provider="XML" />
<log>
<file path="application.log" />
</log>
</orion-application>

Can anyone help me?

Thank you for your attention.

Regards

Alfonso


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.