-->
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.  [ 21 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Problems with the eclipse plugin XML editor
PostPosted: Mon Apr 24, 2006 11:03 am 
Beginner
Beginner

Joined: Mon Apr 24, 2006 10:42 am
Posts: 23
Hello,

I have installed the Hibernate Eclipse plugin, and I have a strange problem with the auto-complete feature of the XML editor - it sometimes offers auto-complete for class properties and hibernate attribute values, and sometimes it does not.

I know this is not a very concrete problem report, but I have been playing with this for a couple of hours now, and I have not been able to pinpoint the problem any better.

It works part of the time - so I know it's installed and enabled. I also tried running eclipe with -clean (I saw this was suggested in another similar post in this forum). For example, it can work for a certain file once, but not again. I have noticed that the first time I open the file in the editor it will work, but not in subsequent times. If I restart eclipes it seems to work, but again, just for the first time.

I am sorry for this lame problem description, but that the most sense I can make of this issue...

My environment:

- Eclipse 3.1.2
- Hibernate plugin version 3.1.0 beta 2.
- WTP 1.0
- Spring IDE 1.2.5
- Oracle 10g
- Hibernate 3.0.4

Any help will be appreciated.

Ah, and last but not least - apart from this small issue, the plugin is really great. Especially the code and mapping generation.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 24, 2006 3:21 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
if it does not code complete at some place you expect it then show me the xml and put a * or some other mark where you tried to do the code completion.

then i can tell you if it should work or maybe why it does not work.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Thanks - here's an example
PostPosted: Tue Apr 25, 2006 2:15 am 
Beginner
Beginner

Joined: Mon Apr 24, 2006 10:42 am
Posts: 23
In the following XML file I place the cursor on the name of the id field, and also on the type (I inserted a * just to show you where).

When I pressed ctrl+ space, I got the auto-complete. I then closed the file and opened it again in the editor. I tried a second time - and it worked again. I closed the file and opened it a third time - it did not offer me the auto-complete. And it didn't matter even if I tried re-opening the file again and again. I then restarted Eclipse. I opened the file and it worked for the first time. I then closed the file and opened it again - and it didn't work.

The file is in the src folder of my project, and it is exactly as the generator created it. I did not change anything.

Thanks again for your effort. I realise this kind of problems are relatively hard to analyze.

Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated Apr 24, 2006 11:02:41 AM by Hibernate Tools 3.1.0 beta1JBIDERC2 -->
<hibernate-mapping>
    <class name="hibdemo.domain.Customers" table="CUSTOMERS" schema="HIBERNATE">
        <id name="*id" type="*big_decimal">
            <column name="ID" precision="22" scale="0" />
            <generator class="assigned" />
        </id>
        <property name="name" type="string">
            <column name="NAME" length="30" />
        </property>
        <property name="address" type="string">
            <column name="ADDRESS" length="100" />
        </property>
        <set name="orderses" inverse="true">
            <key>
                <column name="CUSTOMER_ID" precision="22" scale="0" not-null="true" />
            </key>
            <one-to-many class="hibdemo.domain.Orders" />
        </set>
    </class>
</hibernate-mapping>


Top
 Profile  
 
 Post subject: And here is the error details...
PostPosted: Tue Apr 25, 2006 3:40 am 
Beginner
Beginner

Joined: Mon Apr 24, 2006 10:42 am
Posts: 23
Error 2006-04-25 11:40:59.359 problem getting model
java.lang.IllegalStateException: problem getting model
at org.eclipse.wst.xml.ui.internal.contentassist.AbstractContentAssistProcessor.computeCompletionProposals(AbstractContentAssistProcessor.java:1258)
at org.eclipse.wst.xml.ui.internal.contentassist.XMLContentAssistProcessor.computeCompletionProposals(XMLContentAssistProcessor.java:101)
at org.hibernate.eclipse.mapper.editors.HibernateContentAssistProcessor.computeCompletionProposals(HibernateContentAssistProcessor.java:74)
at org.eclipse.wst.sse.ui.internal.contentassist.CompoundContentAssistProcessor.computeCompletionProposals(CompoundContentAssistProcessor.java:232)
at org.eclipse.jface.text.contentassist.ContentAssistant.computeCompletionProposals(ContentAssistant.java:1503)
at org.eclipse.jface.text.contentassist.CompletionProposalPopup.computeProposals(CompletionProposalPopup.java:301)
at org.eclipse.jface.text.contentassist.CompletionProposalPopup.access$13(CompletionProposalPopup.java:298)
at org.eclipse.jface.text.contentassist.CompletionProposalPopup$2.run(CompletionProposalPopup.java:261)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
at org.eclipse.jface.text.contentassist.CompletionProposalPopup.showProposals(CompletionProposalPopup.java:256)
at org.eclipse.jface.text.contentassist.ContentAssistant.showPossibleCompletions(ContentAssistant.java:1352)
at org.eclipse.wst.sse.ui.internal.StructuredTextViewer.doOperation(StructuredTextViewer.java:374)
at org.eclipse.ui.texteditor.TextOperationAction$1.run(TextOperationAction.java:122)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
at org.eclipse.ui.texteditor.TextOperationAction.run(TextOperationAction.java:120)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:996)
at org.eclipse.ui.commands.ActionHandler.execute(ActionHandler.java:182)
at org.eclipse.ui.internal.handlers.LegacyHandlerWrapper.execute(LegacyHandlerWrapper.java:108)
at org.eclipse.core.commands.Command.execute(Command.java:311)
at org.eclipse.core.commands.ParameterizedCommand.execute(ParameterizedCommand.java:396)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:459)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:781)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:828)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:550)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:493)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:117)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Display.filterEvent(Display.java:919)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:842)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:867)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:852)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:880)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:876)
at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1190)
at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:3135)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:3038)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:3751)
at org.eclipse.swt.internal.win32.OS.CallWindowProcW(Native Method)
at org.eclipse.swt.internal.win32.OS.CallWindowProc(OS.java:1580)
at org.eclipse.swt.internal.BidiUtil.windowProc(BidiUtil.java:649)
at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1656)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2756)
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)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 25, 2006 1:04 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
hmm ...looks like a wtp bug.

i have just been using the completion extensively during a training and that worked flawlessly....

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: thanks
PostPosted: Thu Apr 27, 2006 1:33 am 
Beginner
Beginner

Joined: Mon Apr 24, 2006 10:42 am
Posts: 23
May I ask what WTP version are you using?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 27, 2006 2:32 am 
Beginner
Beginner

Joined: Mon Apr 24, 2006 10:42 am
Posts: 23
FYI, I have updated my WTP to the latest available from the update-site, and the problem remains.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 27, 2006 4:52 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
don't use wtp 1.5 - use wtp 1.0, the one that comes with the tools should work.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Some progress
PostPosted: Thu May 04, 2006 2:33 am 
Beginner
Beginner

Joined: Mon Apr 24, 2006 10:42 am
Posts: 23
Hi,

The auto-completion for Java class properties works now. I guess updating WTP did the trick. Thanks!

However, database table and column auto-completio still doesn't work.

In the "Hibernate Configurations" view I can see the database schema properly, but I don't get auto-copmletion in the editor. There is not error in the log - I simply get "content assist not available at the current location"...

In the Hibernate tools doc it says:
Quote:
Table and column completion is also available for all table and column attributes.
Note that it requires a proper configured hibernate console configuration and this configuration should be the
default for the project where the hbm.xml resides.

You can check which console configuration is selected under the Properties of a project and look under the "Hibernate
Settings" page. When a proper configuration is selected it will be used to fetch the table/column names
in the background.


However, when I look at my Eclipse project's Properties submenu, there is no "Hibernate Settings" page. What am I missing?

Thanks again for all your help.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 04, 2006 2:38 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
hmm - should just be there.

Can you attach a screenshot of the properties view ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 04, 2006 3:22 am 
Beginner
Beginner

Joined: Mon Apr 24, 2006 10:42 am
Posts: 23
Sure.

How do I include an image to a post?


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 04, 2006 3:47 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
you insert a img tag that point to some url that has the image.[/img]

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 04, 2006 4:00 am 
Beginner
Beginner

Joined: Mon Apr 24, 2006 10:42 am
Posts: 23
Here it is:

Image


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 04, 2006 4:07 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
hmmm...thats weird!

Are you 100% sure you have the correct version installed ?

And try and go look in org.hibernate.eclipse.console-x.x.x/plugin.xml and tell me if you have something like:

<extension
point="org.eclipse.ui.propertyPages">
<page
class="org.hibernate.eclipse.console.properties.HibernatePropertyPage"
id="org.hibernate.eclipse.console.properties.HibernatePropertyPage"
name="Hibernate Settings"
objectClass="org.eclipse.jdt.core.IJavaProject">
</page>
</extension>

in there. This is the extension point that should register a property page on every javaproject.

hmm...maybe you need to force the start of the plugin by going to the hibernate console perspective ? try that too and tell me if it shows up or not.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 04, 2006 4:30 am 
Beginner
Beginner

Joined: Mon Apr 24, 2006 10:42 am
Posts: 23
Here is the relevant section from my plugin-xml file.
I think it is the same as your excerpt.


Code:
<extension
         point="org.eclipse.ui.propertyPages">
      <page
            class="org.hibernate.eclipse.console.properties.HibernatePropertyPage"
            id="org.hibernate.eclipse.console.properties.HibernatePropertyPage"
            name="Hibernate Settings"
            objectClass="org.eclipse.jdt.core.IJavaProject">
             </page>
   </extension>


You can review my eclipse env. in one of the above posts. The only thing changed since then is that I upgraded the Hibernate Tools to beta5, and installed the latest patch of the WTP 1.0 (a small version, maybe even a nightly build...).

I did try to go to the Hibernate Console perspective , but that doesn't help. Neither does restarting eclipse, or creating a brand new project.

Seems I manage to stumble on every possible misfortune with this installation :-)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 21 posts ]  Go to page 1, 2  Next

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.