Org.hibernate.hql.ast.QuerySyntaxException ... is not mapped
Hi,
I wanted to perform a query like this: Query q = entityManager.createQuery ("select userName from manageUsers where username=123");
I'm guessing "manageUsers " isn't mapped but i don't know where to map this.
Thanks
Banke wrote:
First are you using JPA with hibernate as the provider or are you using hibernate directly?
I guess the first, you can map this either by annotations on your entity bean or you can specify them in the xml file orm.xml.Thanks for your reply, i've fixed this but now i want to test a delete query but i keep getting:
23:45:36,203 ERROR [STDERR] java.lang.IllegalStateException: org.hibernate.hql.QueryExecutionRequestException: Not supported for DML operations [delete from project.ws.manageUsers mu where name = 123]
I've tried searching with google but the results were not what i hoped for. I'm guessing my query is wrong but im not sure how to change the query so that i can delete something from my db , what does the error message means "DML operations" ?
code: Query q = entityManager.createQuery("delete from manageUsers mu where name = 123");
Thanks
Similar Messages
-
I have created my tables, but i am having the given error :
java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: group33MAGAZINE is not mapped [FROM group33MAGAZINE WHERE MAGID='TeST'] i have created my Magazine file, code :
* Magazine.java
* Magazine is the main interface for the class.
* A magazine is a one-to-many with issue.java
* Magazine is a many-to-one with SubjectArea.java
* * MAGAZINE , ISSUE , SUBJECT AREA Workinh
* Revised : Stelios Philippou
* Date : 26 April
package com.group33.entities;
import javax.persistence.*;
import java.util.*;
@Entity
@Table(name = "group33MAGAZINE")
public class Magazine implements java.io.Serializable {
private String magId;
private String title;
private int period;
private int publicationDay;
private String magDescription;
//SUBJECT AREA CONNECTION
private SubjectArea subjectArea;
private int areaId;
// MagazineSubscription connection.
//private Set<MagazineSubscription> magazineSubscriptions = new HashSet<MagazineSubscription>();
/*************************Magazine*************************/
@Id
@Column(name = "MAGID",length = 5, nullable = false)
public String getMagId() { return magId; }
public void setMagId(String magId) { this.magId = magId; }
@Column(name = "TITLE", length = 50, nullable = false)
public String getTitle() { return title; }
public void setTitle(String title) { this.title = title; }
@Column(name = "PERIOD", nullable = true)
public int getPeriod() { return period; }
public void setPeriod(int period) { this.period = period; }
@Column(name = "PUBLICATIONDAY", nullable = true)
public int getPublicationDay() { return publicationDay; }
public void setPublicationDay(int publicationDay) { this.publicationDay = publicationDay; }
@Column(name = "MAGDESCRIPTION", nullable = true)
public String getMagDescription() { return magDescription; }
public void setMagDescription(String magDescription) { this.magDescription = magDescription; }
/*************************Subject Area*************************/
// Foreging Key for SubjectArea
@Column(name = "AREAID", nullable = false)
public int getAreaId() { return areaId; }
public void setAreaId(int areaid) { this.areaId = areaId; }
//Delpoyemnt for one to many ussing subject Area
@ManyToOne
@JoinColumn(name = "AREAID", insertable = false, updatable = false)
public SubjectArea getSubjectArea() {return subjectArea;}
public void setSubjectArea(SubjectArea subjectArea) { this.subjectArea = subjectArea; }
/*************************items Ordered*************************/
// Hash Set itemsordered connection
private Set<ItemsOrdered>itemsOrdereds = new HashSet<ItemsOrdered>();
//Deployoing one to many for itemsordered
@OneToMany(mappedBy = "magazine")
public Set<ItemsOrdered> getItemsOrdered() { return itemsOrdereds; }
public void setItemsOrdered(Set<ItemsOrdered> itemsOrdereds) { this.itemsOrdereds = itemsOrdereds; }
/*************************Issue*************************/
//Hash Set Issue
private Set<Issue> issues = new HashSet<Issue>();
@OneToMany(mappedBy = "magazine")
public Set<Issue> getIssues() { return issues; }
public void setIssues(Set<Issue> issues) { this.issues = issues; }
// Deployement for many to one of Subscription
//@OneToMany(mappedBy = "magazine")
//public Set<MagazineSubscriptions> getMagazineSubscriptions() { return magazineSubscriptions; }
//public void setMagazineSubscriptions(Set<MagazineSubscriptions> magazineSubscriptions) { this.magazineSubscriptions = magazineSubscriptions; }
} and my persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence>
<persistence-unit name="group33">
<jta-data-source>java:/DB2DSGROUP33</jta-data-source>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.DB2Dialect"/>
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
</properties>
</persistence-unit>
</persistence>My db is created with schema group33 and group33MAGAZINE
No matter what i enter in the search i will be unable to proceed with the searching.
Something, somewhere is not right and i am not sure what.
Please some pointers
Tried various names for magazine and nothing helpedstevoo wrote:
Solved ... i think ill stop posting if ill be finding the solutions by myself.Fine by us. You make that sound like a bad thing. After all, no one is guaranteed an answer when they come here.
Anyway after a lot of tweaking, it seemed that i need to deploy all entities to actually work. Yes.
So i stripped every relation down and left just magazine. If that's what your problem demands.
It looked like that was all it neededGood job.
% -
Org.hibernate.PropertyNotFoundException: Could not find a getter for id in
[skumar@aithdell3 events]$ java EventManager
May 15, 2008 8:39:41 PM org.hibernate.cfg.Environment <clinit>
INFO: Hibernate 3.2.3
May 15, 2008 8:39:41 PM org.hibernate.cfg.Environment <clinit>
INFO: hibernate.properties not found
May 15, 2008 8:39:41 PM org.hibernate.cfg.Environment buildBytecodeProvider
INFO: Bytecode provider name : cglib
May 15, 2008 8:39:41 PM org.hibernate.cfg.Environment <clinit>
INFO: using JDK 1.4 java.sql.Timestamp handling
May 15, 2008 8:39:42 PM org.hibernate.cfg.Configuration configure
INFO: configuring from resource: /hibernate.cfg.xml
May 15, 2008 8:39:42 PM org.hibernate.cfg.Configuration getConfigurationInputStream
INFO: Configuration resource: /hibernate.cfg.xml
May 15, 2008 8:39:42 PM org.hibernate.cfg.Configuration addResource
INFO: Reading mappings from resource : Event.hbm.xml
May 15, 2008 8:39:43 PM org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
INFO: Mapping class: Event -> EVENTS
May 15, 2008 8:39:43 PM org.hibernate.cfg.Configuration doConfigure
INFO: Configured SessionFactory: null
May 15, 2008 8:39:43 PM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: Using Hibernate built-in connection pool (not for production use!)
May 15, 2008 8:39:43 PM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: Hibernate connection pool size: 1
May 15, 2008 8:39:43 PM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: autocommit mode: false
May 15, 2008 8:39:43 PM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: using driver: org.hsqldb.jdbcDriver at URL: jdbc:hsqldb:sql://localhost
May 15, 2008 8:39:43 PM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: connection properties: {user=sa, password=****}
May 15, 2008 8:39:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: RDBMS: HSQL Database Engine, version: 1.8.0
May 15, 2008 8:39:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC driver: HSQL Database Engine Driver, version: 1.8.0
May 15, 2008 8:39:44 PM org.hibernate.dialect.Dialect <init>
INFO: Using dialect: org.hibernate.dialect.HSQLDialect
May 15, 2008 8:39:44 PM org.hibernate.transaction.TransactionFactoryFactory buildTransactionFactory
INFO: Using default transaction strategy (direct JDBC transactions)
May 15, 2008 8:39:44 PM org.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup
INFO: No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
May 15, 2008 8:39:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Automatic flush during beforeCompletion(): disabled
May 15, 2008 8:39:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Automatic session close at end of transaction: disabled
May 15, 2008 8:39:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC batch size: 15
May 15, 2008 8:39:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC batch updates for versioned data: disabled
May 15, 2008 8:39:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Scrollable result sets: enabled
May 15, 2008 8:39:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC3 getGeneratedKeys(): disabled
May 15, 2008 8:39:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Connection release mode: auto
May 15, 2008 8:39:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Default batch fetch size: 1
May 15, 2008 8:39:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Generate SQL with comments: disabled
May 15, 2008 8:39:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Order SQL updates by primary key: disabled
May 15, 2008 8:39:44 PM org.hibernate.cfg.SettingsFactory createQueryTranslatorFactory
INFO: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
May 15, 2008 8:39:44 PM org.hibernate.hql.ast.ASTQueryTranslatorFactory <init>
INFO: Using ASTQueryTranslatorFactory
May 15, 2008 8:39:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Query language substitutions: {}
May 15, 2008 8:39:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: JPA-QL strict compliance: disabled
May 15, 2008 8:39:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Second-level cache: enabled
May 15, 2008 8:39:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Query cache: disabled
May 15, 2008 8:39:44 PM org.hibernate.cfg.SettingsFactory createCacheProvider
INFO: Cache provider: org.hibernate.cache.NoCacheProvider
May 15, 2008 8:39:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Optimize cache for minimal puts: disabled
May 15, 2008 8:39:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Structured second-level cache entries: disabled
May 15, 2008 8:39:45 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Echoing all SQL to stdout
May 15, 2008 8:39:45 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Statistics: disabled
May 15, 2008 8:39:45 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Deleted entity synthetic identifier rollback: disabled
May 15, 2008 8:39:45 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Default entity-mode: pojo
May 15, 2008 8:39:45 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Named query checking : enabled
May 15, 2008 8:39:45 PM org.hibernate.impl.SessionFactoryImpl <init>
INFO: building session factory
Intial session factory creation failed org.hibernate.PropertyNotFoundException: Could not find a getter for id in class Event
Exception in thread "main" java.lang.ExceptionInInitializerError
at HibernateUtil.<clinit>(HibernateUtil.java:18)
at EventManager.main(EventManager.java:11)
Caused by: org.hibernate.PropertyNotFoundException: Could not find a getter for id in class Event
at org.hibernate.property.BasicPropertyAccessor.createGetter(BasicPropertyAccessor.java:282)
at org.hibernate.property.BasicPropertyAccessor.getGetter(BasicPropertyAccessor.java:275)
at org.hibernate.tuple.PropertyFactory.getGetter(PropertyFactory.java:168)
at org.hibernate.tuple.PropertyFactory.buildIdentifierProperty(PropertyFactory.java:44)
at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:123)
at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:434)
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:109)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
at HibernateUtil.<clinit>(HibernateUtil.java:14)
How can i fix this exception
Please help me.
Thanks in advance[skumar@aithdell3 events]$ java EventManager
May 15, 2008 8:39:41 PM org.hibernate.cfg.Environment <clinit>
INFO: Hibernate 3.2.3
May 15, 2008 8:39:41 PM org.hibernate.cfg.Environment <clinit>
INFO: hibernate.properties not found
May 15, 2008 8:39:41 PM org.hibernate.cfg.Environment buildBytecodeProvider
INFO: Bytecode provider name : cglib
May 15, 2008 8:39:41 PM org.hibernate.cfg.Environment <clinit>
INFO: using JDK 1.4 java.sql.Timestamp handling
May 15, 2008 8:39:42 PM org.hibernate.cfg.Configuration configure
INFO: configuring from resource: /hibernate.cfg.xml
May 15, 2008 8:39:42 PM org.hibernate.cfg.Configuration getConfigurationInputStream
INFO: Configuration resource: /hibernate.cfg.xml
May 15, 2008 8:39:42 PM org.hibernate.cfg.Configuration addResource
INFO: Reading mappings from resource : Event.hbm.xml
May 15, 2008 8:39:43 PM org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
INFO: Mapping class: Event -> EVENTS
May 15, 2008 8:39:43 PM org.hibernate.cfg.Configuration doConfigure
INFO: Configured SessionFactory: null
May 15, 2008 8:39:43 PM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: Using Hibernate built-in connection pool (not for production use!)
May 15, 2008 8:39:43 PM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: Hibernate connection pool size: 1
May 15, 2008 8:39:43 PM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: autocommit mode: false
May 15, 2008 8:39:43 PM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: using driver: org.hsqldb.jdbcDriver at URL: jdbc:hsqldb:sql://localhost
May 15, 2008 8:39:43 PM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: connection properties: {user=sa, password=****}
May 15, 2008 8:39:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: RDBMS: HSQL Database Engine, version: 1.8.0
May 15, 2008 8:39:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC driver: HSQL Database Engine Driver, version: 1.8.0
May 15, 2008 8:39:44 PM org.hibernate.dialect.Dialect <init>
INFO: Using dialect: org.hibernate.dialect.HSQLDialect
May 15, 2008 8:39:44 PM org.hibernate.transaction.TransactionFactoryFactory buildTransactionFactory
INFO: Using default transaction strategy (direct JDBC transactions)
May 15, 2008 8:39:44 PM org.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup
INFO: No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
May 15, 2008 8:39:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Automatic flush during beforeCompletion(): disabled
May 15, 2008 8:39:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Automatic session close at end of transaction: disabled
May 15, 2008 8:39:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC batch size: 15
May 15, 2008 8:39:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC batch updates for versioned data: disabled
May 15, 2008 8:39:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Scrollable result sets: enabled
May 15, 2008 8:39:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC3 getGeneratedKeys(): disabled
May 15, 2008 8:39:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Connection release mode: auto
May 15, 2008 8:39:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Default batch fetch size: 1
May 15, 2008 8:39:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Generate SQL with comments: disabled
May 15, 2008 8:39:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Order SQL updates by primary key: disabled
May 15, 2008 8:39:44 PM org.hibernate.cfg.SettingsFactory createQueryTranslatorFactory
INFO: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
May 15, 2008 8:39:44 PM org.hibernate.hql.ast.ASTQueryTranslatorFactory <init>
INFO: Using ASTQueryTranslatorFactory
May 15, 2008 8:39:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Query language substitutions: {}
May 15, 2008 8:39:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: JPA-QL strict compliance: disabled
May 15, 2008 8:39:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Second-level cache: enabled
May 15, 2008 8:39:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Query cache: disabled
May 15, 2008 8:39:44 PM org.hibernate.cfg.SettingsFactory createCacheProvider
INFO: Cache provider: org.hibernate.cache.NoCacheProvider
May 15, 2008 8:39:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Optimize cache for minimal puts: disabled
May 15, 2008 8:39:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Structured second-level cache entries: disabled
May 15, 2008 8:39:45 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Echoing all SQL to stdout
May 15, 2008 8:39:45 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Statistics: disabled
May 15, 2008 8:39:45 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Deleted entity synthetic identifier rollback: disabled
May 15, 2008 8:39:45 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Default entity-mode: pojo
May 15, 2008 8:39:45 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Named query checking : enabled
May 15, 2008 8:39:45 PM org.hibernate.impl.SessionFactoryImpl <init>
INFO: building session factory
Intial session factory creation failed org.hibernate.PropertyNotFoundException: Could not find a getter for id in class Event
Exception in thread "main" java.lang.ExceptionInInitializerError
at HibernateUtil.<clinit>(HibernateUtil.java:18)
at EventManager.main(EventManager.java:11)
Caused by: org.hibernate.PropertyNotFoundException: Could not find a getter for id in class Event
at org.hibernate.property.BasicPropertyAccessor.createGetter(BasicPropertyAccessor.java:282)
at org.hibernate.property.BasicPropertyAccessor.getGetter(BasicPropertyAccessor.java:275)
at org.hibernate.tuple.PropertyFactory.getGetter(PropertyFactory.java:168)
at org.hibernate.tuple.PropertyFactory.buildIdentifierProperty(PropertyFactory.java:44)
at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:123)
at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:434)
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:109)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
at HibernateUtil.<clinit>(HibernateUtil.java:14)
How can i fix this exception
Please help me.
Thanks in advance -
Hi All,
I am using Oracle 11g and I am trying to delete some records from database using some GUI. In that case I am getting following error:
java.lang.Exception: org.hibernate.AssertionFailure: scrollable result sets are not enabled. When I restart the application's service, this error is going away and deletion is working fine.
Other related jars that I am using is as follow:
ojdbc5.jar
hibernate-3.0.5.jar
I am attaching the stack trace as well:
<log4j:event logger="org.hibernate.AssertionFailure" timestamp="1263964931355" sequenceNumber="24" level="ERROR" thread="SocketListener0-2">
<log4j:message><![CDATA[an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session)]]></log4j:message>
<log4j:throwable><![CDATA[org.hibernate.AssertionFailure: scrollable result sets are not enabled
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:368)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:334)
at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:88)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1162)
at org.hibernate.loader.Loader.scroll(Loader.java:1634)
at org.hibernate.loader.hql.QueryLoader.scroll(QueryLoader.java:443)
at org.hibernate.hql.ast.QueryTranslatorImpl.scroll(QueryTranslatorImpl.java:291)
at org.hibernate.impl.SessionImpl.scroll(SessionImpl.java:960)
at org.hibernate.impl.QueryImpl.scroll(QueryImpl.java:62)
at com.sample.persistence.WorklistItemDAO.purge(WorklistItemDAO.java:145)
at com.sample.server.worklistmanager.WorklistManager.purge(WorklistManager.java:695)
at com.sample.server.webservices.CCGPIWorklistHandler.purge(CCGPIWorklistHandler.java:329)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.xmlrpc.Invoker.execute(Invoker.java:130)
at org.apache.xmlrpc.XmlRpcWorker.invokeHandler(XmlRpcWorker.java:84)
at org.apache.xmlrpc.XmlRpcWorker.execute(XmlRpcWorker.java:146)
at org.apache.xmlrpc.XmlRpcServer.execute(XmlRpcServer.java:139)
at org.apache.xmlrpc.XmlRpcServer.execute(XmlRpcServer.java:114)
at com.sample.server.webservices.XmlRpcServlet.service(XmlRpcServlet.java:63)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
at org.mortbay.jetty.servlet.ServletHandler.dispatch(ServletHandler.java:666)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
at org.mortbay.http.HttpServer.service(HttpServer.java:909)
at org.mortbay.http.HttpConnection.service(HttpConnection.java:816)
at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:982)
at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)
at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
]]></log4j:throwable>
</log4j:event>
Thanks
ShivHi All,
anybody got a chance to look into it?
--Shiv -
Error coming while running Hibernate HQL select query in jdeveloper
Hi ,
I have created hibernate application with just create query its running fine, i also writeen HQL select query below exception is coming,
CharScanner; panic: ClassNotFoundException: org.hibernate.hql.ast.HqlToken
i also checked org.hibernate.hql.ast.HqlToken , its thr in jar file, eventhough it is throwing error.
plz give sollutionHi dvohra,
I have written below code
List l1=new ArrayList();
try{
HibClass hib = new HibClass();
Session session = hib.currentSession();
Transaction tx = session.beginTransaction();
Manager m;
System.out.println("server------------------------");
//Using from Clause
String SQL_QUERY ="from Manager manager";
Query query = session.createQuery(SQL_QUERY);
List list = query.list();
for (int i = 0; i < list.size();
i++) {
Manager manager =
(Manager) list.get(i);
System.out.println(
"MId " +
manager.getMid() +
" Manager Name: " +
manager.getMname());
m=new Manager();
m.setMid(manager.getMid());
m.setMname(manager.getMname());
l1.add(m);
session.close();
}catch(Exception e){
System.out.println("helo-------------error---------"+e.getMessage());
}finally{
return l1;
still below exception is coming
CharScanner; panic: ClassNotFoundException: org.hibernate.hql.ast.HqlToken
oc4j is shutting down
i am trying from 4 days , help me -
Org.hibernate.MappingException: broken column mapping
I have 2 tables I'm trying to do a left outer join.
Code:
"FROM Family AS f INNER JOIN f.personVersion AS pv
LEFT OUTER JOIN pv.personDetails"
I see this as a one-to-one relationship between the foreign key in Person_Details and the Primary Key in Person_Version
PERSON_VERSION
KEY TYPE COLUMN NAME REF TABLE REF COLUMN
PK_PERSON_VERSION Primary PERSON_VERSION_ID
FK1_PRSN_VRSN Foreign EVENT_ID EVENT EVENT_ID
PERSON_DETAILS
KEY TYPE COLUMN NAME REF TABLE REF COLUMN
PK_PERSON_DETAILS Primary PERSON_ID, PERSON_VERSION_ID
FK1_PERSON_DTLS Foreign PERSON_VERSION_ID PERSON_VERSION PERSON_VERSION_ID
My Person_Version class :
Code:
@Entity public class PersonVersion extends BaseEntity { private static final long serialVersionUID = 1L; private PersonDetails personDetails; ...... }
My ORM.xml:
Code:
<entity class="com.PersonVersion"> <table name="person_version" /> <sequence-generator name="SEQ" sequence-name="SQ_person_version" allocation-size="1"/> <attribute-override name="id"> <column name="person_version_id" column-definition="NUMBER(38)"/> </attribute-override> <attributes> <basic name="eventId"> <column name="event_id" column-definition="NUMBER(38)" /> </basic> <one-to-one fetch="EAGER" name="personDetails" optional="true"> <join-column name="person_version_id" insertable="false" updatable="false"/> <cascade> <cascade-refresh/> </cascade> </one-to-one> </attributes> </entity>
When I start my server I get the following error:
Reason: javax.persistence.PersistenceException: org.hibernate.MappingException: broken column mapping
for: personDetails.id of: com.PersonVersion
Has anyone run into this issue?SHIBA wrote:
Hi All,
I have two tables Emp and Dept with primary key of Dept table is Foregn key of Emp table
I had created hibernate mapping file ,hibernate configuration file and POJO clasess using Reverse Engineering.
i'm using spring framework for this.
when i try to access dept information on page.
it throws an exception as follows
Initialization of bean failed; nested exception is org.hibernate.MappingException: entity class not found : Emp
My guess is that your hibernate.cfg.xml does not contain an .hbm.xml for both Dept and Emp.
% -
Org.hibernate.exception.GenericJDBCException: could not execute query
while executing sql statements with hibernate oracle this type of errors
org.hibernate.exception.GenericJDBCException: could not execute query
ava.sql.SQLException: ORA-01001: cursore non valido can any one suggest
a solution for this.
ThanksThis is likely due to a commit/rollback being executed after the statement has been executed but befofre the result set has been processed by the application. In TimesTen, unlike Oracle, commit/rollback closes all open cursors on the connection. This could be a case of using the wrong Hibernate dialect. Are you using a TimesTen dialect in Hibernate?
Chris -
Org.hibernate.AssertionFailure: scrollable result sets are not enabled
I am using hibernate with oracle and got the following code snippet:
ScrollableResults results = criteria.scroll(ScrollMode.SCROLL_SENSITIVE);
When I run the above snippet I get the following exception:
org.hibernate.AssertionFailure: scrollable result sets are not enabled
I'm using hibernate 3.2.2.ga and oracle 10g
Can someone help me? How can I solve this problem?
Victor Lindberg
Edited by: user5745495 on 01/04/2010 14:15This is the "Database - General" forum for the Oracle Database.
Please change the subject to "Please Ignore" and repost your question in a Java / JDeveloper forum.
Thank you. -
Org.hibernate.MappingException: invalid configuration in hibernate
hi,
i am new to hibernate.
while i am executing small program, below error occur.
what can i do to solve this problem, plz help me.
Error Code
log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
Exception occur:invalid configuration
org.hibernate.MappingException: invalid configuration+
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1493)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1434)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1420)
at FirstExample.main(FirstExample.java:12)
Caused by: org.xml.sax.SAXParseException: Document is invalid: no grammar found.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
at org.dom4j.io.SAXReader.read(SAXReader.java:465)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1490)
... 3 more
Exception in thread "main" java.lang.NullPointerException
at FirstExample.main(FirstExample.java:26)Thank u .
I did all configuration properly by some guideline.
But i got new error in my program.
please reply me.
This is my program
*{color:#3366ff}Test.java{color}*
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
import event.Sample;
public class Test {
public static void main(String a[])throws HibernateException
Session session=null;
try
SessionFactory sessionFactory=new Configuration().configure().buildSessionFactory();
session=sessionFactory.openSession();
System.out.println("Insert record ");
Sample s=new Sample();
s.setId(3);
s.setName("Sundar");
session.save(s);
System.out.println("Sucessfully Saved");
}catch(Exception e)
System.out.println("Exception occur:"+e.getMessage());
e.printStackTrace();
}finally
session.flush();
session.close();
*{color:#3366ff}Java Bean Sample.java{color}*
package event;
public class Sample {
private int id;
private String name;
public int getId() {
return id;
public void setId(int id) {
this.id = id;
public String getName() {
return name;
public void setName(String name) {
this.name = name;
*{color:#3366ff}{color:#ff0000}hibernate.cfg.xml file{color}*
*<?xml version="1.0" encoding="utf-8"?>*
*<!DOCTYPE hibernate-configuration PUBLIC*
*"-//Hibernate/Hibernate Configuration DTD 3.0//EN"*
*"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">*
*<hibernate-configuration>*
* <session-factory>*
* <!-- local connection properties -->*
* <property name="hibernate.connection.url">*
* jdbc:mysql://localhost:3306/test*
* </property>*
* <property name="hibernate.connection.driver_class">*
* com.mysql.jdbc.Driver*
* </property>*
* <property name="hibernate.connection.username">root</property>*
* <property name="hibernate.connection.password">server</property>*
* <!-- property name="hibernate.connection.pool_size"></property -->*
* <!-- dialect for MySQL -->*
* <property name="dialect">*
* org.hibernate.dialect.MySQLDialect*
* </property>*
* <property name="hibernate.show_sql">false</property>*
* <property name="hibernate.transaction.factory_class">*
* org.hibernate.transaction.JDBCTransactionFactory*
* </property>*
* <mapping resource="event/Sample.hbm.xml" />*
* </session-factory>*
*</hibernate-configuration>*
*{color:#ff0000}{color:#000000}Sample.hbm.xml file{color}*
*<?xml version="1.0" encoding="utf-8"?>*
*<!DOCTYPE hibernate-mapping PUBLIC*
* "-//Hibernate/Hibernate Mapping DTD//EN"*
* "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >*
*<hibernate-mapping package="event">*
* <class name="Sample" table="sample" >*
* <meta attribute="sync-DAO">true</meta>*
* <property name="Id" column="id" type="integer" not-null="false" length="11" />*
* <property name="Name" column="name" type="string" not-null="false" length="50" />*
* </class>*
*</hibernate-mapping>*
*{color}{color}*
*{color:#3366ff}
This is my error.{color}*
log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
Exception occur:Could not parse mapping document from resource event/Sample.hbm.xml
org.hibernate.InvalidMappingException: Could not parse mapping document from resource event/Sample.hbm.xml
at org.hibernate.cfg.Configuration.addResource(Configuration.java:575)
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1593)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1561)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1540)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1514)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1434)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1420)
at Test.main(Test.java:15)
Caused by: org.hibernate.InvalidMappingException: Could not parse mapping document from invalid mapping
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:508)
at org.hibernate.cfg.Configuration.addResource(Configuration.java:572)
... 7 more
Caused by: org.xml.sax.SAXParseException: 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)*)".
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleEndElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.endElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
at org.dom4j.io.SAXReader.read(SAXReader.java:465)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:505)
... 8 more
Exception in thread "main" java.lang.NullPointerException
at Test.main(Test.java:29) -
Org.hibernate.ObjectNotFoundException: No row with the given
am creating this join from one table to another
with the followin query:
select sale.storeName
from sale sale, storelocation sc
where sale.store_id = sc.store_id
and sale.storeLocId = sc.storeLocId
<many-to-one name="sale" class="com.dao.hibernate.sale" not-null="true">
<column name="store_id" />
<column name="storeLocId" />
</many-to-one>
in my store mapping i have the following:
<composite-id>
<key-property name="store_id" column="store_id" type="integer" />
<key-property name="storeLocId" column="storeLocId" type="string"/>
</composite-id>
I am creating this join from one table to another
with the followin query:
select sale.storeName
from sale sale, storelocation sc
where sale.store_id = sc.store_id
and sale.storeLocId = sc.storeLocId
<many-to-one name="sale" class="com.dao.hibernate.sale" not-null="true">
<column name="store_id" />
<column name="storeLocId" />
</many-to-one>
org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.dao.Store#com.dao.Store@121cc66]
org.hibernate.ObjectNotFoundException.throwIfNull(ObjectNotFoundException.java:27)
org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:128)
org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:161)
org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:87)
org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:889)
org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:857)
org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:266)
org.hibernate.type.EntityType.resolve(EntityType.java:303)
org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:113)
org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:842)
org.hibernate.loader.Loader.doQuery(Loader.java:717)
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
org.hibernate.loader.Loader.doList(Loader.java:2150)
org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)
org.hibernate.loader.Loader.list(Loader.java:2024)
org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:94)
org.hibernate.impl.SessionImpl.list(SessionImpl.java:1550)
org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:298)
org.hibernate.impl.CriteriaImpl$Subcriteria.list(CriteriaImpl.java:143)am creating this join from one table to another
with the followin query:
select sale.storeName
from sale sale, storelocation sc
where sale.store_id = sc.store_id
and sale.storeLocId = sc.storeLocId
<many-to-one name="sale" class="com.dao.hibernate.sale" not-null="true">
<column name="store_id" />
<column name="storeLocId" />
</many-to-one>
in my store mapping i have the following:
<composite-id>
<key-property name="store_id" column="store_id" type="integer" />
<key-property name="storeLocId" column="storeLocId" type="string"/>
</composite-id>
I am creating this join from one table to another
with the followin query:
select sale.storeName
from sale sale, storelocation sc
where sale.store_id = sc.store_id
and sale.storeLocId = sc.storeLocId
<many-to-one name="sale" class="com.dao.hibernate.sale" not-null="true">
<column name="store_id" />
<column name="storeLocId" />
</many-to-one>
org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.dao.Store#com.dao.Store@121cc66]
org.hibernate.ObjectNotFoundException.throwIfNull(ObjectNotFoundException.java:27)
org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:128)
org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:161)
org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:87)
org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:889)
org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:857)
org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:266)
org.hibernate.type.EntityType.resolve(EntityType.java:303)
org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:113)
org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:842)
org.hibernate.loader.Loader.doQuery(Loader.java:717)
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
org.hibernate.loader.Loader.doList(Loader.java:2150)
org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)
org.hibernate.loader.Loader.list(Loader.java:2024)
org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:94)
org.hibernate.impl.SessionImpl.list(SessionImpl.java:1550)
org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:298)
org.hibernate.impl.CriteriaImpl$Subcriteria.list(CriteriaImpl.java:143) -
Org.hibernate.ObjectNotFoundException: No row with the given identifier exi
I am creating this join from one table to another
with the followin query:
select sale.storeName
from sale sale, storelocation sc
where sale.store_id = sc.store_id
and sale.storeLocId = sc.storeLocId
<many-to-one name="sale" class="com.dao.hibernate.sale" not-null="true">
<column name="store_id" />
<column name="storeLocId" />
</many-to-one>
in my store mapping i have the following:
<composite-id>
<key-property name="store_id" column="store_id" type="integer" />
<key-property name="storeLocId" column="storeLocId" type="string"/>
</composite-id>
I am creating this join from one table to another
with the followin query:
select sale.storeName
from sale sale, storelocation sc
where sale.store_id = sc.store_id
and sale.storeLocId = sc.storeLocId
<many-to-one name="sale" class="com.dao.hibernate.sale" not-null="true">
<column name="store_id" />
<column name="storeLocId" />
</many-to-one>
org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.dao.Store#com.dao.Store@121cc66]
org.hibernate.ObjectNotFoundException.throwIfNull(ObjectNotFoundException.java:27)
org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:128)
org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:161)
org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:87)
org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:889)
org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:857)
org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:266)
org.hibernate.type.EntityType.resolve(EntityType.java:303)
org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:113)
org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:842)
org.hibernate.loader.Loader.doQuery(Loader.java:717)
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
org.hibernate.loader.Loader.doList(Loader.java:2150)
org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)
org.hibernate.loader.Loader.list(Loader.java:2024)
org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:94)
org.hibernate.impl.SessionImpl.list(SessionImpl.java:1550)
org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:298)
org.hibernate.impl.CriteriaImpl$Subcriteria.list(CriteriaImpl.java:143)I am creating this join from one table to another
with the followin query:
select sale.storeName
from sale sale, storelocation sc
where sale.store_id = sc.store_id
and sale.storeLocId = sc.storeLocId
<many-to-one name="sale" class="com.dao.hibernate.sale" not-null="true">
<column name="store_id" />
<column name="storeLocId" />
</many-to-one>
in my store mapping i have the following:
<composite-id>
<key-property name="store_id" column="store_id" type="integer" />
<key-property name="storeLocId" column="storeLocId" type="string"/>
</composite-id>
I am creating this join from one table to another
with the followin query:
select sale.storeName
from sale sale, storelocation sc
where sale.store_id = sc.store_id
and sale.storeLocId = sc.storeLocId
<many-to-one name="sale" class="com.dao.hibernate.sale" not-null="true">
<column name="store_id" />
<column name="storeLocId" />
</many-to-one>
org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.dao.Store#com.dao.Store@121cc66]
org.hibernate.ObjectNotFoundException.throwIfNull(ObjectNotFoundException.java:27)
org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:128)
org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:161)
org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:87)
org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:889)
org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:857)
org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:266)
org.hibernate.type.EntityType.resolve(EntityType.java:303)
org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:113)
org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:842)
org.hibernate.loader.Loader.doQuery(Loader.java:717)
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
org.hibernate.loader.Loader.doList(Loader.java:2150)
org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)
org.hibernate.loader.Loader.list(Loader.java:2024)
org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:94)
org.hibernate.impl.SessionImpl.list(SessionImpl.java:1550)
org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:298)
org.hibernate.impl.CriteriaImpl$Subcriteria.list(CriteriaImpl.java:143) -
XSLT-Mapping Exception: Prefix not mapped:
Hi all,
I try to make a mapping using XSLT and get the exception: Prefix not mapped: ns0.
I wrote a simple xslt-script:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns1="http://me.home.com">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="//XIFCollection">
<Start>
<xsl:for-each select="ns1:XIFTest">
<Found>
<xsl:number format="1"/>
</Found>
</xsl:for-each>
</Start>
</xsl:template>
</xsl:stylesheet>
Using this input XML:
<?xml version="1.0" encoding="UTF-8"?>
<XIFCollection >
<ns0:XIFTest xmlns:ns0="http://me.home.com">
<IFControl>
<MeldungsId>1</MeldungsId>
</IFControl>
<XTest>
</XTest>
</ns0:XIFTest>
<ns0:XIFTest xmlns:ns0="http://me.home.com">
<IFControl>
<MeldungsId>2</MeldungsId>
</IFControl>
<XTest>
</XTest>
</ns0:XIFTest>
</XIFCollection>
In XML-Spy I get the following output:
<?xml version="1.0" encoding="UTF-8"?>
<Start xmlns:ns1="http://me.home.com">
<Found>1</Found>
<Found>2</Found>
</Start>
What I expected.
But using XI or the XML-Toolkit XI30xslt I get the exception:
java.lang.Exception: XMLParser: Prefix 'ns0' is not mapped to a namespace.
I tried everything and searched all dokumentation but have no idea.
Anyone with an idea?
ThanksHi,
you need to chage as Udo said
but also the other ns0 one:
check this:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://me.home.com">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="//XIFCollection">
<Start>
<xsl:for-each select="ns0:XIFTest">
<Found>
<xsl:number format="1"/>
</Found>
</xsl:for-each>
</Start>
</xsl:template>
</xsl:stylesheet>
BTW
it works in Stylus Studio now
Regards,
michal -
0GR_VAL_PD KF has not mapped with source in 0Pur_C01 but value comes
HI All
I have problem with 0GR_VAL_PD kf in 0PUR_C01 cube. 0GR_VAL_PD KF has not mapped with source in 0Pur_C01 but in report level, value is coming for purchase organisation,material group .
But GR value as at posting date (0GR_VAL_PD)value not coming for particular material group or purch. org. but some days before, values were coming for particular material group or purch. org..
so need your help.
Thanks n Regards,
Gaurav Sekhri
Edited by: gaurav sekhri on Aug 18, 2010 11:41 AM
Edited by: gaurav sekhri on Aug 18, 2010 11:43 AMHi Susan
Which datasource you are using at present. Normally 0PUR_C01 gets loaded from 2LIS_02_ITM and 2LIS_02_SCL. The keyfigure that you have mentioned will come from 2LIS_02_SCL with the code that you have written.
The code that you have written should work. Please check if the code is in the transformation from 2LIS_02_SCL.
Share the details on why do you think the solution didn't work.
Regards
Karthik -
ParserException: XMLParser: Prefix 'xsl' is not mapped to a namespace
Hi
although I do not think this is an XI problem.. I hope that somebody with more XSLT experience that I might be able to help.
I have a rather simple XSLT that is used to convert an EXCEL XML document into another XML format. The XSL that I have worked when I tested it via standalone SAXON or MSXML transformation.
But using the SAP product it gives me the error Prefix 'xsl' is not mapped to a namespace.
Here is the top part of the XSL
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:sp="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:of="urn:schemas-microsoft-com:office:office">
<xsl:output method = "xml" version="1.0" encoding="ISO-8859-1" omit-xml-declaration="no" standalone="no" indent="yes" />
<xsl:template match="/">
<dvabatch>
<xsl:apply-templates select = "//of:DocumentProperties" />
</dvabatch>
</xsl:template>
.... and so on.....
and the top part of the XML source
<?xml version="1.0"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:html="http://www.w3.org/TR/REC-html40">
<DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
<Author>Peter Munt</Author>
<LastAuthor>muntp</LastAuthor>
<LastPrinted>2006-01-30T23:53:27Z</LastPrinted>
<Created>2003-02-06T18:19:41Z</Created>
<LastSaved>2006-03-01T03:59:11Z</LastSaved>
<Company>DVA</Company>
<Version>10.2625</Version>
</DocumentProperties>
<CustomDocum ....
..... and so on .....Hi Peter,
just for clarification:
You zipped the XSL File and imported it into a Mapping Archive, then assigned the XSL Mapping to an interface mapping and receive the error in the Message Monitoring?
Is that the case?
regards,
Peter -
Prefix is not mapped to a namespace
Hello All:
I have a incoming XML with ns0 name space. I had to anticipate it so I put in the declaration xmlns:ns0 = "http://XXXX-myxml.com" in the xsl:stylesheet.
But when I run this scenario. It throw exception at run time. With below error message
XCE001 Nested exception: com.sap.b1i.bizprocessor.BizProcException: BPE001 Nested exception: com.sap.b1i.utilities.UtilException: UTE001 Nested exception: javax.xml.transform.TransformerConfigurationException: Could not load stylesheet.com.sap.engine.lib.xml.util.NestedException: Could not load XSLWhen. Stylesheet: null, element: <xsl:when xmlns:xsl="http://www.w3.org/1999/XSL/Transform" test="$msg/ns0:PriceList">PriceList</xsl:when> -> com.sap.engine.lib.xml.util.NestedException: Prefix not mapped: ns0 -> java.lang.Exception: XMLParser: Prefix 'ns0' is not mapped to a namespace
Thank You!Hi Bo,
please define all namespaces in the INBOUND Definition (INBOUND-CHANNEL) of your scenario.
This is the only way to replicate the namespaces automatically into all xslt files.
Manual changes within your xslt files will be overwritten.
Best regards
Bastian
P.S.: please reactivate your scenario after changing the INBOUND definition.
Maybe you are looking for
-
I know my server information. I was told that you have to uncheck the box on the server page that says "this server requires ssl" or "secure connection" Problem I can't find where to do this... Any suggestions
-
Verizon Wireless changed my EDGE start date +3 months w/o permission!!
I signed up for the Verizon Wireless EDGE plan back on April 27, 2014 and received my letter of confirmation that I was now enrolled in the program. When I received my very next bill I noticed 2 things: 1) I was charged for my phone, 2) I did not rec
-
Stupid question about import/export
Hi All, i'm banging my head against the wall :) :) i have one database (oracle 10g) , the database is called ORAPD in this database lives a user called WFAT ORAPD -- WFAT now i create 3 another users: WFATG , WFAUTOG, WFPATG Now i want to import all
-
How to choose vendor's second account when MIR7/MIRO ?
Dear All, Here is my question, one vendor has two account , when MIRO/MIR7, SAP default the first vendor account as IR 's default datas, how to change it to the second account which I have added in the vendor? In MIRO/MIR7 there only display the vend
-
Hi experts, Is it possible to get IRT100.pdf soft copy? I request please send if any body have it. [email protected] warm regards marias