Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Dali » It works, but does not compile (only half a joke!)
It works, but does not compile (only half a joke!) [message #434579] Fri, 07 September 2007 21:17 Go to next message
Richard Gomes is currently offline Richard GomesFriend
Messages: 13
Registered: July 2009
Junior Member
Hi Chaps,

I was able to manage a simple test project to use toplink and postgresql.
It's getting data from database and seems to work fine.

To be honest, the project compiles, otherwise the binary code would never
work! The problem seems to be Dali is not able to access properly the
database and reports a weird error on the imports. The error is:

Schema "test" cannot be resolved for table "Holiday"

and occours around the end of the second line below and beginning of third
line.

import javax.persistence.Embeddable;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;

I've deleted my orm.xml (I use annotations) and my persistence.xml is:

<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0">
<persistence-unit name="test" transaction-type="RESOURCE_LOCAL">
<provider> oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvi der
</provider>
<class>com.jaacoo.tguide.model.dao.Holiday</class>
<class>com.jaacoo.tguide.model.dao.House</class>
<class>com.jaacoo.tguide.model.dao.QuoteDay</class>
<class>com.jaacoo.tguide.model.dao.StockOption</class>
<class>com.jaacoo.tguide.model.dao.Symbol</class>
<class>com.jaacoo.tguide.model.dao.TickNasdaq</class>
<properties>
<property name="toplink.jdbc.driver"
value="org.postgresql.Driver"/>
<property name="toplink.jdbc.url"
value="jdbc:postgresql://localhost:5432/test"/>
<property name="toplink.jdbc.user" value="test"/>
<property name="toplink.jdbc.password" value="test"/>
<property name="toplink.logging.level" value="SEVERE"/>
</properties>
</persistence-unit>
</persistence>




I've already tried to put toplink-essentials-agent.jar in the CLASSPATH and
also in the command line when calling Eclipse. I've tried this:

export
CLASSPATH=/opt/JavaIDE/glassfish-persistence/toplink-essenti als-agent.jar:/opt/JavaIDE/glassfish-persistence/toplink-ess entials.jar
/opt/JavaIDE/eclipse3.3-amd64/eclipse -vm /opt/JavaIDE/jdk1.5.0_12-amd64/jre/bin/java

and also this:

/opt/JavaIDE/eclipse3.3-amd64/eclipse -vm /opt/JavaIDE/jdk1.5.0_12-amd64/jre/bin/java -cp /opt/JavaIDE/glassfish-persistence/toplink-essentials-agent. jar:/opt/JavaIDE/glassfish-persistence/toplink-essentials.ja r

and also this:

/opt/JavaIDE/eclipse3.3-amd64/eclipse -vm /opt/JavaIDE/jdk1.5.0_12-amd64/jre/bin/java -javaagent:/opt/JavaIDE/glassfish-persistence/toplink-essent ials-agent.jar

and also this:

export CLASSPATH=/opt/JavaIDE/glassfish-persistence/toplink-essenti als.jar
/opt/JavaIDE/eclipse3.3-amd64/eclipse -vm /opt/JavaIDE/jdk1.5.0_12-amd64/jre/bin/java -javaagent:/opt/JavaIDE/glassfish-persistence/toplink-essent ials-agent.jar


Any idea?

Thank you in advance

--
Richard Gomes
Re: It works, but does not compile (only half a joke!) [message #434580 is a reply to message #434579] Fri, 07 September 2007 21:28 Go to previous messageGo to next message
Richard Gomes is currently offline Richard GomesFriend
Messages: 13
Registered: July 2009
Junior Member
Richard Gomes wrote:

> Hi Chaps,
>
> I was able to manage a simple test project to use toplink and postgresql.
> It's getting data from database and seems to work fine.
>
> To be honest, the project compiles, otherwise the binary code would never
> work! The problem seems to be Dali is not able to access properly the
> database and reports a weird error on the imports. The error is:
>
> Schema "test" cannot be resolved for table "Holiday"
>
> and occours around the end of the second line below and beginning of third
> line.
>
> import javax.persistence.Embeddable;
> import javax.persistence.EmbeddedId;
> import javax.persistence.Entity;
>
> I've deleted my orm.xml (I use annotations) and my persistence.xml is:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0">
> <persistence-unit name="test" transaction-type="RESOURCE_LOCAL">
> <provider> oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvi der
> </provider>
> <class>com.jaacoo.tguide.model.dao.Holiday</class>
> <class>com.jaacoo.tguide.model.dao.House</class>
> <class>com.jaacoo.tguide.model.dao.QuoteDay</class>
> <class>com.jaacoo.tguide.model.dao.StockOption</class>
> <class>com.jaacoo.tguide.model.dao.Symbol</class>
> <class>com.jaacoo.tguide.model.dao.TickNasdaq</class>
> <properties>
> <property name="toplink.jdbc.driver"
> value="org.postgresql.Driver"/>
> <property name="toplink.jdbc.url"
> value="jdbc:postgresql://localhost:5432/test"/>
> <property name="toplink.jdbc.user" value="test"/>
> <property name="toplink.jdbc.password" value="test"/>
> <property name="toplink.logging.level" value="SEVERE"/>
> </properties>
> </persistence-unit>
> </persistence>
>
>
>
>
> I've already tried to put toplink-essentials-agent.jar in the CLASSPATH
> and also in the command line when calling Eclipse. I've tried this:
>
> export
>
CLASSPATH=/opt/JavaIDE/glassfish-persistence/toplink-essenti als-agent.jar:/opt/JavaIDE/glassfish-persistence/toplink-ess entials.jar
> /opt/JavaIDE/eclipse3.3-amd64/eclipse -vm
> /opt/JavaIDE/jdk1.5.0_12-amd64/jre/bin/java
>
> and also this:
>
> /opt/JavaIDE/eclipse3.3-amd64/eclipse -vm
> /opt/JavaIDE/jdk1.5.0_12-amd64/jre/bin/java -cp
> /opt/JavaIDE/glassfish-persistence/toplink-essentials-agent. jar:/opt/JavaIDE/glassfish-persistence/toplink-essentials.ja r
>
> and also this:
>
> /opt/JavaIDE/eclipse3.3-amd64/eclipse -vm
> /opt/JavaIDE/jdk1.5.0_12-amd64/jre/bin/java
> -javaagent:/opt/JavaIDE/glassfish-persistence/toplink-essent ials-agent.jar
>
> and also this:
>
> export CLASSPATH=/opt/JavaIDE/glassfish-persistence/toplink-essenti als.jar
> /opt/JavaIDE/eclipse3.3-amd64/eclipse -vm
> /opt/JavaIDE/jdk1.5.0_12-amd64/jre/bin/java
> -javaagent:/opt/JavaIDE/glassfish-persistence/toplink-essent ials-agent.jar
>
>
> Any idea?
>
> Thank you in advance
>

oh... I realized that I need to provide more information:

This is a quite simple J2SE application. This is the code:

package com.jaacoo.tguide.model.test;

import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.EntityTransaction;
import javax.persistence.Persistence;

import com.jaacoo.tguide.model.dao.Holiday;

public class Hello {

public static void main(String[] args) {
// Start EntityManagerFactory
EntityManagerFactory emf =
Persistence.createEntityManagerFactory("trader");
// Second unit of work
EntityManager entityManager = emf.createEntityManager();
EntityTransaction transaction = entityManager.getTransaction();
transaction.begin();
List list = entityManager
.createQuery("select h from Holiday h")
.getResultList(); // order by h.house,h.yyyymmdd asc
System.out.println( list.size() + " holiday(s) found" );
for (Object h : list) {
Holiday holiday = (Holiday) h;
System.out.println(holiday.getPk().getYyyymmdd());
}
transaction.commit();
entityManager.close();
// Shutting down the application
emf.close();
}

}


Thanks again

--
Richard Gomes
Re: It works, but does not compile (only half a joke!) [message #434583 is a reply to message #434580] Mon, 10 September 2007 19:46 Go to previous messageGo to next message
Neil Hauge is currently offline Neil HaugeFriend
Messages: 475
Registered: July 2009
Senior Member
Richard,

I believe you have run into Dali bug 193879. This bug caused problems
resolving DB metadata on PostgreSQL. This bug is fixed in the maintenance
branch, so you could take an early look at the current WTP 2.0.1 RC's.
The 2.0.1 release should be available on the 28th of September. The RC's
are available now for testing.

http://download.eclipse.org/webtools/downloads/

Hope this helps,
Neil
Re: It works, but does not compile (only half a joke!) [message #434586 is a reply to message #434583] Mon, 10 September 2007 20:09 Go to previous messageGo to next message
Richard Gomes is currently offline Richard GomesFriend
Messages: 13
Registered: July 2009
Junior Member
Neil Hauge wrote:

> Richard,
>
> I believe you have run into Dali bug 193879. This bug caused problems
> resolving DB metadata on PostgreSQL. This bug is fixed in the maintenance
> branch, so you could take an early look at the current WTP 2.0.1 RC's.
> The 2.0.1 release should be available on the 28th of September. The RC's
> are available now for testing.
>
> http://download.eclipse.org/webtools/downloads/
>
> Hope this helps,
> Neil

I'll give it a try!

Thanks a lot :)

--
Richard Gomes
Re: It works, but does not compile (only half a joke!) [message #434587 is a reply to message #434583] Mon, 10 September 2007 23:05 Go to previous messageGo to next message
Richard Gomes is currently offline Richard GomesFriend
Messages: 13
Registered: July 2009
Junior Member
Neil Hauge wrote:

> Richard,
>
> I believe you have run into Dali bug 193879. This bug caused problems
> resolving DB metadata on PostgreSQL. This bug is fixed in the maintenance
> branch, so you could take an early look at the current WTP 2.0.1 RC's.
> The 2.0.1 release should be available on the 28th of September. The RC's
> are available now for testing.
>
> http://download.eclipse.org/webtools/downloads/
>
> Hope this helps,
> Neil


Hi Neil,

Yes, after I upgraded ...Enablement for PostgreSQL, the errors dissapeared.
Thanks a lot!

But JPA perspective is not working anymore.

How can I download (may a complete?) installation with Dali and this
upgrade? Is it available?

Kind Regards

--
Richard Gomes
Re: It works, but does not compile (only half a joke!) [message #434588 is a reply to message #434587] Tue, 11 September 2007 00:14 Go to previous message
Richard Gomes is currently offline Richard GomesFriend
Messages: 13
Registered: July 2009
Junior Member
Hi Neil,

I think I found.
http://download.eclipse.org/webtools/downloads/drops/R2.0/M- 2.0.1RC1-20070907070540/

Kind Regards

-- Richard

Richard Gomes wrote:

> Neil Hauge wrote:
>
>> Richard,
>>
>> I believe you have run into Dali bug 193879. This bug caused problems
>> resolving DB metadata on PostgreSQL. This bug is fixed in the
>> maintenance branch, so you could take an early look at the current WTP
>> 2.0.1 RC's.
>> The 2.0.1 release should be available on the 28th of September. The RC's
>> are available now for testing.
>>
>> http://download.eclipse.org/webtools/downloads/
>>
>> Hope this helps,
>> Neil
>
>
> Hi Neil,
>
> Yes, after I upgraded ...Enablement for PostgreSQL, the errors
> dissapeared. Thanks a lot!
>
> But JPA perspective is not working anymore.
>
> How can I download (may a complete?) installation with Dali and this
> upgrade? Is it available?
>
> Kind Regards
>
Re: It works, but does not compile (only half a joke!) [message #605524 is a reply to message #434579] Fri, 07 September 2007 21:28 Go to previous message
Richard Gomes is currently offline Richard GomesFriend
Messages: 15
Registered: June 2010
Junior Member
Richard Gomes wrote:

> Hi Chaps,
>
> I was able to manage a simple test project to use toplink and postgresql.
> It's getting data from database and seems to work fine.
>
> To be honest, the project compiles, otherwise the binary code would never
> work! The problem seems to be Dali is not able to access properly the
> database and reports a weird error on the imports. The error is:
>
> Schema "test" cannot be resolved for table "Holiday"
>
> and occours around the end of the second line below and beginning of third
> line.
>
> import javax.persistence.Embeddable;
> import javax.persistence.EmbeddedId;
> import javax.persistence.Entity;
>
> I've deleted my orm.xml (I use annotations) and my persistence.xml is:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0">
> <persistence-unit name="test" transaction-type="RESOURCE_LOCAL">
> <provider> oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvi der
> </provider>
> <class>com.jaacoo.tguide.model.dao.Holiday</class>
> <class>com.jaacoo.tguide.model.dao.House</class>
> <class>com.jaacoo.tguide.model.dao.QuoteDay</class>
> <class>com.jaacoo.tguide.model.dao.StockOption</class>
> <class>com.jaacoo.tguide.model.dao.Symbol</class>
> <class>com.jaacoo.tguide.model.dao.TickNasdaq</class>
> <properties>
> <property name="toplink.jdbc.driver"
> value="org.postgresql.Driver"/>
> <property name="toplink.jdbc.url"
> value="jdbc:postgresql://localhost:5432/test"/>
> <property name="toplink.jdbc.user" value="test"/>
> <property name="toplink.jdbc.password" value="test"/>
> <property name="toplink.logging.level" value="SEVERE"/>
> </properties>
> </persistence-unit>
> </persistence>
>
>
>
>
> I've already tried to put toplink-essentials-agent.jar in the CLASSPATH
> and also in the command line when calling Eclipse. I've tried this:
>
> export
>
CLASSPATH=/opt/JavaIDE/glassfish-persistence/toplink-essenti als-agent.jar:/opt/JavaIDE/glassfish-persistence/toplink-ess entials.jar
> /opt/JavaIDE/eclipse3.3-amd64/eclipse -vm
> /opt/JavaIDE/jdk1.5.0_12-amd64/jre/bin/java
>
> and also this:
>
> /opt/JavaIDE/eclipse3.3-amd64/eclipse -vm
> /opt/JavaIDE/jdk1.5.0_12-amd64/jre/bin/java -cp
> /opt/JavaIDE/glassfish-persistence/toplink-essentials-agent. jar:/opt/JavaIDE/glassfish-persistence/toplink-essentials.ja r
>
> and also this:
>
> /opt/JavaIDE/eclipse3.3-amd64/eclipse -vm
> /opt/JavaIDE/jdk1.5.0_12-amd64/jre/bin/java
> -javaagent:/opt/JavaIDE/glassfish-persistence/toplink-essent ials-agent.jar
>
> and also this:
>
> export CLASSPATH=/opt/JavaIDE/glassfish-persistence/toplink-essenti als.jar
> /opt/JavaIDE/eclipse3.3-amd64/eclipse -vm
> /opt/JavaIDE/jdk1.5.0_12-amd64/jre/bin/java
> -javaagent:/opt/JavaIDE/glassfish-persistence/toplink-essent ials-agent.jar
>
>
> Any idea?
>
> Thank you in advance
>

oh... I realized that I need to provide more information:

This is a quite simple J2SE application. This is the code:

package com.jaacoo.tguide.model.test;

import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.EntityTransaction;
import javax.persistence.Persistence;

import com.jaacoo.tguide.model.dao.Holiday;

public class Hello {

public static void main(String[] args) {
// Start EntityManagerFactory
EntityManagerFactory emf =
Persistence.createEntityManagerFactory("trader");
// Second unit of work
EntityManager entityManager = emf.createEntityManager();
EntityTransaction transaction = entityManager.getTransaction();
transaction.begin();
List list = entityManager
.createQuery("select h from Holiday h")
.getResultList(); // order by h.house,h.yyyymmdd asc
System.out.println( list.size() + " holiday(s) found" );
for (Object h : list) {
Holiday holiday = (Holiday) h;
System.out.println(holiday.getPk().getYyyymmdd());
}
transaction.commit();
entityManager.close();
// Shutting down the application
emf.close();
}

}


Thanks again

--
Richard Gomes
Re: It works, but does not compile (only half a joke!) [message #605532 is a reply to message #434580] Mon, 10 September 2007 19:46 Go to previous message
Neil Hauge is currently offline Neil HaugeFriend
Messages: 475
Registered: July 2009
Senior Member
Richard,

I believe you have run into Dali bug 193879. This bug caused problems
resolving DB metadata on PostgreSQL. This bug is fixed in the maintenance
branch, so you could take an early look at the current WTP 2.0.1 RC's.
The 2.0.1 release should be available on the 28th of September. The RC's
are available now for testing.

http://download.eclipse.org/webtools/downloads/

Hope this helps,
Neil
Re: It works, but does not compile (only half a joke!) [message #606085 is a reply to message #434583] Mon, 10 September 2007 20:09 Go to previous message
Richard Gomes is currently offline Richard GomesFriend
Messages: 15
Registered: June 2010
Junior Member
Neil Hauge wrote:

> Richard,
>
> I believe you have run into Dali bug 193879. This bug caused problems
> resolving DB metadata on PostgreSQL. This bug is fixed in the maintenance
> branch, so you could take an early look at the current WTP 2.0.1 RC's.
> The 2.0.1 release should be available on the 28th of September. The RC's
> are available now for testing.
>
> http://download.eclipse.org/webtools/downloads/
>
> Hope this helps,
> Neil

I'll give it a try!

Thanks a lot :)

--
Richard Gomes
Re: It works, but does not compile (only half a joke!) [message #606086 is a reply to message #434583] Mon, 10 September 2007 23:05 Go to previous message
Richard Gomes is currently offline Richard GomesFriend
Messages: 15
Registered: June 2010
Junior Member
Neil Hauge wrote:

> Richard,
>
> I believe you have run into Dali bug 193879. This bug caused problems
> resolving DB metadata on PostgreSQL. This bug is fixed in the maintenance
> branch, so you could take an early look at the current WTP 2.0.1 RC's.
> The 2.0.1 release should be available on the 28th of September. The RC's
> are available now for testing.
>
> http://download.eclipse.org/webtools/downloads/
>
> Hope this helps,
> Neil


Hi Neil,

Yes, after I upgraded ...Enablement for PostgreSQL, the errors dissapeared.
Thanks a lot!

But JPA perspective is not working anymore.

How can I download (may a complete?) installation with Dali and this
upgrade? Is it available?

Kind Regards

--
Richard Gomes
Re: It works, but does not compile (only half a joke!) [message #606090 is a reply to message #434587] Tue, 11 September 2007 00:14 Go to previous message
Richard Gomes is currently offline Richard GomesFriend
Messages: 15
Registered: June 2010
Junior Member
Hi Neil,

I think I found.
http://download.eclipse.org/webtools/downloads/drops/R2.0/M- 2.0.1RC1-20070907070540/

Kind Regards

-- Richard

Richard Gomes wrote:

> Neil Hauge wrote:
>
>> Richard,
>>
>> I believe you have run into Dali bug 193879. This bug caused problems
>> resolving DB metadata on PostgreSQL. This bug is fixed in the
>> maintenance branch, so you could take an early look at the current WTP
>> 2.0.1 RC's.
>> The 2.0.1 release should be available on the 28th of September. The RC's
>> are available now for testing.
>>
>> http://download.eclipse.org/webtools/downloads/
>>
>> Hope this helps,
>> Neil
>
>
> Hi Neil,
>
> Yes, after I upgraded ...Enablement for PostgreSQL, the errors
> dissapeared. Thanks a lot!
>
> But JPA perspective is not working anymore.
>
> How can I download (may a complete?) installation with Dali and this
> upgrade? Is it available?
>
> Kind Regards
>
Previous Topic:can't add java persistence to java project
Next Topic:NPE Generating Entity
Goto Forum:
  


Current Time: Fri Apr 19 21:29:46 GMT 2024

Powered by FUDForum. Page generated in 0.04079 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top