-->
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.  [ 14 posts ] 
Author Message
 Post subject: Problem in artifact generation
PostPosted: Sun Aug 28, 2005 3:15 am 
Newbie

Joined: Sun Aug 28, 2005 3:06 am
Posts: 9
I've downloaded eclipse sdk 3.1 and installed hibernate tools 3.1.0.alpha5. I've done exactly everthing shown in the demo. Im trying to generate hibernate artificats for an oracle db.

Steps:
1. Created the Hibernate Configuration File
2. Created Console Configuration File

3. Tried to Generate Hibernate Artifacts.

I dont get any erros, its just that there are no artificats created, just another file called GeneralHbmSetting.xml

What am i doing wrong? I'll be very grateful if you could guide me with this.

Also the HQL interface is not working for me, which is the main reason for downloading hibernate-tools.

HELP ME!

Regards,
Wasif


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 28, 2005 4:29 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
does your hibernate.cfg.xml that you used for the console config contain a jdbc url to a database on which you have permissions to read the jdbc metadata ?

Does the hql querying not work on your existing mappings ?

check the error log ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 28, 2005 5:41 am 
Newbie

Joined: Sun Aug 28, 2005 3:06 am
Posts: 9
Thanx a lot for the quick reply.


the answer to both of your queries is yes.

I initially used middlegen for this purpose(for artifact generation). The only problem is that it doenst have an HQL interface to verify HQL before deployment.

i have also tried using another plugin name "SQLExplorer" for eclipse, it works and generates the artifacts, also does well with SQL, but doesnt work for HQL.

And i repeat...i havent found a single error, just no artifacts.

Your help would be highly appreciated by me and my team.

Regards,
Wasif


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 28, 2005 5:43 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
have you tried using the ant tasks and add a log4j.properties in your classpath so it will log out what it does ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 28, 2005 5:47 am 
Newbie

Joined: Sun Aug 28, 2005 3:06 am
Posts: 9
One last thing max.

I cant get Hibernate-tools hql interface to even work with already generated files.

Can you guide me how to get any thing of the sort of hibern8ide or hibernateconsole working for my immediate needs?

Thanx


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 28, 2005 5:55 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
just as in the docs

Create a new console configuration
add your already existing hibernate.cfg.xml and/or hibernate.properties and/or mapping files (remember: if the mapping files are already in hibernate.cfg.xml then no need to add them explicitly here)

setup your classpath - here your jdbc driver AND pojo/mapping-resources should be available

click finish and go to the hibernate console perspective.

btw. if you find out what is wrong please let me know that it should only generate "nothing" if there really is "nothing" in the db OR report an error.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 28, 2005 7:22 am 
Newbie

Joined: Sun Aug 28, 2005 3:06 am
Posts: 9
Finally, an error.

On the Hibernate Console, I got this error in the error log. Can you help me with this? I am also attaching contents of my hibernate config file.



-------------start of hibernate config -----------------------------

<?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 name="hibernateFactory">
<property name="hibernate.cglib.use_reflection_optimizer">true</property>
<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.connection.password">docdbuser</property>
<property name="hibernate.connection.url">jdbc:oracle:thin:@192.168.0.243:1521:qasid</property>
<property name="hibernate.connection.username">docdbuser</property>
<property name="hibernate.default_schema">docdbuser</property>
<property name="hibernate.dialect">org.hibernate.dialect.OracleDialect</property>
</session-factory>
</hibernate-configuration>

-------------end of hibernate config -------------------------------










