[JBoss-user] [JBoss Seam] - Re: Entity Manager null

2006-03-06 Thread neillane
Hi James

I have changed the servlet mapping to be /servlet/ and added the filter 
code to the web.xml file in my application as per your code snippet.

I am able to call the doPost method in my servlet which in turn calls


  | 
  | EnvelopeUploadBean uploader = null;
  | try
  | {
  | uploader = new EnvelopeUploadBean();
  | }
  | catch (Exception e)
  | {
  | e.printStackTrace(); 
  | }
  | 
  | String result = uploader.uploadEnvelope(inputStream);
  | 
  | 

This then runs everything in the *bean* correctly.

However - I am still unable to get the EntityManager (it is still null when I 
am trying to persist the data to my database)

I have searched the reference docs for info on the SeamServletFilter and how to 
use it with very little success.  

If possible,  could you explain, or point me in right dicetion as to how to 
involk the filter and make it possible for me to use the EntityManager 

Thanks

Neil

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3928141#3928141

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3928141


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [JBoss Seam] - Re: Entity Manager null

2006-03-06 Thread Andy.2003
I'd got this porblems as well, while trying to inject the Entitymanager, my 
Problem was, that the bean accessing the EntityManager wasn't an ejb3 
sessionbean. So this solved my problem:

@Stateless
  | public class foo{
  | @PersistentContext EntityManager em
  | ...
  | }

after making the Bean a Sessionbean the EntityManager was injected correctly

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3928148#3928148

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3928148


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [JBoss Seam] - Re: Entity Manager null

2006-03-06 Thread neillane
I have the following

  | @Stateless
  | @Name(envelopeUpload)
  | public class EnvelopeUploadBean implements EnvelopeUpload, Serializable
  | {
  | 
  | @PersistenceContext
  | private EntityManager em;
  | 
  | .
  | 
  | 

I have even tried with the unit name of the context ( the DS) and that doesnt 
work either.

The other Objects that I am injecting are working fine.  I can get the Object 
the I am going to persist and set all the vars.



View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3928156#3928156

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3928156


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [JBoss Seam] - Re: Entity Manager null

2006-03-06 Thread Andy.2003
did you set up the datasource the right way? (persistence.xml etc.)

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3928166#3928166

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3928166


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [JBoss Seam] - Re: Entity Manager null

2006-03-06 Thread neillane
I would think so.

All the other functions of retrieving data from the database and displaying it 
in datatables are working fine in my web app. It is just the bean that is 
called by the servlet, where the em is null and I cant seem to instantiate it.

The persistance.xml


  | persistence
  |persistence-unit name=NerveCentre-DS
  |   providerorg.hibernate.ejb.HibernatePersistence/provider
  |   jta-data-sourcejava:/NerveCentreDS/jta-data-source
  |   properties
  |  property name=hibernate.dialect 
value=org.hibernate.dialect.HSQLDialect/
  |  property name=hibernate.transaction.manager_lookup_class 
value=org.hibernate.transaction.JBossTransactionManagerLookup/
  |  property name=hibernate.transaction.flush_before_completion 
value=true/
  |  property name=hibernate.hbm2ddl.auto value=create-drop/
  |  property name=hibernate.show_sql value=true/
  |   /properties
  |/persistence-unit
  | /persistence
  | 

The DS


  | ?xml version=1.0 encoding=UTF-8?
  | 
  | datasources
  | local-tx-datasource
  | jndi-nameNerveCentreDS/jndi-name
  | 
connection-urljdbc:mysql://127.0.0.1:3306/nerve-centre/connection-url
  | driver-classcom.mysql.jdbc.Driver/driver-class
  | user-nameroot/user-name
  | password/password
  | exception-sorter-class-name
  | org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter
  | /exception-sorter-class-name
  | metadata
  | type-mappingmySQL/type-mapping
  | /metadata
  | /local-tx-datasource
  | /datasources
  | 



View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3928185#3928185

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3928185


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [JBoss Seam] - Re: Entity Manager null

2006-03-03 Thread js8523
Make sure that you have the seam servlet filter invoked before your filter and 
that you pass it conversationid as a parameter. See the documentation on the 
SeamServletFilter. 

the entry in the web.xml is this. 

  | filter
  | filter-nameSeam Servlet Filter/filter-name
  | 
filter-classorg.jboss.seam.servlet.SeamServletFilter/filter-class
  | /filter
  | 
  | filter-mapping
  | filter-nameSeam Servlet Filter/filter-name
  | url-pattern/servlet/*/url-pattern
  | /filter-mapping

Hope this resolves your issue, 

James 

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3927705#3927705

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3927705


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user