Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

There is JBAS011469 error when the app trying to write data to db. (JBossAS7, MySql)  RSS feed

 
Edward Bloom
Ranch Hand
Posts: 34
Eclipse IDE Fedora Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Forumers,

I am newbie in the Java EE world. For my programming experience I chose the JBoss Developer Studio, and the JBoss AS 7 server with MySQL database. I use these tools in Fedora 20.
JBoss has a sample application (jboss-as-kitchensink.zip ) and I would like to create my own simple sample application like this example. The kitchensink sample use xml to store data, I'm using MySql.
I cannot insert to data from jsf page. If I tried I've got this message to the consol:

INFO [com.itemsapp.service.ItemInsertion] (http-localhost-127.0.0.1-8080-1) Inserting Lenovo
INFO [javax.enterprise.resource.webcontainer.jsf.renderkit] (http-localhost-127.0.0.1-8080-1) WARNING: FacesMessage(s) have been enqueued, but may not have been displayed.
sourceId=null[severity=(ERROR 2), summary=(JBAS011469: Transaction is required to perform this operation (either use a transaction or extended persistence context)), detail=(Insertation unsuccessful)]

But if I insterted data maunaly, I could get the that from the database as you can see here.

INSERT INTO `itemsapp`.`ITEM`(`ITEM_ID`,`ITEM_PRICE`,`MODEL_NO`,`NAME`,`TOTAL_NO`)VALUES(1,250,"Inspiron 3520","DELL",12);SELECT * FROM itemsapp.ITEM;

I archived my project from jbdevstudio it can be found here.

Does someone have any idea how to change this code?

Thank you in advance for any help you can provide.
 
Edward Bloom
Ranch Hand
Posts: 34
Eclipse IDE Fedora Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear forumers,

I guess I solved this problem.
At the com.itemsapp.service package i annotated the ItemInsertion class with @Stateless annotation.
Now i've got the
sourceId=null[severity=(INFO 0), summary=(Inserted!), detail=(Insertation successful)]

And i can see the data in the db and the listItems.xhtml too.

Regards,
Adrian
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!