-
Notifications
You must be signed in to change notification settings - Fork 233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JPA Metadata not loading for User Class #131
Comments
BTW here is my User class I am trying to persist: package com.stemstudios.test.Domain;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name = "User", schema = "DEMO@cassandra_pu")
public class User
{
@Id
private String userId;
@Column(name="first_name")
private String firstName;
@Column(name="last_name")
private String lastName;
@Column(name="city")
private String city;
public User()
{
}
public String getUserId()
{
return userId;
}
public void setUserId(String userId)
{
this.userId = userId;
}
public String getFirstName()
{
return firstName;
}
public void setFirstName(String firstName)
{
this.firstName = firstName;
}
public String getLastName()
{
return lastName;
}
public void setLastName(String lastName)
{
this.lastName = lastName;
}
public String getCity()
{
return city;
}
public void setCity(String city)
{
this.city = city;
}
} |
You entity class definition is correct. Kundera is not able to find your If you could send me your entire code, I would be able to have a look at it. Regards, On Thu, Oct 11, 2012 at 10:34 AM, Phillip Couto [email protected]:
|
I zipped the project. https://s3.amazonaws.com/stembackup/Cassandra+Test.zip |
Please remove tag from persistence.xml and replace property Regards, On Thu, Oct 11, 2012 at 11:06 AM, Phillip Couto [email protected]:
|
No luck same error |
I ran your code inside enclipe and it works for me perfectly . Are you In the past, some users have reported exactly similar issues while using Amresh On Thu, Oct 11, 2012 at 11:26 AM, Phillip Couto [email protected]:
|
I am running my code in Eclipse Indigo. Maybe my configuration is wonky. I will try using the latest one. |
Downloaded new eclipse. Made new workspace. Created new maven project and added kundera-cassandra. Recreated the files right from the walk through and still same error. |
Please share complete server log. Have a look at sample project i have uploaded at: If this works for you. Also have a look at: -Vivek |
I ran it and this is console output I get:
|
BTW not sure if this is of concern I am using JDK 1.7 |
Might be. i did not try it yet on jdk 1.7, using cassandra 1.1.5? -Vivek |
Yeap. I installed JDK 6u35 and still nothing. It feels like its some settings for my eclispe and I am running this in windows. |
Ok so I just validated that it has to do with it running in windows. I am closing the issue as it is a configuration thing on my part that I will have to resolve. Thanks for your help and time. |
Let us know when you manage to get this working on Windows. We are Regards, On Thu, Oct 11, 2012 at 4:43 PM, Phillip Couto [email protected]:
|
The issue is with the Reader class under the com.impetus.kundera.classreading package. This line of code is taking the class directory and trying to read it as a Jar file: else if (!urlString.endsWith("/"))
{
return new JarFileIterator(url.openStream(), filter);
} This can be found on lines 150 to 153. Looks like Eclipse in windows does not add a slash at the end of the classpath and therefore the Reader feels like it is a file. I suggest this be changed to check if the provided classpath URL is a file or directory before further processing. If it is a file then you can work through if it is a JAR file or .class file. |
Could you please submit your pull request(With code changes which is working for you)? -Vivek |
Has there been any progress on this? I'm seeing the same issue when bundling my entities/daos in a commons jar and then attempting to persist from another application. |
This is the issue related to windows env. If you are bundling your entities within a jar file, try to add that jar under "" tag. Else those should be available within classpath. Have a look at: for more details. |
What do you mean try adding that jar under "" tag? I presume a property tag in persistence.xml? Here is my persistence.xml file, which does not work: https://gist.github.com/4039678 I also tried using instead of "" which does not work either. |
Hi, try like:
please mention absolute path of my-commons.jar -Vivek |
ok that worked, thank you very much! i am, however, getting this error even though my test is now passing. Am I missing a schema reference/version or something? 13:06:10,921 ERROR com.impetus.kundera.loader.PersistenceXMLLoader$ErrorLogger PersistenceXMLLoader:431 - Error parsing XML: XML InputStream(-1) cvc-complex-type.2.4.d: Invalid content was found starting with element 'jar-file'. No child element is expected at this point. |
looks like 2.0 schema is not available with your persistence.xml can see that you referring to: "http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" in place of 2.0 |
Looks like not an issue anymore. closing this with 2.3 -Vive |
I have the same problem! " I'm using NetBeans 7.2. |
This looks to me as a packaging issue. Either Person entity is not on the classpath or persistence.xml is not mapped correctly. -Vivek |
Same here with Play 2.4. Anyone know what the deal is? |
@achaiah Do you mean Play in dev or prod (packaged)? In dev mode (sbt run on the project dir) I have to compile my entities classes by myself. Play doesn't pick them up if they are in packages different from the ones it creates on setup of the project. I believe there's a way to include other packages but haven't figured that part out yet. I'm using Play 2.5 |
I ran through the getting started in 5 minutes guide and I am running into this error consistently.
Here is my persistence.xml:
I know the xml document is being parsed correctly based on this console output:
Not sure if this is a bug or user error on my part.
The text was updated successfully, but these errors were encountered: