[Beginners Corner] - Please help with EJB3 ClassCastException.
by kingcu
Hi Friends,
I am writing my first ejb 3 project that has a simple stateless session bean, which is accessed by my struts action class. Here is how the bean class looks like:
@Stateless
| @Local ({BeanLocal.class})
| @LocalBinding (jndiBinding="myapp/BeanLocal")
| @Remote ({BeanRemote.class})
| @RemoteBinding (jndiBinding="myapp/BeanRemote")
| public class Bean implements BeanLocal, BeanRemote {
| ...
| }
|
However, I got ClassCastException in my action class when trying to cast the bean to its local/remote interface type:
BeanLocal bl = (BeanLocal) jndiContext.lookup("myapp/BeanLocal");
or for remote interface:
Object ref = jndiContext.lookup("myapp/BeanRemote");
| BeanRemote br = (BeanRemote) PortableRemoteObject.narrow(ref, BeanRemote.class);
|
I am using JBoss Eclipse IDE 1.6 and running JBoss AS 4.0.5. The EJB 3 code is packaged into ejb-jar.jar and the web app is in its war file, then both the jar and the war are packed into an ear file.
Can someone please help me figure out what's wrong here?
Thanks,
Tong
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4001168#4001168
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4001168
19 years, 3 months
[JBoss Portal] - Unable to upload image in CMS (JBoss Portal 2.4.1.SP1)
by hurzeler
Hello there,
I just tried to upload an image and or archive with images in CMS (admin page). I am using jboss4.0.5GA with postgress 8.2. I thought this issue would have been looked at by now as a portal without any images is not much good.
The error I am getting is:
| 2007-01-13 10:12:41,140 DEBUG [org.hibernate.SQL] insert into jbp_cms_wsp_binval (BINVAL_ID, BINVAL_DATA, PK) values (?, ?, ?)
| 2007-01-13 10:12:41,140 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
| 2007-01-13 10:12:41,140 DEBUG [org.hibernate.jdbc.ConnectionManager] skipping aggressive-release due to flush cycle
| 2007-01-13 10:12:41,156 DEBUG [org.hibernate.util.JDBCExceptionReporter] could not insert: [org.jboss.portal.cms.hibernate.state.WSPBinVal] [insert into jbp_cms_wsp_binval (BINVAL_ID, BINVAL_DATA, PK) values (?, ?, ?)]
| org.postgresql.util.PSQLException: Unexpected error writing large object to database.
| Exception: java.io.IOException: Read error
| Stack Trace:
| java.io.IOException: Read error
| at java.io.FileInputStream.readBytes(Native Method)
| at java.io.FileInputStream.read(FileInputStream.java:194)
| at org.postgresql.jdbc2.AbstractJdbc2Statement.setBlob(AbstractJdbc2Statement.java:2745)
| at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.setBlob(WrappedPreparedStatement.java:517)
| at org.hibernate.type.BlobType.set(BlobType.java:49)
| at org.hibernate.type.BlobType.nullSafeSet(BlobType.java:117)
then further down
Caused by: org.postgresql.util.PSQLException: Unexpected error writing large object to database.
| Exception: java.io.IOException: Read error
| Stack Trace:
| java.io.IOException: Read error
| at java.io.FileInputStream.readBytes(Native Method)
| at java.io.FileInputStream.read(FileInputStream.java:194)
| at org.postgresql.jdbc2.AbstractJdbc2Statement.setBlob(AbstractJdbc2Statement.java:2745)
| at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.setBlob(WrappedPreparedStatement.java:517)
Do I have to configure postgres specially for this or what else can I do to get this working?
Thanks for your help.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4001161#4001161
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4001161
19 years, 3 months