Trolltech Home | Qt-jambi-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-jambi-interest Archive, August 2006
Eclipse Integration: Eclipse crashes on Show View


Message 1 in thread

Hello all,

I have managed to set up the eclipse integration. I have created my own
project and copied the com/* examples from qtjambi.

First thing: for Linux, please note in the documentation that instead of
setting "PATH", you need to set "LD_LIBRARY_PATH" (the screenshot is
misleading).

Now for the major problem I have, whenever I try to show /any/ Qt Jambi
view, after selecting the view and pressing OK, Eclipse crashes with no
further entries in its log file.

Any ideas?

Tnx,

M


Message 2 in thread

This apparently has to do with the myeclipse plugin. Starting eclipse
w/o MyEclipse, it seems to work.

M

Am Freitag, den 04.08.2006, 11:58 +0200 schrieb Matthias Nott:
> Hello all,
> 
> I have managed to set up the eclipse integration. I have created my
> own
> project and copied the com/* examples from qtjambi.
> 
> First thing: for Linux, please note in the documentation that instead
> of
> setting "PATH", you need to set "LD_LIBRARY_PATH" (the screenshot is
> misleading).
> 
> Now for the major problem I have, whenever I try to show /any/ Qt
> Jambi
> view, after selecting the view and pressing OK, Eclipse crashes with
> no
> further entries in its log file.
> 
> Any ideas?
> 
> Tnx,
> 
> M


Message 3 in thread

Yet even if I start eclipse not using the MyEclipse.sh starter, just the
<eclipse_home>/eclipse startup, it suddenly may crash just unexpectedly:

# An unexpected error has been detected by HotSpot Virtual Machine:
#
#  SIGSEGV (0xb) at pc=0xa67ffd4c, pid=2779, tid=3084768944
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_01-b08 mixed mode, sharing)
# Problematic frame:
# C  [libgobject-2.0.so.0+0x24d4c]  g_type_check_instance_cast+0x2c
#
# An error report file with more information is saved as
hs_err_pid2779.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#

M

Am Freitag, den 04.08.2006, 12:13 +0200 schrieb Matthias Nott:
> This apparently has to do with the myeclipse plugin. Starting eclipse
> w/o MyEclipse, it seems to work.
> 
> M
> 
> Am Freitag, den 04.08.2006, 11:58 +0200 schrieb Matthias Nott:
> > Hello all,
> >
> > I have managed to set up the eclipse integration. I have created my
> > own
> > project and copied the com/* examples from qtjambi.
> >
> > First thing: for Linux, please note in the documentation that
> instead
> > of
> > setting "PATH", you need to set "LD_LIBRARY_PATH" (the screenshot is
> > misleading).
> >
> > Now for the major problem I have, whenever I try to show /any/ Qt
> > Jambi
> > view, after selecting the view and pressing OK, Eclipse crashes with
> > no
> > further entries in its log file.
> >
> > Any ideas?
> >
> > Tnx,
> >
> > M
> 


Message 4 in thread

Hi, again, Matthias.

Matthias Nott wrote:

>Yet even if I start eclipse not using the MyEclipse.sh starter, just the
><eclipse_home>/eclipse startup, it suddenly may crash just unexpectedly:
>[...]
># An error report file with more information is saved as
>hs_err_pid2779.log
>  
>
Would you be able to e-mail me the file hs_err_pid2779.log privately?

Also, which Linux distribution are you using, please?

-- Eskil


Message 5 in thread

OK, I tried again a fair bit, but the eclipse plugin causes eclipse to
fail more consistently than to work. It is actually independent of
myeclipse. Eclipse very consistently crashes when starting up if it
was showing any of the qt views before exiting.

So I removed the plugins and am back to SWT.

Let's wait for the actual release :-)

Tnx all,

M

Am Freitag, den 04.08.2006, 14:42 +0200 schrieb Eskil A. Blomfeldt:
> Hi, again, Matthias.
> 
> Matthias Nott wrote:
> 
> >Yet even if I start eclipse not using the MyEclipse.sh starter, just
> the
> ><eclipse_home>/eclipse startup, it suddenly may crash just
> unexpectedly:
> >[...]
> ># An error report file with more information is saved as
> >hs_err_pid2779.log
> > 
> >
> Would you be able to e-mail me the file hs_err_pid2779.log privately?
> 
> Also, which Linux distribution are you using, please?
> 
> -- Eskil
> 


Message 6 in thread

Hi all,

I have created a basic .ui file and am able to convert that to a java 
class which I can then, after adding a main function and some code, run.
I did the conversion using juic.

Now here is the question: How can I have a round trip development? I
want to continue editing the .ui file and then have a direct link to the
functions in the java class.

I understand from the eclipse integration description on the jambi site
that this should be possible. Yet I do not see how to make the link
between the .ui file and the generated .java file.

Tnx,

M


Message 7 in thread

Hi, Matthias.

Matthias Nott wrote:

>Now here is the question: How can I have a round trip development? I
>want to continue editing the .ui file and then have a direct link to the
>functions in the java class.
>  
>
If you have installed the eclipse integration and have incremental 
building turned on, then juic should be run automatically whenever you 
save the changes to your .ui file. A new .java file will then be 
generated and compiled, reflecting the changes you made to the user 
interface. If juic is not in your PATH, then you will have to set its 
path explicitly in the project settings. Right click on your project in 
the package explorer, select properties, then the Qt Jambi tab and enter 
the full path of juic in the line edit.

-- Eskil


Message 8 in thread

On Friday 4 August 2006 12:59, Matthias Nott wrote:
> I have created a basic .ui file and am able to convert that to a java
> class which I can then, after adding a main function and some code,
> run. I did the conversion using juic.

If I read this correctly you mean you edited the generated java file?
Editing the java should be avoided, its easier to extend and do all your 
things from the extending class.

Before jambe saw the light of day I did a similar thing, while the 
technology is old, the ideas and concepts are still very valid.  I hope 
Qt will not hate me for linking to this, but I do think you will 
appreciate the tips and design in there:
http://uic.sf.net/index.phtml?target=designer/view.html

  "The graphics designer creates the view class (as displayed in the image 
above) by dragging and dropping the widgets. At compile time the visual 
data is converted to an actual java class file.
 The programmer will extend the generated class and be able to add all 
controlling logic needed to attach the view to the model. The programmer 
is also free to adjust things not possible in the designer in this 
controller class.
 Since the controller extends from the GUI building (view) class all 
widgets, models and other things the programmer needs will be available 
as variables."

Cheers!
-- 
 [ signature omitted ] 

Attachment: pgpBxIrTtfUza.pgp
Description: PGP signature


Message 9 in thread

Thomas Zander wrote:

>On Friday 4 August 2006 12:59, Matthias Nott wrote:
>  
>
>>I have created a basic .ui file and am able to convert that to a java
>>class which I can then, after adding a main function and some code,
>>run. I did the conversion using juic.
>>    
>>
>
>If I read this correctly you mean you edited the generated java file?
>Editing the java should be avoided, its easier to extend and do all your 
>things from the extending class.
>  
>

Indeed, any changes you make to the generated .java file will be 
overwritten. We'll see about making this part clearer.

For a suggested pattern of working with .ui files, see the class 
com.trolltech.demos.imageviewer.MainWindow vs. the .ui file 
com/trolltech/demos/imageviewer/MainWindow.ui.

-- Eskil


Message 10 in thread

I don't know whether this is related, but here is a stack trace I keep
getting:

!MESSAGE Path for project must have only one segment.
!STACK 0
java.lang.IllegalArgumentException: Path for project must have only one
segment.
        at org.eclipse.core.runtime.Assert.isLegal(Assert.java:62)
        at
org.eclipse.core.internal.resources.WorkspaceRoot.getProject(WorkspaceRoot.java:164)
        at com.trolltech.qtjambi.JuicBuilder.build(JuicBuilder.java:46)
        at org.eclipse.core.internal.events.BuildManager
$2.run(BuildManager.java:603)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
        at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:167)
        at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
        at org.eclipse.core.internal.events.BuildManager
$1.run(BuildManager.java:230)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
        at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:233)
        at
org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:252)
        at
org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:285)
        at
org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:145)
        at
org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:208)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)




Am Freitag, den 04.08.2006, 12:59 +0200 schrieb Matthias Nott:
> Hi all,
> 
> I have created a basic .ui file and am able to convert that to a java
> class which I can then, after adding a main function and some code,
> run.
> I did the conversion using juic.
> 
> Now here is the question: How can I have a round trip development? I
> want to continue editing the .ui file and then have a direct link to
> the
> functions in the java class.
> 
> I understand from the eclipse integration description on the jambi
> site
> that this should be possible. Yet I do not see how to make the link
> between the .ui file and the generated .java file.
> 
> Tnx,
> 
> M
> 


Message 11 in thread

Well, it seems to be related. Whenever I save a .ui file, I get the
following stack trace:

!ENTRY org.eclipse.core.resources 4 2 2006-08-04 13:38:21.812
!MESSAGE Problems occurred when invoking code from plug-in:
"org.eclipse.core.resources".
!STACK 0
java.lang.IllegalArgumentException: Path for project must have only one
segment.
        at org.eclipse.core.runtime.Assert.isLegal(Assert.java:62)
        at
org.eclipse.core.internal.resources.WorkspaceRoot.getProject(WorkspaceRoot.java:164)
        at com.trolltech.qtjambi.JuicBuilder.build(JuicBuilder.java:46)
        at org.eclipse.core.internal.events.BuildManager
$2.run(BuildManager.java:603)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
        at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:167)
        at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
        at org.eclipse.core.internal.events.BuildManager
$1.run(BuildManager.java:230)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
        at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:233)
        at
org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:252)
        at
org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:285)
        at
org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:145)
        at
org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:208)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)

!ENTRY org.eclipse.core.resources 2 75 2006-08-04 13:38:21.851
!MESSAGE Errors during build.
!SUBENTRY 1 com.trolltech.qtjambi 2 75 2006-08-04 13:38:21.851
!MESSAGE Errors running builder "Juic Builder" on project Tests.
!SUBENTRY 1 com.trolltech.qtjambi 2 75 2006-08-04 13:38:21.852
!MESSAGE Path for project must have only one segment.
!STACK 0
java.lang.IllegalArgumentException: Path for project must have only one
segment.
        at org.eclipse.core.runtime.Assert.isLegal(Assert.java:62)
        at
org.eclipse.core.internal.resources.WorkspaceRoot.getProject(WorkspaceRoot.java:164)
        at com.trolltech.qtjambi.JuicBuilder.build(JuicBuilder.java:46)
        at org.eclipse.core.internal.events.BuildManager
$2.run(BuildManager.java:603)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
        at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:167)
        at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
        at org.eclipse.core.internal.events.BuildManager
$1.run(BuildManager.java:230)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
        at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:233)
        at
org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:252)
        at
org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:285)
        at
org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:145)
        at
org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:208)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)


Message 12 in thread

On a brand new project I do not get this stacktrace. Seems to have to do
with the project itself.

M


Message 13 in thread

Now here is the reason for the stack trace:

I have the following .classpath:

<classpath>
        <classpathentry kind="src" path="src"/>
        <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
        <classpathentry kind="output" path="bin"/>
</classpath>

If I instead do (but i do not want to do that as I do want to have all
my source files under a given src directory), it works:

<classpath>
        <classpathentry kind="src" path=""/>
        <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
        <classpathentry kind="output" path="bin"/>
</classpath>

This seems to be a bug somewhere.

M

Am Freitag, den 04.08.2006, 13:49 +0200 schrieb Matthias Nott:
> On a brand new project I do not get this stacktrace. Seems to have to
> do
> with the project itself.
> 
> M
> 


Message 14 in thread

Hi, Matthias.

Matthias Nott wrote:

>If I instead do (but i do not want to do that as I do want to have all
>my source files under a given src directory), it works:
>
><classpath>
>        <classpathentry kind="src" path=""/>
>        <classpathentry kind="con"
>path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
>        <classpathentry kind="output" path="bin"/>
></classpath>
>
>This seems to be a bug somewhere.
>
>  
>
Yes, there's unfortunately a bug in the integration that prevents the 
JUIC build step from understanding the use of source folders properly. 
In the next release, the juic build step will interpret the build path 
more appropriately. Until then, I am afraid you will have to keep your 
sources directly under the root of the project for the eclipse 
integration to work as it should.

It is still possible to turn off the JUIC builder for your project, and 
do the JUIC step manually whenever you want to compile your application, 
but you will also have to manually tell eclipse to refresh its build 
path when the new files have been generated. This is of course not 
nearly as convenient, so the bug will be fixed ASAP. :-)

-- Eskil


Message 15 in thread

OK I wrote a hot fix. See below. What would really be great was if we
could actually specify the output filename. I don't like Test.ui being
converted to UI_Test.java instead of Test.java.

HTH,

M

public class JuicBuilder extends IncrementalProjectBuilder
{
           //...
 
           //replaced:
            //IProject iproject =
iworkspaceroot.getProject(iclasspathentry.getPath().toString());
            String projectPath     =
iclasspathentry.getPath().toString();
            int     nextSegment     =
projectPath.indexOf(java.io.File.separator, 1);
            String projectRootPath = nextSegment < 0 ? projectPath :
projectPath.substring(0, nextSegment);
            String projectRootPathExtension = nextSegment < 0 ? "" :
projectPath.substring(nextSegment);
            IProject iproject =
iworkspaceroot.getProject(projectRootPath);

            //...

            //replaced:
            //as[2] = ipath.toOSString();
            as[2] = ipath.toOSString() + projectRootPathExtension;

           //...
}

Am Freitag, den 04.08.2006, 14:13 +0200 schrieb Eskil A. Blomfeldt:

> Hi, Matthias.
> 
> Matthias Nott wrote:
> 
> >If I instead do (but i do not want to do that as I do want to have
> all
> >my source files under a given src directory), it works:
> >
> ><classpath>
> >        <classpathentry kind="src" path=""/>
> >        <classpathentry kind="con"
> >path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
> >        <classpathentry kind="output" path="bin"/>
> ></classpath>
> >
> >This seems to be a bug somewhere.
> >
> > 
> >
> Yes, there's unfortunately a bug in the integration that prevents the
> JUIC build step from understanding the use of source folders properly.
> In the next release, the juic build step will interpret the build path
> more appropriately. Until then, I am afraid you will have to keep your
> sources directly under the root of the project for the eclipse
> integration to work as it should.
> 
> It is still possible to turn off the JUIC builder for your project,
> and
> do the JUIC step manually whenever you want to compile your
> application,
> but you will also have to manually tell eclipse to refresh its build
> path when the new files have been generated. This is of course not
> nearly as convenient, so the bug will be fixed ASAP. :-)
> 
> -- Eskil
> 
> 

-- 
 [ signature omitted ]