[JBoss Seam] - Re: Seam 2.0.1GA : EJB Blockers with Weblogic 9.x/10.x
by srinivas.c.v
Hi Lauerc,
Thanks for the detail analysis and fix, for making seams to run in weblogic :-)
As explained by you, I have tried to update your fix on to the latest seam version and tried to re-build the seam package, after lot of struggle due to maven artifact download/path/proxy setting(some URL are blocked by our company) I was able to re-build the seam jarâs with all the fix you had provided.
After this build, I had built the booking example and deployed to my Weblogic 10.0 and found that there were still EJB compiler errors, which stopped me to deploy my booking example in the server, for more detail kindly request you refer the below logs.
To do some more testing, I had removed the TimerServiceDispatcher java class and re-build my seam and the booking example. After these changes I was able to deploy my booking examples but encountered runtime exception.
Finally, I would kindly request if you could help me in overcoming this issue.
Logs from my Server:
D:\bea10\user_projects\domains\W4WPDomain\servers\AdminServer\cache\EJBCompilerCache\-1aw4ncv1tb5k\org\jboss\seam\async\Timer
ServiceDispatcher_qzt5w2_LocalTimerServiceDispatcherImpl.java:149: cannot find symbol
symbol : method scheduleInvocation(org.jboss.seam.intercept.InvocationContext,org.jboss.seam.Component)
location: interface org.jboss.seam.async.TimerServiceDispatcher_qzt5w2_Intf
result = __bean.scheduleInvocation(
^
Note: D:\bea10\user_projects\domains\W4WPDomain\servers\AdminServer\cache\EJBCompilerCache\-1aw4ncv1tb5k\org\jboss\seam\trans
action\EjbSynchronizations_4yfxmo_Impl.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
>
<Feb 13, 2008 3:42:57 PM GMT+05:30> <BEA-149205> <Failed to initialize the application 'jboss-seam-jee5' d
ue to error weblogic.application.ModuleException: Exception preparing module: EJBModule(jboss-seam.jar)
Unable to deploy EJB: jboss-seam.jar from jboss-seam.jar:
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4129075#4129075
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4129075
18 years, 2 months
[Persistence, JBoss/CMP, Hibernate, Database] - Hibernate using SecureIdentityLoginModule for accessing Data
by vineethprabhu
Hi,
We have a datasource that is configured to use the encrypted password. This password was generated usingthe SecureIdentityLoginModule. Now, when i give the reference of the JNDI name in the hibernate.cfg.xml, its giving a improper authentication error. Below is the exceprt from login-config, oracle-ds and hibernate.cfg.xml. Also is the stack trace. Please let me know how to go about this issue. Thanks in advance:
oracle-ds.xml:
<jndi-name>OracleDS</jndi-name>
<security-domain>EncryptedDB</security-domain>
login-config.xml:
<application-policy name="EncryptDBPassword">
<login-module code="org.jboss.resource.security.SecureIdentityLoginModule" flag="required">
<module-option name = "principal">xxx</module-option>
<module-option name="username">xxx</module-option>
<module-option name="password">-108e007144adcb78</module-option>
<module-option name="managedConnectionFactoryName">jboss.jca:name=OracleDS,service=LocalTxCM</module-option>
</login-module>
</application-policy>
hibernate.cfg.xml:
java:/OracleDS
Error Message:
03:31:30,889 ERROR [UsersRolesLoginModule] Failed to load users/passwords/role files
java.io.IOException: No properties file: users.properties or defaults: defaultUsers.properties found
at org.jboss.security.auth.spi.Util.loadProperties(Util.java:315)
at org.jboss.security.auth.spi.UsersRolesLoginModule.loadUsers(UsersRolesLoginModule.java:186)
at org.jboss.security.auth.spi.UsersRolesLoginModule.createUsers(UsersRolesLoginModule.java:200)
at org.jboss.security.auth.spi.UsersRolesLoginModule.initialize(UsersRolesLoginModule.java:127)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at javax.security.auth.login.LoginContext.invoke(LoginContext.java:756)
at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
at javax.security.auth.login.LoginContext$4.run(LoginContext.java:683)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)
at javax.security.auth.login.LoginContext.login(LoginContext.java:579)
at org.jboss.security.plugins.JaasSecurityManager.defaultLogin(JaasSecurityManager.java:601)
at org.jboss.security.plugins.JaasSecurityManager.authenticate(JaasSecurityManager.java:535)
at org.jboss.security.plugins.JaasSecurityManager.isValid(JaasSecurityManager.java:344)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.getSubject(BaseConnectionManager2.java:588)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:395)
at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
at net.sf.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:59)
at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:72)
at net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1132)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:766)
at net.sf.hibernate.jmx.HibernateService.buildSessionFactory(HibernateService.java:176)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4129073#4129073
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4129073
18 years, 2 months
[Beginners Corner] - JBoss log4j.xml issue
by vivran
I am deploying an ear file in JBOSS. That ear file also has a log4j.xml file. And JBOSS installation also has a log4j.xml file in the conf directory. But the appenders defined in the conf/log4j.xml files are interfering with the appenders defined in my log4j.xml . There is a root logger defined in the conf/log4j.xml as below:
<appender-ref ref="CONSOLE"/>
<appender-ref ref="FILE"/>
So these appenders are getting inherited by the loggers in ear's log4j.xml file . And this is creating problem for me. Is there any way I can prevent this.
I hope my problem is clear to you. Its JBOSS version 5.x
additivity="false" does not work in my log4j.xml file as the log writing application is written to use the default which is true
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4129066#4129066
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4129066
18 years, 2 months
[JBoss Seam] - Re: FlushMode=MANUAL -- not immediately commited to db?
by dreuzel
I've got about the same problem as you ,
and found the sollution for your part
handling BMT
a) components.xml switch of transactions (see seam manual)
| <core:init debug="@debug@" jndi-pattern="@jndiPattern@" transaction-management-enabled="false"/> <!-- transaction-management-enabled="false" -->
| <!-- <transaction:no-transaction /> --> <transaction:no-transaction />
| <core:manager concurrent-request-timeout="500"
| conversation-timeout="99000000"
|
b) is use following class i extend to my EJB
i'm still trying out the code, so any remarks are welcome
my problem is that after some 300 transactions (5minutes/processing for 1 request) all of a sudden it loses the transaction and whatever I do I'm dead . I'm still trying to solve that one
|
|
| //@Stateless
| //@Startup
| //@Name("BMT")
| //(a)TransactionManagement(TransactionManagementType.BEAN)
| public class BMT {
| @Logger private Log log;
| //(a)Scope(ScopeType.APPLICATION)
| static int txncount=0;
| @PersistenceContext (type=EXTENDED) private EntityManager em;//do not use @in em
| //@in em would work just fine if you would call entityManager.joinTransaction()
| // in your method before you use the EntityManager.
| // Of course the @Injected EM will not join the transaction automatically
| // because the transaction is started AFTER injection, when the method is called.
| //
| @Resource private UserTransaction userTransaction;
| public String process(String xml) throws Exception {return null;}
| public String copy(StatementsDB sta) throws Exception {return null;}
| public String txs(String argument,StatementsDB sta) throws Exception
| {boolean rollback=true;
|
| String result=null;
| int ier=0;
| if (txncount<1) {txncount=100;
| int tmo=this.setSessuionTimeout(30);//do not timeout while operations are active
| boolean seso=isNewSession();}
| --txncount;
| if (!em.isOpen())
| log.info("Em persitence manager not open any more !!!");
| try{ em.joinTransaction(); }catch (Exception er)
| {ER(er,"em join the transaction transaction ");throw(er);} //after practicaly 5 minutes we die here
|
|
| try{ ier=userTransaction.getStatus(); }catch (Exception er) {ER(er,"get status transaction ");}
| //set transaction timeout
| try{ userTransaction.setTransactionTimeout(100000); }catch (Exception er) {ER(er,"transaction timeout ");}
| if (ier!=6) log.info("Status transaction different "+ier);
| try{
| try {// what is the ejbcontext ????
| //EJB userTransaction = EJBContext.getUserTransaction( );//EJBclassical way
| userTransaction= org.jboss.seam.util.EJB.getEJBContext().getUserTransaction();//EJB
| //SEAMEJB if ( userTransaction.isNoTransaction())//SEAMEJB if(transaction.getStatus() == Status.STATUS_NO_TRANSACTION){
| //SEAMEJB { userTransaction= org.jboss.seam.util.EJB.getEJBContext().getUserTransaction();//SEAMEJB
| //SEAMEJB }
| userTransaction.begin(); // etc
| // em.joinTransaction();
| } catch(Exception er) {ER(er,"Begin transaction");}
| String res=null;
| if (argument!=null)
| res = process(argument);
| if (sta!=null)
| res=copy(sta);
| try {
| userTransaction.commit(); // etc
| rollback=false;//all is successful kill any possible rollback
| result=res;//only if successfull commited the result is passed
| } catch(Exception er) {ER(er,"Commit transaction");}
|
| } catch(Exception er) {ER(er,"Transaction");}
| finally
| { try {
| //SEAMEJB if (!userTransaction.isCommitted()) {userTransaction.rollback();NewTransaction();}//auto detect commitment
| //SEAMEJB else
| if (rollback) {userTransaction.rollback();
| //get a new transaction
| NewTransaction();//Em.gettransaction not for JTA BMT em.getTransaction();//
| }
| } catch (Exception er)
| { String errmsg=er.getClass().getSimpleName() +" err: "+ er.getMessage();
| if(errmsg.indexOf("NullPointer")>-1 || errmsg.indexOf("OutOfBounds")>0) log.fatal("[transaction BMT ] Rollback failed "+ errmsg,er);
| else log.error("[transaction BMT ] Rollback failed "+ errmsg );
| }
| }//finaly
| return result;
| }
| public int setSessuionTimeout(int minutes)
| { if (minutes <1)minutes=1;
| int tmo=0;
| try {
| Object obj =ServletContexts.instance().getRequest();//null?
| if (obj!=null)obj=ServletContexts.getInstance().getRequest().getSession();
| if (obj!=null) tmo=ServletContexts.instance().getRequest().getSession().getMaxInactiveInterval();
| if (obj!=null) ServletContexts.instance().getRequest().getSession().setMaxInactiveInterval(minutes*60);
| if (obj!=null) return tmo;
| // int tmo=
| // org.jboss.seam.web.ServletContexts.instance().getRequest().getSession().getMaxInactiveInterval();
| // org.jboss.seam.web.ServletContexts.instance().getRequest().getSession().setMaxInactiveInterval(minutes*60);
| return minutes;
| } catch (Exception er)
| { String errmsg=er.getClass().getSimpleName() +" err: "+ er.getMessage();
| if(errmsg.indexOf("NullPointer")>-1 || errmsg.indexOf("OutOfBounds")>0) log.fatal("ServletContext error "+ errmsg+" time:"+tmo+"/"+ minutes,er);
| else log.error("[ServletContext error set timeout "+ errmsg +" time:"+tmo+"/"+ minutes );}
| return 0;
| }
|
|
| public boolean isNewSession()
|
| { try{
| Object obj =ServletContexts.instance().getRequest();//null
|
| if (obj!=null)obj=ServletContexts.instance().getRequest().getSession();
| if (obj!=null) return ServletContexts.instance().getRequest().getSession().isNew();
|
| // return org.jboss.seam.web.ServletContexts.instance().getRequest().getSession().isNew();
|
| } catch (Exception er)
| { String errmsg=er.getClass().getSimpleName() +" err: "+ er.getMessage();
| if(errmsg.indexOf("NullPointer")>-1 || errmsg.indexOf("OutOfBounds")>0) log.fatal("new session error "+ errmsg,er);
| else log.error("[ServletContext error set timeout "+ errmsg );}
|
| return true;
| }
| private void NewTransaction()
| {
| log.error("I urgently want a new transaction, I lost the old one in a rollback");
| try{
| // em.joinTransaction();//test
| } catch (Exception er){ER(er,"JOIN TRANSACTION RECOVER ");}
|
| }
| private void ER(Exception er,String mes)
| {String errmsg=er.getClass().getSimpleName() +" err: "+ er.getMessage();
| if(errmsg.indexOf("NullPointer")>-1 || errmsg.indexOf("OutOfBounds")>0) log.error(mes+" "+ errmsg,er);
| else log.error(mes+" "+ errmsg);
| }
|
It's not essential to do the Join the TXN with em but that way my problem is detected prior to executing my process...
any comment is welcome of coarse.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4129060#4129060
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4129060
18 years, 2 months
[EJB 3.0] - Re: EntityManagerFactory does not shutdown cleanly on JBoss-
by jaikiran
Downloaded JBoss-5.0 Beta 4, which was released yesterday. This issue is not present on Beta 4. Everything works fine during shutdown:
15:41:35,556 INFO [PersistenceUnitDeployment] Stopping persistence unit persistence.units:ear=EJB3Persistence.ear,jar=myapp_ejb3.jar,unitName=EJB3Persistence
| 15:41:35,571 INFO [SessionFactoryImpl] closing
| 15:41:35,571 INFO [SessionFactoryObjectFactory] Unbinding factory from JNDI name: persistence.units:ear=EJB3Persistence.ear,jar=myapp_ejb3.jar,unitName=EJB3Persistence
| 15:41:35,587 INFO [NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
| 15:41:35,587 INFO [SessionFactoryObjectFactory] Unbound factory from JNDI name: persistence.units:ear=EJB3Persistence.ear,jar=myapp_ejb3.jar,unitName=EJB3Persistence
|
I'll move to Beta 4 and wont open a issue in JIRA.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4129058#4129058
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4129058
18 years, 2 months