[JBoss Seam] - Re: ASync calls stays in JBoss queue after restart
by m_hess
Hi,
I tried to fix this by calling timer.cancel() during the destroy method, which seems to me is the way to handle timers during shutdown if I don´t want them to get persisted.
Now I´m having the "Could not destroy component: "componentName"
EJBNoSuchObjectException: Could not find stateful bean: " problem.
Important: I already searched the forums for that exception and found the "adjust Timeouts-solution". I did that, but I still get the exception. Furthermore, I get this for my ASyncTest class, as well as another class. Both do have in common, that they are created using @Startup.
Timeouts also do seem unlikely, because I can provoke this directly after startup - although all 3 timeout values are set to 30 minutes (or 1800 seconds).
I´m running Seam 1.1 GA on JBoss 4.0.5 GA.
Does anybody have a clue what else might go wrong during the shutdown phase? I tried to debug it, but it seems like I do not even enter the @Destroy method of my bean. Frankly, I´m completely lost on this one... :-(
Help, please, anybody?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995880#3995880
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995880
19 years, 7 months
[JBoss Portal] - modifying the jboss portal programatically with portal core
by FredF
I am developing some portlets using JBoss seam 1.0 and JBoss Portal 2.6.
A want to use the Portal Core API in order to add portal objects programatically, e.g. portlet instances to pages and pages to portals.
I have looked at how the included manager portlet accomplishes this. I figured out that I need an instance of the PortalObjectManagerBean and then call some methods on it.
The manager portlet uses dependency injection via the faces-config.xml and sets up various properties on the bean. I have copied that managed bean to my faces-config.xml and set getters and setters in my pojo to my attribute of class PortalObjectManagerBean but it is null when I access it.
If I explicitly create a new object all other properties of the bean is still null. I access the portal core api from a pojo that in turn is called by an seam action class.
How do I get an instance of the managerbean? Have anyone done this before and want to give me any help?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995876#3995876
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995876
19 years, 7 months
[JBoss Eclipse IDE (users)] - XDoclet shortcoming?
by scramer
Hello and merry christmas to everybody.
I'm using JBossIDE 2.0.0beta2.
The problem I am facing is with relations and the unknown-pk feature. I have two CMP EJBs:
| package de.chitec.physio.server.ejb;
|
| import java.rmi.RemoteException;
| import java.util.Date;
|
| import javax.ejb.EJBException;
| import javax.ejb.EntityBean;
| import javax.ejb.EntityContext;
| import javax.ejb.RemoveException;
|
| import org.apache.log4j.Logger;
|
| /**
| * @ejb.bean
| * name="CMPPerson"
| * display-name="CMPPerson"
| * description="Description for CMPPerson"
| * jndi-name="ejb/CMPPerson"
| * type="CMP"
| * cmp-version="2.x"
| * view-type="local"
| * reentrant = "false"
| * local-jndi-name = "ejb/CMPPerson"
| *
| * @ejb.persistence
| * table-name = "person"
| *
| * @ejb.pk
| * class="java.lang.Object"
| *
| * @ejb.finder
| * signature="java.util.Collection findByLastName(java.lang.String pLastName)"
| * query="SELECT Object(o) FROM CMPPerson o WHERE o.lastName LIKE ?1"
| *
| * @jboss.entity-command
| * name = "${jboss.entity.command}"
| * class = "${jboss.entity.class}"
| *
| * @jboss.unknown-pk
| * class="java.lang.Integer"
| * column-name="id"
| * jdbc-type="INTEGER"
| * sql-type="INTEGER"
| * auto-increment="true"
| *
| * @jboss.persistence
| * pk-constraint = "true"
| * table-name = "person"
| *
| */
| public abstract class CMPPersonBean implements EntityBean
| {
|
| public CMPPersonBean()
| {
| }
|
| public void ejbActivate() throws EJBException, RemoteException
| {
| }
|
| public void ejbLoad() throws EJBException, RemoteException
| {
| }
|
| public void ejbPassivate() throws EJBException, RemoteException
| {
| }
|
| public void ejbRemove() throws RemoveException, EJBException, RemoteException
| {
| }
|
| public void ejbStore() throws EJBException, RemoteException
| {
| }
|
| public void setEntityContext(EntityContext ctx) throws EJBException, RemoteException
| {
| }
|
| public void unsetEntityContext() throws EJBException, RemoteException
| {
| }
|
| /**
| * Getter for CMP Field lastName.
| *
| * @return The person's lastname.
| * @ejb.persistent-field
| * @ejb.persistence column-name = "lastname" sql-type = "VARCHAR"
| * @ejb.interface-method view-type="local"
| */
| public abstract String getLastName();
|
| /**
| * Setter for CMP Field lastName.
| *
| * @param pLastName The person's lastname
| * @ejb.interface-method view-type="local"
| */
| public abstract void setLastName(String pLastName);
|
|
| /**
| * Create method.
| *
| * @ejb.create-method view-type = "local"
| */
| public Object ejbCreate(String pLastName) throws javax.ejb.CreateException
| {
| setLastName(pLastName);
| return null;
| }
|
| public void ejbPostCreate(String pLastName, String pFirstName, Date pBirthday) throws javax.ejb.CreateException
| {
| }
|
|
|
| }
|
as well as
| package de.chitec.physio.server.ejb;
|
| import java.rmi.RemoteException;
|
| import javax.ejb.EJBException;
| import javax.ejb.EntityBean;
| import javax.ejb.EntityContext;
| import javax.ejb.RemoveException;
|
| import de.chitec.physio.server.interfaces.CMPPersonLocal;
|
| /**
| * @ejb.bean
| * name="CMPPatient"
| * display-name="CMPPatient"
| * description="Description for CMPPatient"
| * jndi-name="ejb/CMPPatient"
| * type="CMP"
| * cmp-version="2.x"
| * view-type="local"
| * reentrant = "false"
| * local-jndi-name = "ejb/CMPPatient"
| *
| * @ejb.persistence
| * table-name = "patient"
| *
| * @ejb.pk
| * class="java.lang.Object"
| *
| * @jboss.entity-command
| * name = "${jboss.entity.command}"
| * class = "${jboss.entity.class}"
| *
| * @jboss.unknown-pk
| * class="java.lang.Integer"
| * column-name="id"
| * jdbc-type="INTEGER"
| * sql-type="INTEGER"
| * auto-increment="true"
| *
| * @jboss.persistence
| * pk-constraint = "true"
| * table-name = "patient"
| */
| public abstract class CMPPatientBean implements EntityBean {
|
| public CMPPatientBean() {
| }
|
| public void ejbActivate() throws EJBException, RemoteException {
| }
|
| public void ejbLoad() throws EJBException, RemoteException {
| }
|
| public void ejbPassivate() throws EJBException, RemoteException {
| }
|
| public void ejbRemove() throws RemoveException, EJBException, RemoteException {
| }
|
| public void ejbStore() throws EJBException, RemoteException {
| }
|
| public void setEntityContext(EntityContext ctx) throws EJBException, RemoteException {
| }
|
| public void unsetEntityContext() throws EJBException, RemoteException {
| }
|
| /**
| * Getter for CMR Relationship
| *
| * @ejb.interface-method view-type="local"
| * @ejb.relation name = "Patient-To-Person"
| * role-name = "Patient-To-Person-Role"
| * target-ejb = "CMPPerson"
| * target-role-name = "Patient-Is-Person"
| * target-multiple = "false"
| *
| * @jboss.relation related-pk-field = "id"
| * fk-column = "person"
| *
| */
| public abstract CMPPersonLocal getPerson();
|
| /**
| * Setter for CMR Relationship
| *
| * @ejb.interface-method view-type="local"
| */
| public abstract void setPerson(CMPPersonLocal value);
|
| }
|
As you can see both CMPs use automagically generated PKs. Now for the problem:
Both of the contained beans work well if not linked via a relation. As soon as the relation comes in we got a problem. I know how it is supposed to be done (using jbosscmp-jdbc.xml). The relation code should be:
| <ejb-relation>
| <foreign-key-mapping/>
| <ejb-relation-name>Patient-To-Person</ejb-relation-name>
| <ejb-relationship-role>
| <ejb-relationship-role-name>
| Patient-To-Person-Role
| </ejb-relationship-role-name>
| <key-fields />
| </ejb-relationship-role>
| <ejb-relationship-role>
| <ejb-relationship-role-name>
| Patient-Is-Person
| </ejb-relationship-role-name>
| </ejb-relationship-role>
| </ejb-relation>
|
The problem is: I simply don't know how to generate the <foreign-key-mapping/> tag via xdoclet.
Please, please, please - help.... :-)
Greetings
Sebastian
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995872#3995872
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995872
19 years, 7 months
[JBoss Seam] - Removing jaxws in ejb3-all jar
by daleth
I have two sets of code that I need to integrate. One is a web service client using XFire and the other is a SEAM 1.1 application. Turns out there is a conflict between the javax.ws.WebService annotation in the XFire library and the ejb3-all.jar.
I certainly understand that the WS code is part of JEE 5, but can I safely remove that package as long as I don't attempt to use any of those features?
Let me say that I'm almost 100% sure it's a problem with the XFire library, but I have to use the code regardless. I also understand that this might be more appropriate in the EJB3 forum but having looked at the EJB3 package they don't create an ejb3-all bundle, that appears to be a SEAM specific bundling.
So, anyways, an help on this would be greatly appreciated.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995871#3995871
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995871
19 years, 7 months
[JBoss Seam] - Re: Seam And ICEFaces menubar
by Newlukai
Perhaps you should return something? And not null. Or you change the scope to APPLICATION?
Here's my menu bean:
@Stateless
| @Name("sideNavigationMenu")
| @Scope(ScopeType.APPLICATION)
| public class SideNavigationMenu implements SideNavigation {
| @In
| private FacesContext facesContext;
|
| @In @Valid
| private User user;
|
| public List<MenuItem> getPanelNavigationItems() {
| List<MenuItem> menu = new ArrayList<MenuItem>();
|
| // generate menu
|
| return menu;
| }
And the JSF:
<ui:define name="sidebar">
| <ice:form>
| <ice:menuBar orientation="vertical">
| <ice:menuItems value="#{sideNavigationMenu.panelNavigationItems}" />
| </ice:menuBar>
| </ice:form>
| </ui:define>
But I've another problem: As soon as I click on a menu item, an ICEfaces dialog pops up telling me the session is expired. What's that?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995866#3995866
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995866
19 years, 7 months
[JBoss jBPM] - Re: Sending Emails?
by jainer
Hi:
This is a code to send mails.. obviously you must to have your own mail jar
| package controlcorrespondencia.handlers.actions;
|
| import java.util.Iterator;
|
| import javax.naming.*;
| import javax.rmi.PortableRemoteObject;
|
| import org.apache.commons.logging.Log;
| import org.apache.commons.logging.LogFactory;
|
| import org.jbpm.graph.def.ActionHandler;
| import org.jbpm.graph.exe.ExecutionContext;
| import org.jbpm.taskmgmt.exe.TaskInstance;
|
| import com.sumset.beesoft.correo.ServicioCorreoHome;
| import com.sumset.beesoft.correo.ServicioCorreo;
| import com.sumset.beesoft.correo.CorreoVO;
|
| public class Correo implements ActionHandler{
|
| ServicioCorreoHome miServicioCorreoHome;
| ServicioCorreo miServicioCorreo;
|
| public void execute(ExecutionContext executionContext){
| String processDefinitionName = executionContext.getProcessDefinition().getName();
|
| Iterator iterTask = executionContext.getTaskMgmtInstance().getTaskInstances().iterator();
|
| while (iterTask.hasNext()) {
| TaskInstance nextTask = (TaskInstance) iterTask.next();
|
| if(nextTask.isSignalling()){
|
| long idTarea = nextTask.getId();
| String nombreTarea = nextTask.getName();
| String usuario = nextTask.getActorId();
| String asunto = nextTask.getName();
|
| try{
|
| Context context = new InitialContext();
| Object servicioCorreo = context.lookup("ServicioCorreo");
| miServicioCorreoHome = (ServicioCorreoHome) PortableRemoteObject.narrow(servicioCorreo, ServicioCorreoHome.class);
| miServicioCorreo = miServicioCorreoHome.create();
|
| String origen = "f-aristi(a)sumset.com";
| String destino = "jquiceno(a)sumset.com";
| String Url = "http://localhost:8080/jbpm/faces/otroLogin.jsp?idTarea=" + idTarea +
| "&usuario=" + usuario + "&nombreProceso=" + processDefinitionName;
|
| String mensaje = "<a href=\"" + Url + "\" target=\"_blank\" "+
| "title=\"Este enlace externo se abrirá en una nueva ventana\">" +
| nombreTarea + "</a>";
|
| CorreoVO correo = new CorreoVO(origen,destino,asunto,new java.util.Date(),"1",mensaje,"sistema");
| miServicioCorreo.enviarCorreo(correo);
|
| log.debug("correo enviado");
|
| }catch (Exception e){
| System.out.println("Se produjo un error en la inicialización del servicio de correo:");
| e.printStackTrace();
| }
| }
| }
|
| }
|
| private static final Log log = LogFactory.getLog(Correo.class);
|
| }
|
| <task-node name="Envio Correspondencia">
| <task name="Despachar Correspondencia" swimlane="secretaria auxiliar">
| <controller>
| <variable name="ipTTN6Comentario" access="read,write,required" mapped-name="Comentario"/>
| </controller>
| </task>
| <event type="after-signal">
| <action name="Enviar Correo" class="controlcorrespondencia.handlers.actions.Correo"></action>
| </event>
| <transition name="" to="Verificacion"></transition>
| </task-node>
|
Regards
jainer e.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995861#3995861
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995861
19 years, 7 months
[JBoss Portal] - JBoss Portal 2.4 and MySQL UTF-8 problems
by wgross
The problem:
JBoss Portal installation fails to create a variety of required tables, specifically those tables required for the CMS system. This causes Portal to either fail to load, or to load, but throw an exception when the administrator tries to log in for the first time (using the admin/admin login).
The cause:
The current version of MySQL (and most/all prior versions) do not support key lengths greater than 1000 bytes. If MySQL is configured to use utf8 by default, key lengths can exceed 1000 bytes (in the worst case, one utf8 character can require up to 3 bytes). This problem is documented at http://bugs.mysql.com/bug.php?id=4541.
My environment:
JBoss Portal 2.4.1-CR2 (binary distribution)
JBoss AS Version 4.0.5.GA (installed using the JEMS installer)
MySQL 5.0.21-2.FC5.1
JDBC MySQL Connector 5.0.4 (mysql-connector-java-5.0.4-bin.jar)
Linux kernel 2.6.15-1 (Fedora Core 5)
How I fixed the problem:
To fix the problem, I had two options. I could either edit my MySQL configuration file to change MySQL's default character set, or I could define a different character set for the JBossPortal table. I chose to change the default character set for the JBossPortal table. To do this, I took the following steps:
1) Delete the old Portal database, and create a new one with a different character set:
mysql -p
| mysql> drop database jbossportal;
| mysql> create database jbossportal DEFAULT CHARACTER SET latin1 COLLATE latin1_bin;
| mysql> GRANT ALL PRIVILEGES ON jbossportal.* TO jbossportal@localhost IDENTIFIED BY 'password' WITH GRANT OPTION;
| mysql> FLUSH PRIVILEGES;
| mysql> exit;
2) Delete old installation configuration files:
rm $JBOSS_HOME/server/default/work -R
| rm $JBOSS_HOME/server/default/tmp -R
| rm $JBOSS_HOME/server/default/data -R
| rm $JBOSS_HOME/server/default/log -R
3) Start JBoss
$JBOSS_HOME/bin/run.sh start
Assuming all configuration files are set up correctly, this should fix the problem. Note that this was all done while JBoss AS was not running. Also, a different character set could be used as needed. I chose latin1.
Unfortunately, there seems no way to allow JBoss Portal to use utf-8 without changing the JBoss Portal table structures. This is due to a limitation in MySQL. This limitation appears to be only in MySQL, and not in other products (MSSQL/PostgreSQL/etc.)
Be sure that in your configuration files you've implemented the truncation fix at http://wiki.jboss.org/wiki/Wiki.jsp?page=AvoidMySQL5DataTruncationErrors
Also, be sure to use the correct driver class in your portal-mysql-ds.xml file. For the MySQL JDBC Connector, use "com.mysql.jdbc.Driver".
Make sure you have a copy of the MySQL JDBC Connector in your $JBOSS_HOME/server/default/lib/ directory. You can get a copy of the Connector from http://www.mysql.com/products/connector/j/. More information about setting MySQL and JBoss is available at http://wiki.jboss.org/wiki/Wiki.jsp?page=SetUpAMysqlDatasource
My configuration files:
1) $JBOSS_HOME/server/default/deploy/portal-mysql-ds.xml
<?xml version="1.0" encoding="UTF-8"?>
| <datasources>
| <local-tx-datasource>
| <jndi-name>PortalDS</jndi-name>
| <connection-url>jdbc:mysql://localhost:3306/jbossportal?useServerPrepStmts=false&jdbcCompliantTruncation=false</connection-url>
| <driver-class>com.mysql.jdbc.Driver</driver-class>
| <user-name>jbossportal</user-name>
| <password>password</password>
| </local-tx-datasource>
| </datasources>
2) /etc/my.cnf
[client]
| default-character-set=utf8
|
| [mysqld]
| datadir=/mnt/raid/var/lib/mysql
| socket=/mnt/raid/var/lib/mysql/mysql.sock
| # Default to using old password format for compatibility with mysql 3.x
| # clients (those using the mysqlclient10 compatibility package).
| old_passwords=1
| default-character-set=utf8
|
| [mysql.server]
| user=mysql
| basedir=/mnt/raid/var/lib
|
| [mysqld_safe]
| log-error=/var/log/mysqld.log
| pid-file=/var/run/mysqld/mysqld.pid
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995853#3995853
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995853
19 years, 7 months
[JBoss Eclipse IDE (users)] - Re: How contribute to Freemarker plugin and add my Plugin ec
by azerr
anonymous wrote : I saw JBIDE-428, is that what you refer to ? It's not a patch it is the complete project...
I have post a comment.
anonymous wrote : What do you mean "another architecture" ? Have you even tried to use the tools and looked at the code to see how it works ?
For me architecture is the pattern of your Application (Service, DAO)
each people have their own architecture and implementation :
Architecture example :
Architecture 1 : Service call DAO which returns Bean (from hibernate)
and Service returns the Bean (after detach it to session)
Architecture 2 : Service call DAO which returns Bean (from hibernate)
Servive build DTO by using Bean and it returns the DTO.
Implementation example
DAO can be implements with JDBC or Hibernate,....
According to the architecture the Eclipse WizradPage must be different (parameters (package name, import classes ...) of the template are different).
Plesae let me a little time to study Hibernate Tool.
anonymous wrote : Maybe it is your vocabulary I just don't get; e.g. what is an "XML componeent" ? And if I need to write XML + a template what is saved here ?
XML Components is XML desciption of the Eclipse WizardPage (which parameters must be displayed). When you click to Finish Buton, the generation is launched, by merging a template (set in the XML Component)
, the XML file selected (hbm, OR OTHER XML FILE), and the parameters (fileds of the WizardPage).
XML Wizard is composed with several XML Component. You can synchronize parameters of one XML component with another XMl Component. (eg : you have XML Component for generate Struts ActionForm, and XML Component for generate XML struts-config). You can create a XML Wizard composed with the two XML COmponents and you can synchronyze className parameter of XML Component struts-config with XML Component ActionForm. When you change the parameter className of the XML Component ActionForm, it will change to for struts-config.
Akrogen is not mature, and my documentation is very poor. But I search another people which will interest with Akrogen. I have a lot of idea, but I would like discuss with another people.
Please let me time to write Akrogen documentation. After I hope that Akrogen will please you.
Regards Angelo
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995848#3995848
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995848
19 years, 7 months
[Persistence, JBoss/CMP, Hibernate, Database] - Re: Remove item from CMR
by murtuza52
The correct way to remove an item from the OneToMany relation is as follows:
| @Entity
| public class A
| {
| private Collection<B> bees;
| @OneToMany (mappedBy="a")
| public Collection<B> getBs()
| {
| return bees;
| }
| public void setBs(Collection<B> b)
| {
| this. bees = b;
| }}
|
| @Entity
| public class B
| {
| private A a;
| @ManyToOne
| public A getA()
| {
| return a;
| }
| public void setContact(A a)
| {
| this.a = a;
| }}
|
The remove method will look like this in SLSB or SFSB
|
| public void removeAllB(){
| for(B b1: a.getBs()){
| b1.setContact(null);
| }
| manager.merge(a);
| }
|
Please note in EJB3 the merge method will mark A with null in column for a. This will not remove the record from the database. This must be done using other hibernate specific tags like DELETE_ORPHAN in OneToMany relations or through other techniques.
Murtuza
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995847#3995847
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995847
19 years, 7 months
[JBoss Messaging] - Failed
by hendra_netm
Hi all,
I just installed jboss messaging 1.2.0 beta1 and try the queue-failover example.
When it tried to copy application-server-killer.jar, I get this message
| --- Packages waiting for a deployer ---
| org.jboss.deployment.DeploymentInfo@9dae65fe { url=file:/C:/jboss/server/messaging-node0/deploy/application-server-killer.jar }
| deployer: null
| status: null
| state: INIT_WAITING_DEPLOYER
| watch: file:/C:/jboss/server/messaging-node0/deploy/application-server-
| killer.jar
| altDD: null
| lastDeployed: 1166785410910
| lastModified: 1166785410910
| mbeans:
|
What do I need to do in order to be able to deploy this jar?
Because I cannot use the jar, I tried to shutdown the server manually. So I used two messaging servers. After I receive first message, I shut down the messaging-node0 (my first messaging server).
Then I get this message in client-side :
| [java] 12:01:02,196 WARN @Thread-3 [HAAspect] Client attempted failover, but no failover attempt has been detected on the server side.
|
And in the failover node, I get this message:
| 12:00:59,152 INFO [ServerPeer] ServerPeer[1] waiting for server-side failover for failed node 0 to complete
| 12:01:02,156 INFO [ServerPeer] ServerPeer[1] already waited long enough for failover to start, giving up
|
I don't know what should I do to make the server failover works. Can Anybody point it out?
Regards,
Hendra
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995841#3995841
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995841
19 years, 7 months
[JBossCache] - Re: java.lang.RuntimeException: java.lang.NoSuchMethodExcept
by jagadeeshvn
I am not using jboss-aspect-library-jdk50.jar in my project. However I understand that the problem is with AOP and so I checked out the latest AOP source from SVN and build it locally. Now I am using that jar and I found that 3 additional interceptions are defined somewhere in the unix deployment and the details are as below.
1. public abstract void org.jboss.aspects.patterns.observable.Subject.addObserver(org.jboss.aspects.patterns.observable.Observer)
2. public abstract void org.jboss.aspects.patterns.observable.Subject.removeObserver(org.jboss.aspects.patterns.observable.Observer)
3. public abstract void org.jboss.aspects.patterns.observable.Subject.notifyObservers()
The framework is unable to find the method definition and it throws an excpection to populateMixinMethods where it propogates to attachClass method in org.jboss.aop.ClassAdvisor and it is not caught anywhere.
However I understand that the solution is to remove the additional interceptions as it is not available in Windows deployment and still it works fine. I am doing more research and will get back with more details and the exact problem.
Thanks
Jugs
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995835#3995835
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995835
19 years, 7 months
[JBoss Seam] - session handling of users
by ask4saif
Greetings to all:
I am making an application with jboss-seam, I have a problem with session handling of users.
I am using a stateful session bean which is authenticating users from db. this bean has two fields in it username and password. on authentication I destroy the password and use username for the session tracking on JSF pages. In jsf pages i use JSTL tags to verify the user if he is logged in or not.
Now my problems are:
how can i restrict users from unauthorized access of pages.
how can i redirect users to login page if their username does not exist in the session.
how can i check if the form is submitted illeaglly.
And in the last, am i following the right approach or there is a better way to do this in seam.
i congrat gavin king on his great work and thank you all in advance.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995834#3995834
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995834
19 years, 7 months
[JBoss Seam] - Re: Change Locale sequence
by rengar
-Page:
| <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
| "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
| <html xmlns="http://www.w3.org/1999/xhtml"
| xmlns:ui="http://java.sun.com/jsf/facelets"
| xmlns:h="http://java.sun.com/jsf/html"
| xmlns:f="http://java.sun.com/jsf/core"
| xmlns:s="http://jboss.com/products/seam/taglib"
| xmlns:a="https://ajax4jsf.dev.java.net/ajax"
| xmlns:ice="http://www.icesoft.com/icefaces/component">
| <head>
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
| <title>Reservas</title>
| <link href="stylesheet/theme.css" rel="stylesheet" type="text/css" />
| <link href="stylesheet/#{inicio.asociacion.hojaEstilos}" rel="stylesheet" type="text/css" />
| <script language='javascript' src='js/calendario/popcalendar.js'></script>
| </head>
|
| <body>
|
| <table border="0">
| <tr>
| <td align="center"><h:graphicImage id="banner" url="img/banners/#{inicio.asociacion.banner}" /></td>
| </tr>
| <tr>
| <td class="texto">
| <h:outputText value="#{messages['inicio.page.desc1']}" escape="false"/>
| </td>
| </tr>
| <tr class="headerBarClara" align="center">
| <td class = "textoBlanco" align="center">
| <h:outputText value="#{messages['inicio.page.titulo']}" escape="false"/>
| <h:form id="selectLanguage">
| <h:selectOneMenu value="#{localeSelector.language}">
| <f:selectItems value="#{localeSelector.supportedLocales}"/>
| </h:selectOneMenu>
| <h:commandButton action="#{localeSelector.select}" value="#{messages['ChangeLanguage']}"/>
| </h:form>
| </td>
| </tr>
| <tr>
| <td align="center" class="texto">
| <h:messages globalOnly="true" styleClass="message"/>
|
| <h:form id="inicio">
| <div>
| <s:validateAll>
| <div>
| <s:decorate>
| <h:outputLabel for="diaLlegada">#{messages['inicio.page.param.diaLlegada']}</h:outputLabel>
| <h:inputText id="diaLlegada" value="#{inicio.diaLlegada}" required="true">
| <s:convertDateTime pattern="dd/MM/yyyy"/>
| <a:support event="onblur" reRender="checkinDateErrors"/>
| </h:inputText>
| <img src="img/dtpick.gif" style="margin-left:5px" onClick="javascript:popUpCalendar(this, document.forms['inicio'].elements['inicio:diaLlegada'], 'dd/mm/yyyy')"/>
| <br/>
| <a:outputPanel id="checkinDateErrors"><s:message/></a:outputPanel>
| <!--
| <s:decorate>
| <ice:selectInputDate id="diaLlegada2" value="#{inicio.diaLlegada}" renderAsPopup="true" partialSubmit="true"/>
| <br/>
| <s:message/>
| </s:decorate>
| -->
| </s:decorate>
| </div>
|
| <div>
| <s:decorate>
| <h:outputLabel for="diaSalida">#{messages['inicio.page.param.diaSalida']}</h:outputLabel>
| <h:inputText id="diaSalida" value="#{inicio.diaSalida}" required="true">
| <s:convertDateTime pattern="dd/MM/yyyy"/>
| <a:support event="onblur" reRender="checkoutDateErrors"/>
| </h:inputText>
| <img src="img/dtpick.gif" style="margin-left:5px" onClick="javascript:popUpCalendar(this, document.forms['inicio'].elements['inicio:diaSalida'], 'dd/mm/yyyy')"/>
| <br/>
| <a:outputPanel id="checkoutDateErrors"><s:message/></a:outputPanel>
| </s:decorate>
| </div>
|
| </s:validateAll>
| </div>
| <div class="actionButtons">
| <h:commandButton id="inicio" value="#{messages['inicio.page.buscar.button']}"
| action="#{inicio.inicio}"/>
| <h:commandButton id="buscarAvanzado" value="#{messages['inicio.page.buscarAvanzado.button']}"
| action="#{inicio.listado}"/>
| <h:commandButton id="borrar" value="#{messages['inicio.page.borrar.button']}"
| action="#{inicio.inicio}"/>
| <s:link id="listado" value="#{messages['inicio.page.buscarAvanzado.button']}"
| action="#{inicio.listado}"/>
| </div>
| </h:form>
|
| </td>
| </tr>
| <tr class = "headerBarClara">
| <td height="16"></td>
| </tr>
| <tr>
| <td align="center" class="texto">
| <h:outputText value="#{inicio.asociacion.explicacion}" escape="false"/>
| </td>
| </tr>
| </table>
|
| </body>
| </html>
|
|
-Action:
|
| package com.minalink.reservas;
|
| import java.util.ArrayList;
| import java.util.List;
| import javax.ejb.Remove;
| import javax.ejb.Stateful;
| import javax.persistence.EntityManager;
| import javax.persistence.PersistenceContext;
| import org.hibernate.validator.Length;
| import org.jboss.seam.annotations.Name;
| import org.jboss.seam.annotations.In;
| import org.jboss.seam.annotations.Destroy;
| import org.jboss.seam.annotations.Logger;
| import org.jboss.seam.framework.EntityQuery;
| .
| .
| .
| import org.jboss.seam.log.Log;
| import org.jboss.seam.core.FacesMessages;
| import org.jboss.seam.core.Locale;
| import org.jboss.seam.core.LocaleSelector;
|
| @Stateful
| @Name("inicio")
| public class InicioBean implements Inicio {
|
| @Logger private Log log;
|
| @In
| FacesMessages facesMessages;
|
| @PersistenceContext
| private EntityManager em;
|
| AsociacionesLangHome asociacionesLangHome;
|
| private String diaLlegada;
|
| private String diaSalida;
|
| private int asociacionesId;
|
| private AsociacionesLang asociacion;
|
|
| //seam-gen method
| public String inicio() {
|
| log.info("inicio.inicio() action called with: #0 #1", diaLlegada, diaSalida);
| facesMessages.add( "inicio #0, #1", (Object) diaLlegada, (Object) diaSalida );
|
| return "success";
| }
|
| //add additional action methods
|
| @Length(max=10)
| public String getDiaLlegada() {
| return diaLlegada;
| }
|
| public void setDiaLlegada(String diaLlegada) {
| log.info("diaLlegada: #0 ", diaLlegada);
| this.diaLlegada = diaLlegada;
| }
|
| @Length(max=10)
| public String getDiaSalida() {
| return diaSalida;
| }
|
| public void setDiaSalida(String diaSalida) {
| log.info("diaSalida: #0 ", diaSalida);
| this.diaSalida = diaSalida;
| }
|
| public void setAsociacionesId(int asociacionesId) {
| this.asociacionesId = asociacionesId;
|
| String language = Locale.instance().getLanguage();
| System.out.println( "language : "+ language );
|
| asociacionesLangHome = new AsociacionesLangHome();
|
| AsociacionesLangId id = new AsociacionesLangId(asociacionesId, language);
| asociacionesLangHome.setAsociacionesLangId(id);
|
| try{
| this.setAsociacion(asociacionesLangHome.getInstance());
| }catch(Exception e){
| System.out.println( "asociacionesId: "+ asociacionesId );
| System.out.println( "language error: "+ language );
|
| LocaleSelector.instance().selectLanguage(ConfiguracionCte.DEFAULT_LANG);
| language = Locale.instance().getLanguage();
| System.out.println( "language 2 : "+ language );
|
| id = new AsociacionesLangId(asociacionesId, language);
| asociacionesLangHome.setAsociacionesLangId(id);
|
| this.setAsociacion(asociacionesLangHome.getInstance());
| }
| }
|
| public int getAsociacionesId() {
| return asociacionesId;
| }
|
| @Destroy @Remove
| public void destroy() {}
|
| public AsociacionesLang getAsociacion() {
| return asociacion;
| }
|
| public void setAsociacion(AsociacionesLang asociacion) {
| this.asociacion = asociacion;
| }
|
| }
|
When I change language the page is reload --> method setAsociacionesId is called.
But catch previous language value to change language.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995832#3995832
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995832
19 years, 7 months
[JBoss Eclipse IDE (users)] - Re: How contribute to Freemarker plugin and add my Plugin ec
by max.andersen@jboss.com
"azerr" wrote : anonymous wrote : Yes, I received it; but please send it as a *patch*.
| That's done.
|
I saw JBIDE-428, is that what you refer to ? It's not a patch it is the complete project...
anonymous wrote : We don't have those implemented (except "bean), but nothing in the tools prevents it.
Is it easy to change default architecture (bean) with another architecture? With Akrogen you can create your own Project (MyJ2EE project) and add it component, wizard, for your architecture.
What do you mean "another architecture" ? Have you even tried to use the tools and looked at the code to see how it works ?
anonymous wrote :
| anonymous wrote : I don't get your "bulk" argument here ? Hibernate tools defaults to generate for all entities and components but that can of course be controlled by the exporter if you want to.....and adding a "generate only *this* part" is of course possilbe....
|
| My explanation was not enough good. Imagine you want create finder DAO
| with specific criteria (findByCountryId). With Akrogen you can create XML component which generate this method. For this, you must create a template (XSL, Freemarker), and create a XML component MyComponent (parameters IN criteria => XML => display list of your hbm property into the list checkable).
|
| When you select the hbm (menu AKROGE->Components->MyComponent) , the XML component will display a Wizard page, with all property of your hbm. you check Id property and click finish, your DAO findByCountryId will be generated.
|
Maybe it is your vocabulary I just don't get; e.g. what is an "XML componeent" ? And if I need to write XML + a template what is saved here ?
I still think your work about "wizards" for the code generation is something we can/could use.
anonymous wrote :
| anonymous wrote : tip: If you want users to understand Akrogen features you should try and document it with some better examples, the current page is very sparse on information.
|
| I agree with you my documentation is very bad. I have a lot of development for Akrogen (ex : I work to export Freemarker Plugin context .freemarker-ide.xml and build auomaticly Akrogen XML component).
| I'm searching people to help me to develop Akrogen and write documentation, but it's very difficult.
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995831#3995831
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995831
19 years, 7 months