[JBoss Seam] - Re: Possible to test Passivation from Embedded EJB3?
by lowecg2004
Yeah, I'd read that in the release notes and with a fix for JBSEAM-325 these were my main driver for upgrading to 1.1. So I am actually using Seam 1.1 CR1 now and the exception reported in my original post was for the following bean:
@Stateful
| @Scope(SESSION)
| @Name("changePassword")
| @LoggedIn
| public class ChangePasswordAction implements ChangePassword, Serializable{
|
| private static final long serialVersionUID = 1L;
|
| @Logger
| private Log log;
|
| @In(create=true) @Out
| private User user;
|
| @In(create=true)
| private MessageUtils messageUtils;
|
| @In(create=true)
| private PasswordUtils passwordUtils;
|
| @In(create=true)
| private UserDao userDao;
|
| @In(create=true)
| private AuditLog auditLog;
|
| private String password;
|
| private String confirmPassword;
|
| ... (remaining class consists of methods only)
| }
As you can see, if you strip the @In parameters from the class, we're left with two strings. I've tested the serializability of the class and it is okay.
Am I right in thinking that the following exception (which was reported as preventing my bean from being activated) could be caused by serialization problems, or am I running into a different issue?
Caused by: java.lang.ClassCastException: org.jboss.serial.io.MarshalledObject
Cheers,
Chris.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3988365#3988365
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3988365
19Â years, 5Â months
[Persistence, JBoss/CMP, Hibernate, Database] - problem with testing: hibernate schema update -> can't commi
by gedel
Hello
I write tests for domain persistence layer implemented on Hibernate.
I use JBoss microcontainer for the following purposes:
1. provide Datasources through JNDI
2. provide UserTransaction through JNDI
my tests fork fine. But I want to create database schema on every test run (I use HSQLDB in embedded mode). Schema update is unavailable, because I use LocalTxDataSources which use "test managed" UserTransaction.
stack trace:
SchemaUpdate - Running hbm2ddl schema update
| SchemaUpdate - fetching database metadata
| SchemaUpdate - could not get database metadata
| java.sql.SQLException: You cannot set autocommit during a managed transaction!
| at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.setJdbcAutoCommit(BaseWrapperManagedConnection.java:482)
| at org.jboss.resource.adapter.jdbc.WrappedConnection.setAutoCommit(WrappedConnection.java:322)
| at org.hibernate.tool.hbm2ddl.SuppliedConnectionProviderConnectionHelper.prepare(SuppliedConnectionProviderConnectionHelper.java:36)
| at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:127)
| at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:314)
| at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1218)
hibernate.cfg.xml
| <property name="connection.datasource">java:comp/env/jdbc/XxxDataSource</property>
| ....
| <property name="hibernate.transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
| <property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.WeblogicTransactionManagerLookup</property>
| <property name="hibernate.transaction.flush_before_completion">true</property>
| <property name="hibernate.transaction.auto_close_session">true</property>
| ...
| <property name="hibernate.hbm2ddl.auto">update</property>
jboss-beans.xml with several datasources:
| <bean name="MasterDSBootstrap" class="org.jboss.resource.adapter.jdbc.local.LocalTxDataSource">
| <property name="driverClass">org.hsqldb.jdbcDriver</property>
| <property name="connectionURL">jdbc:hsqldb:file:test-output/master</property>
| <property name="userName">sa</property>
| <property name="jndiName">java:comp/env/jdbc/XxxDataSource</property>
|
| <bean name="SlaveDSBootstrap" class="org.jboss.resource.adapter.jdbc.local.LocalTxDataSource">
| <property name="driverClass">org.hsqldb.jdbcDriver</property>
| <property name="connectionURL">jdbc:hsqldb:file:test-output/slave</property>
| <property name="userName">sa</property>
| <property name="jndiName">java:comp/env/jdbc/YyyDataSource</property>
|
"problem code" from SchemaUpdate.execute
| log.info("fetching database metadata");
| connection = connectionProvider.getConnection();
| if ( !connection.getAutoCommit() ) { <<<---- i can return true there through extending datasource classes
| connection.commit();
| connection.setAutoCommit(true); <<< --- exception throwing there
| autoCommitWasEnabled = false;
| }
|
this code from hibernate 3.0.5, the same (but with insignificant differences) in 3.2
What are you think about this? Which is the simplest way to solve this issue? Should I use nonTx Datasource's ? May be I have to extends LocalTxDataSource and WrappedConnection for return AutoCommit true always?
thanks for your attention
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3988363#3988363
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3988363
19Â years, 5Â months
[EJB/JBoss] - java.net.SocketTimeoutException: Read timed out
by nishu_saini
Hi All,
I have a client application which is accessing a Remote EJB deployed over JBoss AS 4.0.4 RC1 and JBoss AS 4.0.3 SP1. The client sends and recieves some large chunks of data to and from the server. But the following exception has started to come on client very frequently. Can we increase The Time out? Is the time out occurring during the reciept or sending of data or during the ping pong between server and client?
How can we solve this problem? What is the cause of this problem?
java.rmi.ConnectException: Failed to communicate; nested exception is:
java.net.SocketTimeoutException: Read timed out
at org.jboss.invocation.pooled.interfaces.PooledInvokerProxy.invoke(PooledInvokerProxy.java:382)
at org.jboss.invocation.InvokerInterceptor.invokeInvoker(InvokerInterceptor.java:227)
at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:167)
at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55)
at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:97)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:86)
... 8 more
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(Unknown Source)
at java.io.BufferedInputStream.fill(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
at java.io.ObjectInputStream$PeekInputStream.peek(Unknown Source)
at java.io.ObjectInputStream$BlockDataInputStream.peek(Unknown Source)
at java.io.ObjectInputStream$BlockDataInputStream.peekByte(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at org.jboss.invocation.pooled.interfaces.PooledInvokerProxy.invoke(PooledInvokerProxy.java:366)
... 14 more
If any body finds the solution of this problem, please tell us.
Thanks
Nishant Saini
http://www.simplyjava.com
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3988359#3988359
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3988359
19Â years, 5Â months
[JBoss Seam] - Beta2 -> CR1 problem: Cannot get value for expression '#{org
by roeber
Hi,
after switching to CR1 Seam jars I am getting the following exception when I logout (Seam.invalidateSession()) :
javax.ejb.EJBException: javax.faces.el.EvaluationException: Cannot get value for expression '#{org$jboss$seam$core$facesMessages}'
at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:69)
...
Caused by: javax.faces.el.EvaluationException: Cannot get value for expression '#{org$jboss$seam$core$facesMessages}'
at org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:402)
...
Caused by: java.lang.IllegalStateException: No conversation context active
at org.jboss.seam.ScopeType.getContext(ScopeType.java:111)
... 158 more
The message 'No conversation context active' seams to be correct because at this point there is no (explicit) conversation active.
Switching back to Beta2 and the error disappears.
Any ideas what I have to change?
--
Axel
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3988358#3988358
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3988358
19Â years, 5Â months
[Beginners Corner] - Portlet keeps data on reload
by francsi
Hello!
Here is my problem:
I'm building a Portlet that should work as some kind as adress book.
First the user has to chose a special departement. Then all members of that department will be listet with phone and email. so far, so good.
If one changes to an other location of the website and then returns to the portlet, he gets the list of persons he had searched allready instead of the form to choose a new department.
Why? Because the doView method asks for a variable submittet by that form to decide what should be displayed. And that variable contains the last search attribute instead of being empty at initialisation.
Well, my english isnt quite good enough to give a better explanation. So, here is the code of the doView method.
BTW... I've noticed the same behavior in the helloworld example:On reload (maybe change from default to test and back), you can't type in a new name.
| protected void doView(RenderRequest request, RenderResponse response) throws PortletException, PortletSecurityException, IOException
| {
| response.setContentType("text/html");
| String fachbereich = (String) request.getParameter("fb");
|
| if (fachbereich != null){
| dbConnection db = new dbConnection();
| db.getConnection();
| List contactList;
| if (fachbereich.compareTo("Alle") == 0) {
| contactList = db.getData("");
| } else {
| contactList = db.getData(fachbereich);
| }
|
| request.setAttribute("contactList", contactList);
| PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/WEB-INF/jsp/ContactsView.jsp");
| prd.include(request, response);
| } else {
| PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/WEB-INF/jsp/AuswahlView.jsp");
| prd.include(request, response);
| }
| }
|
cya,
jan
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3988357#3988357
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3988357
19Â years, 5Â months