Shubham Semwal

Ranch Hand
+ Follow
since Mar 08, 2014
Cows and Likes
Cows
Total received
3
In last 30 days
0
Total given
0
Likes
Total received
7
Received in last 30 days
0
Total given
34
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Shubham Semwal

what does ResourcelessTransactionManager do ?
4 years ago
Employee


EmployeeDAO


StoreData


employee.hbm.xml


applicationContext.xml


Error -
Exception in thread "main" java.lang.NoSuchMethodError: org.springframework.transaction.support.TransactionSynchronizationManager.isActualTransactionActive()Z
at org.springframework.orm.hibernate3.SpringTransactionFactory.isTransactionInProgress(SpringTransactionFactory.java:72)
at org.hibernate.jdbc.JDBCContext.isTransactionInProgress(JDBCContext.java:187)
at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:236)
at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:180)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:121)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:186)
at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:175)
at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:535)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:523)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:519)
at org.springframework.orm.hibernate3.HibernateTemplate$12.doInHibernate(HibernateTemplate.java:686)
at org.springframework.orm.hibernate3.HibernateTemplate$12.doInHibernate(HibernateTemplate.java:1)
at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:406)
at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)
at org.springframework.orm.hibernate3.HibernateTemplate.save(HibernateTemplate.java:683)
at com.hibernatespringintegration.EmployeeDAO.saveEmployee(EmployeeDAO.java:17)
at com.hibernatespringintegration.StoreData.main(StoreData.java:21)


This is creating a table in db but not inserting anything.

Please advise.
Thanks
4 years ago
Employee.java


RegularEmployee


ContractEmployee


StoreData


employee.hbm.xml


hibernate.cfg.xml


Error : Exception in thread "main" org.hibernate.MappingException: Following superclasses referenced in extends not found: null
at org.hibernate.cfg.Configuration.processExtendsQueue(Configuration.java:1200)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1119)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1283)
at com.hibernateinheritancemapping.tableperhierarchy.StoreData.main(StoreData.java:11)


Please advise.
Thanks
See the attached directory structure.
Controller -> inside src.
index.jsp -> inside webContent.
xml files -> inside webContent/web-inf
hellopage -> inside webContent/web-inf/jsp

4 years ago
yes.. corrected. Still of no use.
4 years ago

Tim Cooke wrote:Can you spot the difference?

<a href="hello.html">Click here

@RequestMapping("/hello")



So should I change hello.html to hello ? it's still not working. I already tried that.
new url - http://localhost:10025/SpringMVC/hello

I'm learning from this example - javatpoint
4 years ago
index.jsp


HelloWorldController.java


web.xml


spring-servlet.xml


hellopage.jsp


The request is going to url - http://localhost:10025/SpringMVC/hello.html >> resource not available.
It should go to HelloWorldController.java .

Please suggest.
Thanks

4 years ago
Thanks got it. It was expecting the varchar shubham as 'shubham'. I made the changes and now it works fine
4 years ago
Thanks.. I added the jar.
Now I'm stuck on this exception -
exception in thread "main" org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [insert into employee values(1,Shubham,100000.0)]; nested exception is com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Unknown column 'Shubham' in 'field list'
4 years ago
Congrats and Keep Moving Forward
4 years ago
Employee.java


EmployeeDAO.java


EmployeeDriver.java


applicationContext.xml


I'm getting bean creation exception. I believe the problem can be in xml file since I changed the configuration from Oracle 10g to mysql.
Please suggest.

Thanks
4 years ago
lol .. yeah .. I'll remember it now :p

Thanks to all people once again. It's a great community
4 years ago
Please don't hit me !!

Sorry for all that confusion. I got it now. I was not running the index.html on a server and it was not outside web-inf sometimes.

The pre-requisites were -
1: index.html should be under webContent but not under web-inf.
2: the html page should run on server.

If it weren't running on server then by default the index.html was looking for action url under same folder i.e web content.
I wasted so much time on the silly mistake
4 years ago

Dave Tolls wrote:How are you opening that index.html?

Is it deployed to your server?



I'm running that from np++.
4 years ago