Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Error: Schema "MARCOS" cannot be resolved for table "GE_FUNCIONARIOS"
Error: Schema "MARCOS" cannot be resolved for table "GE_FUNCIONARIOS" [message #194193] Fri, 08 June 2007 12:43 Go to next message
Marcos is currently offline Marcos
Messages: 68
Registered: July 2009
Member
- Eclipse 3.3RC2 (Build id: I20070525-1350)
- WTP 2.0RC2 (complete)
- Java 5 Update 11
- JBoss 4.2.0GA

Hello, everybody!
I'm getting the following error at design time in an EJB 3.0 project:

Schema "MARCOS" cannot be resolved for table "GE_FUNCIONARIOS"

===========================================================

This table, GE_FUNCIONARIOS, exists in my database. This is the content of
my
persistence.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="laboratorio-informatica">
<provider>org.hibernate.ejb.HibernatePersistence</provider >
<jta-data-source>java:/LaboratorioInformaticaDS</jta-data-source >
<class>br.urca.www.laboratorioinformatica.entidade.Funcionario </class>
<!-- other classes -->
<properties>
<property name="hibernate.dialect"
value="org.hibernate.dialect.HSQLDialect" />
<property name="hibernate.hbm2ddl.auto" value="create-drop" />
</properties>
</persistence-unit>
</persistence>

===========================================================

And this is the configuration of the datasource referenced in the element
<jta-data-source> in the file
C:\jboss-4.2.0.GA\server\default\deploy\laboratorio-informat ica-ds.xml:

<?xml version="1.0" encoding="UTF-8"?>

<!-- $Id: mssql-ds.xml 61002 2007-02-28 16:13:00Z weston.price@jboss.com $
-->

<datasources>
<local-tx-datasource>
<jndi-name>LaboratorioInformaticaDS</jndi-name>

<connection-url>jdbc:sqlserver://SERVDEG;databaseName=DBTESEUS</connection-url>

<driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class >
<user-name>MARCOS</user-name>
<password><!-- there's a valid password here --></password>

<!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml
(optional) -->
<metadata>
<type-mapping>MS SQLSERVER2000</type-mapping>
</metadata>
</local-tx-datasource>

</datasources>

This datasource configuration is valid as the server doesn't report any
problem
about it when it is started.

===========================================================

This is my mapped class:

package br.urca.www.laboratorioinformatica.entidade;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name = "GE_FUNCIONARIOS") // Error message is here
public class Funcionario
{
private String fMatricula;

@Id
@Column(name = "MATRICULA")
public String getMatricula()
{
return fMatricula;
}

public void setMatricula(String matricula)
{
fMatricula = matricula;
}
}

===========================================================

So, I would like to know what I'm doing wrong to get this error and how
I solve it.

Thank you.

Marcos
Re: Error: Schema "MARCOS" cannot be resolved for table "GE_FUNCIONARIOS" [message #194209 is a reply to message #194193] Sat, 09 June 2007 08:12 Go to previous messageGo to next message
Eclipse User
Originally posted by: chrisjames64.hotmail.co.uk

I was recently playing with a JPA project and found I had to add the
following into the META-INF\orm.xml...

<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm
http://java.sun.com/xml/ns/persistence/orm_1_0.xsd" version="1.0">

<persistence-unit-metadata>
<persistence-unit-defaults>
<schema>CUSTSCH</schema>
</persistence-unit-defaults>
</persistence-unit-metadata>

</entity-mappings>

An alternative would be to use the schema attribute of the @Table
annotation in the persistent class, but this would be inflexible for
deployments to different environments. e.g

@Entity
@Table(name="", schema="")
public class Customer implements Serializable {
...etc...
}

Hope this helps
Chris
Re: Error: Schema "MARCOS" cannot be resolved for table "GE_FUNCIONARIOS" [message #194264 is a reply to message #194209] Mon, 11 June 2007 09:39 Go to previous message
Marcos is currently offline Marcos
Messages: 68
Registered: July 2009
Member
Hello, Chris.

I did what you said, but unfortunately it didn't work to me. I don't know
if it is because my project is an EJB Project, not a JPA Project. But I
think that this shouldn't matter. At least that's what I think.

Marcos

Chris wrote:
> I was recently playing with a JPA project and found I had to add the
> following into the META-INForm.xml...

> <?xml version="1.0" encoding="UTF-8"?>
> <entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm
> http://java.sun.com/xml/ns/persistence/orm_1_0.xsd" version="1.0">

> <persistence-unit-metadata>
> <persistence-unit-defaults>
> <schema>CUSTSCH</schema>
> </persistence-unit-defaults>
> </persistence-unit-metadata>

> </entity-mappings>

> An alternative would be to use the schema attribute of the @Table
> annotation in the persistent class, but this would be inflexible for
> deployments to different environments. e.g

> @Entity
> @Table(name="", schema="")
> public class Customer implements Serializable {
> ...etc...
> }

> Hope this helps
> Chris
Previous Topic:Database default schema handling
Next Topic:Unable to Export as .aar
Goto Forum:
  


Current Time: Wed Aug 20 22:40:25 EDT 2014

Powered by FUDForum. Page generated in 0.01972 seconds