bobby peccia

Greenhorn
+ Follow
since Oct 25, 2014
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by bobby peccia

Disregard last statment! is there a delete statement somehhow?

It is not working stuck in the original place in the ad.

Thanks
9 years ago
Ok so I got past the server issue I beleive but I basically only swapped it for another one because now Hibernate is asking what my User class is, it should be completely aware of it

I changed my Autowire statements in my controller method to be



I am now plauged with the Hibernate error



thank you
9 years ago
Hello! thank you for the response.

Here is the full line in the stack trace



Lower down the stack trace there is this line



Since I took out package and import names the line it is referencing is this one



When I use the debugger to trace the error, it takes me into the "buildSessionFactory", shown below



Failing on this line of that method



Something I thought that was weird was the above line has a line through it, the only the "buildSessionFactory" letters however.


this error is very strange to me as this code used to work. I had a simple class like the one written above that worked, persisted a user perfectly, it was only when I tried to make the class bigger that it stopped working, I have shortened it back to whats written above and still nothing. Driving me crazy..........
9 years ago
Ok so I am building an ecommerce site using java spring mvc, spring security, maven, hibernate, and some other technologies however those should be the only ones relevant to my problem. I am doing all java config with no XML by the way (which I am currently considering revising since I am running into situations where xml just seems easier).

When I try to build my program (maven install) it builds correctly without errors but when I start/restart my server I get exceptions about configuration.

I have tried to get this down to as simple as possible while still having a user and a role. When I am looking at the code, it really is pretty straight forward stuff - I am dying to find out why it errors out everytime.

Also sorry if this isnt in the correct section, I thought it could fit in the hibernate forum also but I think my root problem is spring based.

Thank you

Main Appconfig class


SecurityConfig.java




User class

UserRole class



UserDao Interface


UserDaoImpl

UserService Interface



User Service Impl


Database SQL used

CREATE TABLE users (
user_id int(11) NOT NULL AUTO_INCREMENT,
username VARCHAR(45) NOT NULL UNIQUE,
PRIMARY KEY (user_id));

I cant get the server to startup without errors. There has to be something wrong in the code above.

In AppConfig.java if I change the line "scanPackages...." to the actual class name

com.crutchsf.users.model.User

then my server starts up fine and the program is reachable via server on localhost:8080 but when it reaches the line in my userDao to be persisted

I get a different error from hibernate "Cant find entity com.crutchsf.users.model.User"

Here is the main error I get. Basically I can choose which error I want to get now.



thank you
9 years ago