Error 2005-08-28 16:13:34.605 unexpected end of subtree
<AST>:0:0: unexpected end of subtree
at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:2913)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:676)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:532)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:269)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:217)
at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:214)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:154)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:101)
at org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:470)
at org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1025)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:975)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
at org.hibernate.console.HQLQueryPage.getList(HQLQueryPage.java:30)
at org.hibernate.eclipse.console.views.QueryPageViewer$ContentProviderImpl.getElements(QueryPageViewer.java:80)
at org.eclipse.jface.viewers.StructuredViewer.getRawChildren(StructuredViewer.java:848)
at org.eclipse.jface.viewers.TableViewer.getRawChildren(TableViewer.java:1086)
at org.eclipse.jface.viewers.StructuredViewer.getFilteredChildren(StructuredViewer.java:790)
at org.eclipse.jface.viewers.StructuredViewer.getSortedChildren(StructuredViewer.java:905)
at org.eclipse.jface.viewers.TableViewer.internalRefreshAll(TableViewer.java:798)
at org.eclipse.jface.viewers.TableViewer.internalRefresh(TableViewer.java:748)
at org.eclipse.jface.viewers.TableViewer.internalRefresh(TableViewer.java:737)
at org.eclipse.jface.viewers.StructuredViewer$7.run(StructuredViewer.java:1264)
at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1201)
at org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:1262)
at org.eclipse.jface.viewers.StructuredViewer.refresh(StructuredViewer.java:1221)
at org.eclipse.jface.viewers.TableViewer.inputChanged(TableViewer.java:698)
at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:248)
at org.eclipse.jface.viewers.StructuredViewer.setInput(StructuredViewer.java:1417)
at org.hibernate.eclipse.console.views.QueryPageViewer.createTable(QueryPageViewer.java:174)
at org.hibernate.eclipse.console.views.QueryPageViewer.createControl(QueryPageViewer.java:153)
at org.hibernate.eclipse.console.views.QueryPageViewer.<init>(QueryPageViewer.java:111)
at org.hibernate.eclipse.console.views.QueryPageTabView.rebuild(QueryPageTabView.java:87)
at org.hibernate.eclipse.console.views.QueryPageTabView$1.contentsChanged(QueryPageTabView.java:57)
at org.hibernate.eclipse.console.views.QueryPageTabView$1.intervalAdded(QueryPageTabView.java:61)
at javax.swing.AbstractListModel.fireIntervalAdded(Unknown Source)
at org.hibernate.console.QueryPageModel.add(QueryPageModel.java:50)
at org.hibernate.console.KnownConfigurations$4.queryPageCreated(KnownConfigurations.java:71)
at org.hibernate.console.ConsoleConfiguration.fireQueryPageCreated(ConsoleConfiguration.java:255)
at org.hibernate.console.ConsoleConfiguration.access$300(ConsoleConfiguration.java:33)
at org.hibernate.console.ConsoleConfiguration$3.execute(ConsoleConfiguration.java:235)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35)
at org.hibernate.console.ConsoleConfiguration.executeHQLQuery(ConsoleConfiguration.java:227)
at org.hibernate.eclipse.console.views.KnownConfigurationsView$3.run(KnownConfigurationsView.java:175)
at org.hibernate.eclipse.console.views.KnownConfigurationsView$1.doubleClick(KnownConfigurationsView.java:116)
at org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredViewer.java:720)
at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:1044)
at org.eclipse.core.runtime.Platform.run(Platform.java:783)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:44)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:148)
at org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(StructuredViewer.java:718)
at org.eclipse.jface.viewers.StructuredViewer.handleDoubleSelect(StructuredViewer.java:950)
at org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(StructuredViewer.java:1057)
at org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEvent(OpenStrategy.java:219)
at org.eclipse.jface.util.OpenStrategy.access$0(OpenStrategy.java:216)
at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:275)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3080)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2713)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334)
at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
at org.eclipse.core.launcher.Main.run(Main.java:973)
at org.eclipse.core.launcher.Main.main(Main.java:948)

[/img]


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 28, 2005 7:25 am 
Newbie

Joined: Sun Aug 28, 2005 3:06 am
Posts: 9
This error only occurs if i try to create the session factory on the Hibernate console.

I hope this helps.

Now the only thing left is an image of my console configuration. would you like me to send you that as well?

Thanx for your continued support.

Regards,
Wasif


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 28, 2005 11:10 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
the error seems to just be the bug we have when you doubleclick a sessionfactory as its the error you would get if you entered a empty query.

What happens when you browse the configuration in the hibernate console perspective ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 28, 2005 3:24 pm 
Newbie

Joined: Sun Aug 28, 2005 3:06 am
Posts: 9
Everything else is all blank. When you try to browse the db, it pulls up the pending icon as if its doing something and then it goes blank and nothing happens. The error that i quoted in my last email is the only error that i am getting here and it seems that it doesnt explain much.

What should be the next step from here?

Also is it possible to have a downloadable copy of a better version of hibernate tools? or even better if we can have a copy of eclipse SDK with hibernate tools perfectly plugged in.

I know this sounds crazy, but i have done each and everything written in the docs. Please help me with this. If i could get this to work, it would certainly accelerate my development efforts.

If all of this is not possible may be you can guide me how to get hibernate console to work standalone.

Regards,
Wasif


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 28, 2005 4:09 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
you seem to have the plugin installed perfectly, but for some reason nothing is found in the configuraiton.

But did you not say you had an alread existing hibernate.cfg.xml and mapping files ? What happens when you use that in the configuration ?

btw. if you have specified default catalog/schema then on oracle that stuff is case sensitive when doing reverse engineering.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 28, 2005 4:54 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
<property name="hibernate.default_schema">docdbuser</property>

should probably be

<property name="hibernate.default_schema">DOCDBUSER</property>

if you are using oracle.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Problem with reveng.xml file
PostPosted: Mon Aug 29, 2005 3:49 am 
Newbie

Joined: Sun Aug 28, 2005 3:06 am
Posts: 9
Thanx a lot max,

Your last post really did solve a lot of problems,


The only problem left is the reveng file that i was using all along is not working with alpha5. I am posting it here hoping that your can help me with this as well.

-------------------error------------------------------------------

org.hibernate.MappingException:Could not configure overrides from file: C:\working\inventory\src\hibernate.reveng.xml
-------------------error------------------------------------------

---------------------hibernate.reveng.xml--------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-reverse-engineering PUBLIC "-//Hibernate/Hibernate Reverse Engineering DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd" >

<hibernate-reverse-engineering>

<type-mapping>
<sql-type jdbc-type="INTEGER" hibernate-type="java.lang.Integer" />
<sql-type jdbc-type="DOUBLE" hibernate-type="java.lang.Double" />
<sql-type jdbc-type="VARCHAR" length='1' hibernate-type="true_false" />
<sql-type jdbc-type="VARCHAR2" hibernate-type="java.lang.String" />
</type-mapping>
<table-filter match-name="INV_*" exclude="false" />

</hibernate-reverse-engineering>

---------------------hibernate.reveng.xml--------------------------





I am sure others might have experienced the same problems in artifiact generation. Please help me if you can.


Regards,

Wasif.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 29, 2005 3:51 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
there should be some explanation in the stacktrace about this one.

my guess is that length='1' should be length="1" and that should also break on alpha4 ;)

_________________
Max
Don't forget to rate


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

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.