[jboss-user] [Javassist] - Adding interface to an existing class

2011-06-05 Thread mnrz
mnrz [http://community.jboss.org/people/mnrz] created the discussion

Adding interface to an existing class

To view the discussion, visit: http://community.jboss.org/message/608679#608679

--
Hi 

I have a class which is in legacy system and we cannot change the class. I need 
to create a java proxy for that class but this is a class without interface. So 
I have created an interface and write the following code to add this interface 
to that class at runtime but the class.getInterfaces() method still returns no 
interface!

--
public class Main {



    public static void main(String[] args) throws Exception {
    //@SuppressWarnings(rawtypes)
    createInterface();
    AnAbstractClass instance = new 
AClassFromAbstract();//instance.getClass().getInterfaces()
    Object proxy = 
Proxy.newProxyInstance(ProxyIntAnAbstractClass.class.getClassLoader(), 
    new Class[] {ProxyIntAnAbstractClass.class},
    new MyInvocationHandler(instance));

    ProxyIntAnAbstractClass instance2 = (ProxyIntAnAbstractClass) proxy;
    instance2.doSomething();
    instance2.doSomethingElse();
    }

    public static Class createInterface() throws Exception{
    ClassPool pool = ClassPool.getDefault();
    ClassPath cp = new ClassClassPath(AnAbstractClass.class);
    pool.insertClassPath(cp);
    pool.importPackage(com.macquarie.test.proxy);

    CtClass myinterface = 
pool.get(com.mmm.test.proxy.ProxyIntAnAbstractClass);


    CtClass tclass = pool.getCtClass(com.mmm.test.proxy.AnAbstractClass);
    tclass.setInterfaces(new CtClass[] {myinterface});
    tclass.rebuildClassFile();
    tclass.detach();
    return myinterface.toClass();


    }
}

--

When I execute this code, since the ProxyIntAnAbstractClass is not interface of 
AnAbstractClass, InvocationHandler complains that the object is not an instance 
of declaring class

Can you please help me on this?
--

Reply to this message by going to Community
[http://community.jboss.org/message/608679#608679]

Start a new discussion in Javassist at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1containerType=14container=2062]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - question about exception and rollback

2008-11-02 Thread mnrz
Hello

Each application exception will cause the transaction to be rolled back but 
what if we set an interceptor say ExceptionInterceptor to catch all the 
exception and set the error codes and messages to outgoing DTOs. 

Because our DTO classes have a super class in which a response object is 
featured so any exception in ExceptionInterceptor can be transated into our 
standard format. As I understand because we catch the exception and set the 
required values to response and the method proceeds normally no rollback 
occurrs.

We are using container managed transactions so how we can mark the transaction 
to be rolled back?

thanks

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4186216
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - Re: Using EntityManager in a abstract super class

2008-10-30 Thread mnrz
skajotde wrote : My team problem like this resolve with inheritance.
  | 
  | 

Thanks Kamil
Actually we ended up with something like that. I've created a setter method for 
EntityManager and in @PostConstruct method I set the entity manager, however I 
don't like this sort of approaches but we had to :)

I think it's very useful if they provide an annotation for injections with 
local JNDi names 


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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4185804
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - Re: Using EntityManager in a abstract super class

2008-10-30 Thread mnrz
ALRubinger wrote : 
  | @Resource.mappedName ?
  | 
  | S,
  | ALR

Yes, I'm thinking of something like this:


  | 
  | public abstract class GeneralDataAccessManipulator {
  | 
  |   @PersistenceContext(unitName = common-unit)
  |   EntityManager em;
  | }
  | 
  | @Resource(mappedName = common-unit, name=pu-cm, EntityManager.class)
  | public class AccountDataAccessManipulator extends 
GeneralDataAccessManipulator implements AccountDAO {
  | 
  |//...
  | }
  | 
  | 

I've tested this but it didn't work.

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4185820
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - Using EntityManager in a abstract super class

2008-10-26 Thread mnrz
Hello

we have an interface say, DataAccessManipulator. since the method save(), 
delete() and update() are common for all the DAO classes we have created a 
GeneralDataAccessManipulator as an abstract class in which those methods have 
been implemented using EntityManager:


  | public abstract class GeneralDataAccessManipulator implements 
DataAccessManipulator {
  | 
  | @PersistenceContext
  | private EntityManager entityManager;
  | 
  | public void delete(Object entity) {
  | if (!entityManager.contains(entity)) {
  | entity = doMerge(entity);
  | }
  | try {
  | doDelete(entity);
  | } catch (Exception e) {
  | e.printStackTrace();
  | }
  | //entityManager.flush();
  | }
  | 
  | //rest of the code...
  | }
  | 

now this class and many others are located in a jar file namely common-j2ee.jar

because there are many project in the company that are developing at the same 
time we shared this recent jar file for all other projects.

the problem is in our application we have to specify the unitName for the 
PersistenceContext and in another application this name may be different
and because in the GeneralDataAccessManipulator we didn't specify unitName the 
app won't be deployed and of course if we set it, other apps will encounter the 
problem

my question is if we can set that unitName in a way according to the 
applciation persistence unit.

I've read something about @EJBS on class declaration but didn't understand it 
really. Can we make use of that?

I am thinking of giving a specific unitName to the @PersistenceContext defined 
in abstract class an then inject the EM inside my app and set it as the name 
specified above in the SB I am using. Is this possible?



thanks for your help


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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4184675
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - Re: Using EntityManager in a abstract super class

2008-10-26 Thread mnrz
jaikiran wrote : I understand what you are trying to do here. There was a 
similar question sometime back on this forum 
http://www.jboss.com/index.html?module=bbop=viewtopict=134276. See if using 
@Resource as mentioned in that thread is a feasible approach. That way, each 
application can have their own persistence unit name but bind them to this 
pre-decided JNDI name and inject it.
  | 
  | 

Thanks Jaikiran, but what if we use say Glassfish instead of JBoss? this 
solution seems to be working on JBoss only. I know the designers don't accept 
this solution because they want the application to be portable

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4184677
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - Re: How to pass PersistenceUnit name at run time

2008-10-26 Thread mnrz
ALRubinger wrote : Annotation metadata must be available to the compiler, so 
it is impossible to inject this way if you depend upon a runtime value.
  | 
  | If you're not using bleeding-edge builds (ie. trunk), you may instead look 
up the EMF or EM in JNDI if you opt to bind them there:
  | 
  | http://docs.jboss.org/ejb3/app-server/tutorial/jndibinding/jndi.html
  | 
  | S,
  | ALR
  | 
  | 

Hi
this solution works in JBoss only, is there any other way so the application 
becomes portable across the App servers.

would you have a look at my topic?
http://www.jboss.com/index.html?module=bbop=viewtopict=144560start=0postdays=postDayspostorder=postOrderhighlight=highlight

thanks

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4184679
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [J2EE Design Patterns] - An interface with multiple implementation

2008-09-30 Thread mnrz
Hi
I am going to create an interface named ReusablePool, this is considered to be 
implemented as an object pool 

now because our application may deploy in any application server such as 
Glassfish or Websphere etc, depend on what our customer requires to be. so I 
have to desgn it in a way so we can use the features of the application 
servers. 
this is the issue for using Thread pools as well. since we have an interface 
for using thread pools and we need to use application servers features. 

I want to know the best design that we can set some configuration in a config 
xml file, say, maximum pool size, jndi name to look it up, etc and the 
developer does not worry about the implementation and just think of his code.

any help would be appreciated 

thanks

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4179493
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - EJB3.0 and a distributed environment

2008-09-30 Thread mnrz
Hi

We are using EJB3.0 and my question is if there are any restriction or 
programming tips to run our application in a clustered environment.

would you please share your experience with us or introduce any reference or 
manual we can find it there

thanks

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4179494
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Clustering/JBoss] - programming tips in a clustered environment

2008-09-30 Thread mnrz
Hi
I need to know if there are any restriction or programming tip so our 
application can be deployed in a clustered environment.
We are using EJB3.0 and webservices and also we have JMS in our application. 

would you please share your experience on this issue. 
thanks

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4179513
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - need help on interceptors and suspending specific threads

2008-08-26 Thread mnrz
Hi

We are using EJB3 and we've created an interceptor to check whether the user 
has already sent a request or not. 
if we noticed that the user has already sent a request then in this interceptor 
we need to suspend that thread and wait till the former request being completed 
otherwise the thread will proceed. This suspension should be applied if the 
same user has already a request and for other users this is not the case.

in order to find whether or not a user has sent a request, each time a request 
comes, we store its user id in a Map structure.

here is the body of our interceptor


  | 
  | public class ConcurrectBankingTransaction {
  | 
  | private static MapLong,Condition users = new 
HashMapLong,Condition();
  | private static final Lock lock = new ReentrantLock();
  | 
  | @AroundInvoke
  | public Object check(InvocationContext context) throws Throwable {
  | Object result = null;
  | if(context.getParameters() == null) {
  | //TODO what
  | }
  | Object obj = context.getParameters()[0];
  | String cmSessionId = null;
  | cmSessionId = ((BaseDto)obj).getCmSessionId();
  | Long userId = null;
  | if (cmSessionId == null) {
  | if(obj instanceof LoginDto) {
  | UserInfoDto entity = findUser((LoginDto) obj);
  | if (entity != null) {
  | userId = entity.getId();
  | }else {
  | //TODO what to do...
  | }
  | }else {
  | //TODO what to do...
  | }
  | }else {
  | try {
  | userId = 
(CurrentSessionData.getUserId(cmSessionId));
  | } catch (ChannelManagerException e) {
  | //TODO handle the exception here...
  | e.printStackTrace();
  | }
  | }
  | 
  | //acquires the lock
  | lock.lock();
  | try {
  | if(contains(userId)) {
  | final Condition inProcessTransaction = 
getLockForUserId(userId); 
  | while (contains(userId)) {
  | try {
  | //this releases the lock and 
causes the current thread to be waiting...
  | 
inProcessTransaction.await(2000, TimeUnit.MILLISECONDS);
  | } catch (InterruptedException e) {
  | // It's OK
  | }
  | }
  | addUserId(userId,inProcessTransaction);
  | }else {
  | addUserId(userId,lock.newCondition());
  | }
  | }finally {
  | lock.unlock();
  | }
  | 
  | try {
  | result = context.proceed();
  | }catch (Throwable e) {
  | //any throwable supposed to be caught to release the 
previous lock condition
  | getLockForUserId(userId).signal();
  | removeUserId(userId);
  | throw e;
  | }
  | 
  | //notifying the condition to proceed the awaiting thread
  | getLockForUserId(userId).signal();
  | removeUserId(userId);
  | return result;
  | }
  | 
  | 

now, I am skeptical on the way this works. I just created this interceptor 
based on information gathering through the internet and not sure that works 
fine. Unfortunately, I can't create a situation in which we can test the system.

I have seen a CountDownLatch but I fear to use that because no knowledge I have 
about that.

I appreciate if you can help me on this or if you have any other idea on how to 
suspend other threads

thank you very much

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4172732
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - Re: need suggestion in EJB based application design

2008-05-28 Thread mnrz
any idea?

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4154066
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - need suggestion in EJB based application design

2008-05-23 Thread mnrz
Hi Experts,
I need your suggestions and idea regarding the scenario we have designed for 
our EJB-based Banking system. I would appreciate if you give me advice and/or 
share your experience on this.

In our Banking System, we've got a Central Bank Manager in which we have 
provided all the bank services such as transferring money, returning balance, 
paying bills etc. and other subsystems say, Internet Bank or Telephone Bank 
will be served through this Central Bank Manager. The old Manager was developed 
in a very poor designation and now we are going to develop it using EJB. 

The scenario we are currently consider is to developing each banking services 
as an session object. Actually, we have two kind of services, Loginless 
services that needs no authentication and even authorization and Loginfull 
services which requires that the customer first log in and then uses any 
available service that desires. 

I assume the former services as Stateless session bean while the later ones as 
stateful session beans. 

My Idea is that we can provide a Login SFSB in which we have a login() business 
method that have been tagged with @Init and a logout() method tagged with 
@Remove. Also, this SFSB has a getService(ServiceType) method in which we can 
lookup the actual service that the customer needs. 

as an example:

  | 
  | //A servlet from Internet Bank that serves login process
  | 
  | public void doGet(...){
  |   //acquire username and password 
  |  String username = ...
  |  String password = ...
  |  
  |  // lookup Login SFSB remote interface 
  |  BankSession bankSession = ctx.lookup(...);
  | 
  |  Boolean ok = bankSession.login(username,password);
  |  if(ok){
  | httpSession.setAttribute(bankSession, bankSession);
  |   }else{
  |//redirect to an error page
  |throw new Exception(invalid username or password);
  |   } 
  | }
  | 

now if user is authenticated then we store a bankSession in his/her session. 
but inside the BankSession we have a getService() method which is actually a 
service locator that looks up any desired service.


  | @Statefull
  | public class BankSession implements BankSessionRemote{
  |   // to assign a session id
  |   private String sessionId;
  |
  |   @Init
  |public boolean login(){
  |   //code to logging in
  |}
  |   public T extends BankService T getService(ClassT klass){
  |   try{
  | Context c = new InitialContext();
  | Object sessionBean = c.lookup(klass.getName());
  | ((BankService)sessionBean).setSessionId(sessionId);
  | return (T) sessionBean;
  |}catch(NamingException x){
  | return null;
  |}
  |   }
  | 
  |   @Remove
  |   public void logout(){
  | sessionId = null;
  | //rest of codes...
  |   }
  | }
  | 

now, consider in another servlet which is responsible for transferring money we 
have:


  | public class TransferServlet{
  |  public void doGet(...){
  |   BankSession bankSession = 
httpSession.getAttribute(bankSession);
  |   Transfer transfer = 
bankSession.getService(Transfer.class);
  |   transfer.execute(...);
  |  }
  | }
  | 

if point is each time the logout() is called or the EJB timed out exception is 
occurred or this session bean is disposed in any way the customer is no longer 
able to get any other service that requires authentication. so in this way, we 
can make sure that everything is working safely.

And one more thing is that because we set the session id through the 
getService() method, neither of those services will work if they are acquired 
individually through the RMI rather than our BankSession SFSB.


But the thing is that I don't know whether or not we can store the session bean 
as an attribute in HttpSession or generally, if we store it in any structure 
and pass that session bean to various classes and servlets, is it still keep 
its own relation with the remote server?

And secondly, Does the locator we provide in getService() method work fine?

I am anxious to know your valuable idea on this and again I appreciate any 
suggestion on this matter.

Thank you very much in advance



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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4152923
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - Re: regarding @PrePersist and ID assignment

2008-04-30 Thread mnrz
jaikiran wrote : 
  | You should be setting the id before calling persist. Why are you trying to 
do that in a callback method?
  | 

thanks for your reply, the thing is that I want to calculate the ID from a 
formula in which I use an algorithm. however, if I set any field other than ID 
it won't work as well

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4147762
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - Re: regarding @PrePersist and ID assignment

2008-04-30 Thread mnrz
well, because my DAO classes may be called from any client and each developer 
may call them from there codes so I don't want to compel them to calculate the 
id each time they are using my service classes or force them to set some fields 
that are not necessary from their point of view. 



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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4147957
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - regarding @PrePersist and ID assignment

2008-04-27 Thread mnrz
Hi all
I have an entity in which I need to assign my own ID to its primary key, 
I put the code to extract the id and set it to the field in a PrePersist 
method, however, the ejb validates the entity before calling that callback 
method so the exception will be thrown 

my question is where should I put this code or how can I say the EJB not to 
validate before persisting!

any comment would be of great help

thanks

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4147047
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - Re: regarding EJBQL and object equality

2008-04-23 Thread mnrz
sorry, I made a mistake
I should use  instead of is not

:)

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4146047
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - regarding EJBQL and object equality

2008-04-22 Thread mnrz
Hi all,

I have a simple query in which I want to select records that meet equality 
condition with an Enum type.

select t from MyEntity t where t.statusType is not StatusType.NEW

StatusType is an enum contains NEW, SENT, ABANDONED 

at first, it was an error, complained that unable to resolve the StatusType so 
I changed it to 
t.statusType is not com.myejb.enums.StatusType.NEW

and it worked fine but now I need to add another condition:

t.statusType is not com.myejb.enums.StatusType.NEW and 
  | t.statusType is not com.myejb.enums.StatusType.SENT
  | 

but the TopLink complains that there is a syntax error near the [com] and she 
can't resolve this query.

how can I test the equality in such way?

thank you all 

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4146028
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - Re: How to use all available ID as primary key?

2008-03-17 Thread mnrz
Thanks Xiaopang,
I will try it

It's near 4 months since I've started EJB3

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4136999
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - How to use all available ID as primary key?

2008-03-16 Thread mnrz
Hi all,

I have a table that in a slice of time, many records may be deleted and 
inserted. the record deletion is physically, this table acts as a pool.

now, I want this table uses deleted IDs for the new records that is going to 
insert, in other words, if IDs say, 23, 55, 77 are deleted, when I try to add 
new record, one of these IDs being opted for this record.

how can I manage this with EJB3? I am welcome if you've got any idea or 
suggestion, or even if you have any experience I appreciate if you share your 
knowledge on this.

thanks

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4136926
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - Re: How to use all available ID as primary key?

2008-03-16 Thread mnrz
xiaopang wrote : how about using sequence  and set the sequence as cycle 

would you please explain more? how to set it as cycle. is this working on all 
databases or only specific DBs?

anyway thanks a lot

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4136932
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss/Spring Integration] - using AspectJ and JBoss

2007-12-25 Thread mnrz
Hello experts,

I am going to use AspectJ and Spring in JBoss AS, would you please show me some 
resources on how to configure AspectJ in JBoss?

Before we migrate to JBoss it was working good but now that we changed the 
Application server it doesn't work.

and JBoss AS 4.2.1

thanks 


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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4115416
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Exception:Transaction is not active

2007-10-27 Thread mnrz
thanks pete.muir you showed me the way

I mark that method with 
@TransactionAttribute(value=TransactionAttributeType.REQUIRES_NEW) and it works 
fine


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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4099574
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Exception:Transaction is not active

2007-10-23 Thread mnrz
shoud it be considered as a bug?

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4097755
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Exception:Transaction is not active

2007-10-23 Thread mnrz
Thanks pete.muir

yes before this exception another exception has been occurred but that is from 
the database and it is another process and should not affect this process

here is the exception before:

  | DEBUG - buildStoredQuery(85) | building StoredQuery object...
  | Hibernate: insert into stored_query (name, username, query, visible_to_all) 
values (?, ?, ?, ?)
  | ERROR - logExceptions(72) | null,  message from server: Duplicate entry 
'null-jack' for key 2
  | javax.persistence.EntityExistsException: 
org.hibernate.exception.ConstraintViolationException: could not inser
  | t: [com.payvand.search.entity.StoredQuery]
  | at 
org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.jav
  | a:555)
  | at 
org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:192)
  | at 
org.jboss.ejb3.entity.TransactionScopedEntityManager.persist(TransactionScopedEntityManager.java:17
  | 5)
  | at 
com.payvand.search.dao.StoredQueryDaoImpl.save(StoredQueryDaoImpl.java:93)
  | 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 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:109)
  | at 
org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
  | at 
org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:37)
  | at 
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:55)
  | at 
org.jboss.seam.interceptors.OutcomeInterceptor.interceptOutcome(OutcomeInterceptor.java:21)
  | at sun.reflect.GeneratedMethodAccessor65.invoke(Unknown Source)
  | at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  | at java.lang.reflect.Method.invoke(Method.java:585)
  | at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
  | at 
org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
  | at 
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
  | at 
org.jboss.seam.interceptors.ConversationInterceptor.endOrBeginLongRunningConversation(ConversationI
  | nterceptor.java:52)
  | at sun.reflect.GeneratedMethodAccessor64.invoke(Unknown Source)
  | at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  | at java.lang.reflect.Method.invoke(Method.java:585)
  | at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
  | at 
org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
  | at 
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
  | at 
org.jboss.seam.interceptors.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:27)
  | 
  | at sun.reflect.GeneratedMethodAccessor63.invoke(Unknown Source)
  | at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  | at java.lang.reflect.Method.invoke(Method.java:585)
  | at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
  | at 
org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
  | at 
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
  | at 
org.jboss.seam.intercept.RootInterceptor.createSeamInvocationContext(RootInterceptor.java:144)
  | at 
org.jboss.seam.intercept.RootInterceptor.invokeInContexts(RootInterceptor.java:129)
  | at 
org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:102)
  | at 
org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:50)
  | at sun.reflect.GeneratedMethodAccessor62.invoke(Unknown Source)
  | at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  | at java.lang.reflect.Method.invoke(Method.java:585)
  | at 
org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
  | at 
org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
  | at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
  | at 
org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManag
  | erInterceptor.java:54)
  | at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
  | at 

[jboss-user] [JBoss Seam] - Re: Exception:Transaction is not active

2007-10-23 Thread mnrz
Thank you very much indeed

just two questions. 
if we mark the class with @Transactional, will it manage all transaction? 

second, is this right?


  | public int save(StoredQuery query) {
  | try {
  | em.getTransaction().begin();
  | em.persist(query);
  | em.getTransaction().commit();
  | return 0;
  | } catch (Exception e) {
  | em.getTransaction().rollback();
  | e.printStackTrace();
  | return -1;
  | }
  | }
  | 
  | 

I change that save() method to rollback transaction to prevent above problem, 
but it throws this exception:

java.lang.IllegalStateException: Illegal to call this method from injected, 
managed EntityManager

what is wrong with this?

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4097866
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - exception doesn't work in pages.xml

2007-10-22 Thread mnrz
Hi

though, I put the following  tag in pages.xml but when this exception is 
thrown, the specified message won't be displayed and an unexpected page which 
is from the browser, is displayed instead.


  | exception class=org.jboss.seam.security.AuthorizationException
  | redirect
  | 
message#{messages['org.jboss.seam.NotAuthorized']}/message
  | /redirect
  | /exception
  | 
  | 

the thing is that in exception stack trace the AuthorizationException is not in 
top of the stack and a ServletException (or something like that) is being seen. 
is this the source of problem?

if yes, what do I have to do?

thanks

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4097466
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Exception:Transaction is not active

2007-10-22 Thread mnrz
Hello

I have a form in which some information will be saved or retrieved from 
database. sometimes, when I am going to save new information, an exception from 
database will prevent from inserting data, for example, in my case, a duplicate 
entry exception is thrown

the problem is after this exception the bean is going to load the data from 
database but it throws this one:


  | ERROR - logExceptions(72) | Transaction is not active: 
tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=null:
  | 1193039491093/144, BranchQual=null:1193039491093, localId=0:144]; - nested 
throwable: (javax.resource.Resource
  | Exception: Transaction is not active: 
tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=null:1193039491093/144
  | , BranchQual=null:1193039491093, localId=0:144])
  | javax.persistence.PersistenceException: 
org.hibernate.exception.GenericJDBCException: Cannot open connection
  | at 
org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.jav
  | a:567)
  | at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:56)
  | at 
com.payvand.search.dao.StoredQueryDaoImpl.loadAll(StoredQueryDaoImpl.java:71)
  | 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 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:109)
  | at 
org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
  | at 
org.jboss.seam.intercept.EJBInvocationContext.proceed(EJBInvocationContext.java:37)
  | at 
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:55)
  | at 
org.jboss.seam.interceptors.OutcomeInterceptor.interceptOutcome(OutcomeInterceptor.java:21)
  | at sun.reflect.GeneratedMethodAccessor65.invoke(Unknown Source)
  | at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  | at java.lang.reflect.Method.invoke(Method.java:585)
  | at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
  | at 
org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
  | at 
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
  | at 
org.jboss.seam.interceptors.ConversationInterceptor.endOrBeginLongRunningConversation(ConversationI
  | nterceptor.java:52)
  | at sun.reflect.GeneratedMethodAccessor64.invoke(Unknown Source)
  | at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  | at java.lang.reflect.Method.invoke(Method.java:585)
  | at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
  | at 
org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
  | at 
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
  | at 
org.jboss.seam.interceptors.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:27)
  | 
  | at sun.reflect.GeneratedMethodAccessor63.invoke(Unknown Source)
  | at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  | at java.lang.reflect.Method.invoke(Method.java:585)
  | at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
  | at 
org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
  | at 
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
  | at 
org.jboss.seam.intercept.RootInterceptor.createSeamInvocationContext(RootInterceptor.java:144)
  | at 
org.jboss.seam.intercept.RootInterceptor.invokeInContexts(RootInterceptor.java:129)
  | at 
org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:102)
  | at 
org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:50)
  | at sun.reflect.GeneratedMethodAccessor62.invoke(Unknown Source)
  | at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  | at java.lang.reflect.Method.invoke(Method.java:585)
  | at 
org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
  | at 
org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
  | at 
org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
  | at 
org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManag
  | erInterceptor.java:54)
  | at 

[jboss-user] [JBoss Seam] - Re: exception doesn't work in pages.xml

2007-10-22 Thread mnrz
ok
I voted for this issue, however, if this is a bug, I think they should have 
fixed it in version 2

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4097691
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - how to check more than one role with @Restrict?

2007-10-16 Thread mnrz
hi

how to allow access for a method to the users that have admin or member 
role and prevent other roles.

we can't place more than one @Restrict on a method. 

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4095472
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Seam nightly builds

2007-10-16 Thread mnrz
sorry I don't know whether this is right place to ask this or not 
but I need to upgrade from 1.1.6 to 1.2 is there any migration guide like Seam 
2 migration?

thanks

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4095474
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user



[jboss-user] [JBoss Seam] - Re: @Unwrap question

2007-10-16 Thread mnrz
Hi all
I have a question about @Unwrap.  
I tried @Unwrap in a test application and as I understood, the whole bean will 
play on behalf of the wrapped context variable. 
for instance if I have method


  | @name(bean)
  | class MyBean {
  | 
  |  @Unwrap
  |  public User getUser(){
  | 
  |  }
  | }
  | 

the bean is referring to an instance of type User, isn't it?

but the thing I want to know is if the values inside a page is changed by the  
user and press submit button, Are these new changes visible at the server side? 
for example, the user changes his address which is a property of class User, 
will this change being applied at context variable inside the MyBean?

thanks


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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4095588
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - why Factory method is calling more than once?

2007-10-15 Thread mnrz
Hi

I have a factory method for a field User in my SB, and I want to know why this 
method is calling as many time as the number of User's field?

in my case, the User has 12 fields do this method is called 12 times whereas I 
load it once from database ?

please take a look at following code:

  | @Factory(value = tempUser, scope = ScopeType.STATELESS)
  | public User loadUser() {
  | if(reload || tempUser == null) {
  | if(selectedUsername.equals(0)) {
  | logger.debug(instantiating a new User);
  | tempUser = new User();
  | verifyPassword = password = ;
  | selectedGroup = 0L;
  | }else{
  | logger.debug(loading User with username 
'+selectedUsername+');
  | tempUser = userDao.load(selectedUsername);
  | if(tempUser.getGroup() != null)
  | selectedGroup = 
tempUser.getGroup().getId();
  | verifyPassword = password = 
tempUser.getPassword();
  | selectedRoles = new ArrayListString();

  | for(UserRole r : tempUser.getRoles()) {
  | selectedRoles.add(r.getRoleName());
  | }
  | logger.debug(tempUser.toString());
  | reload = false;
  | //setInputValuesWithUser();
  | }
  | }
  | return tempUser;
  | }
  | 
  | 

as you see, at first the reload is true so the User will be populated from 
the database and then the reload will set to false, but at my XHTML page, no 
value will be displayed ! however I can see all the User's value in the 
logs (produced by logger)

if I remove the line highlighted bu blue color reload = false; it will work 
fine but this method will be called 6 times and in app server console I can see 
that 12 times the EJB is selecting from database!!!

thank you very much in advance


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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4095089
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Web Beans Sneak Peek

2007-10-15 Thread mnrz
Thanks Gavin, I found it really nice and useful document :)

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4095092
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - SLSB in session scope?

2007-10-15 Thread mnrz
Hi everybody,

I am using JBoss Seam and I'm bot sure whether this is an issue of the Seam or 
EJB

my question is What an Stateless session bean in a Session scope means?
in other words, since a SLSB will loose its state after a client request has 
been done if that bean defined in a session scope what this means?

thanks

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4095097
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: why Factory method is calling more than once?

2007-10-15 Thread mnrz
Hi Christian,
but if I alter the STATELESS to SESSION my problem will changed, because I have 
a combo box at the page and when the user change it the forms will be submitted 
and the information of the selected user should be displayed. 

if I use the SESSION scope for the factory method, at first the user is 
instansiating as new User() and because the session is still alive, this 
factory method won't be called until the session is destroyed or the user is 
null so this won't resolve the problem

and if you meant changing my Session bean to a stateful  context, I did it but 
problem still exists, it seems that being SFSB or SLSB has nothing to do with 
this factory method and the method will be called whenever the Seam needs it.

you know, if I remove the relaod=false; from the code everything is fine but 
the problem is when user is going to update the information the submitted 
values won't apply to tempUser because after submitting new values, Seam is 
calling this factory method and everything is turning to its first step

thank you in advance for your reply, any comment would be of a great help

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4095150
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: why Factory method is calling more than once?

2007-10-15 Thread mnrz
I did what you suggest, but a:support doesn't resolve my problem. 

first off, after calling the loadUser() by a:support nothing will be displayed 
on page

second, apart from that, when the user clicks on the Save button, the form is 
submitting but the thing is that (it seems) Seam doesn't populate an object 
inside a SB from the request, does it?
after form submission, an exception is thrown that says the tempUser resolves 
to null, one way is to define instance variables in a SB instead of defining an 
object of type User but this makes your bean very untidy.
maybe I am mistaken but I'd like to know your idea.


  | class MySessionBean {
  |private User tempUser;
  |// rest of the codes...
  | }
  | 
  | 
and

  | class MySessionBean {
  |private String username;
  |private String password;
  |private String userAddress;
  |private String name;
  |private String family;
  |...
  |// rest of the codes...
  | }
  | 
  | 
  | 

thanks 


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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4095467
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - Re: SLSB in session scope?

2007-10-15 Thread mnrz
anonymous wrote : in what context did you read Stateless session bean in a 
Session scope? 

thanks for your reply,

as my previous post, I am using JBoss Seam, we can define an Stateless session 
bean with scope Session. I think (I'm not sure) this will result in setting 
that bean as an attribute in the session.
anyway, by your comment that SLSB won't lose their states after completion a 
request, now the vague problem in my mind has been removed

I think however in Seam we can define a SL bean with Session scope but because 
of the nature of the SLSBs it has no meaning, in other words, nothing will 
change whether you set the scope to session or any other scope.

any way, thank you very much indeed

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4095468
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: binding attribute doesnt work with Seam?

2007-10-13 Thread mnrz
I really stuck

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4094844
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: please help me out of this problem

2007-10-09 Thread mnrz
Hi Fernando

sorry to revive this thread, but I have a problem in the above SB

I don't know why changes to fields at client-side is not being seen at 
server-side. I mean when a user changes an item say, Phone no, and press the 
Save button at server-side I can see the same value that field already had and 
new value entered by user has gone!!! 

and another strange thing is that, only changes to last item will be applied!!! 
for example, if I change the position of Phone No to last item, afterwards it 
will work but the other items don't!!!

do you know what happens here?

first I tried to bind the components to its server items but the problem 
remains.

thanks so much

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4092839
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: binding attribute doesnt work with Seam?

2007-10-09 Thread mnrz
anybody can help me please?

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4092845
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: binding attribute doesnt work with Seam?

2007-10-09 Thread mnrz
the xhtml is already posted at first thread above and here is the backing bean:


  | @Stateful
  | @Name(userRegister)
  | @Scope(ScopeType.SESSION)
  | @Restrict(#{s:hasRole('Admin')})
  | public class UserRegisterAction implements UserRegister   {
  | 
  | private Log logger = LogFactory.getLog(UserRegisterAction.class);
  | 
  | private User tempUser;
  | 
  | private HtmlSelectOneMenu selectOneUser;
  | 
  | private SelectItem[] allUsers;
  | private ArrayListSelectItem allRoles;
  | private SelectItem[] allGroups;
  | private boolean newUser;
  | private Long selectedGroup = 0L; 
  | private String selectedUsername = 0;
  | private boolean reload = false;
  | private UIInput username;
  | private UIInput address;
  | private UIInput contactNo;
  | private UIInput mobilePhone;
  | private String verifyPassword; 
  | private String password;
  | 
  | @EJB
  | private UserDao userDao;
  | @EJB
  | private GroupDao groupDao ;
  | 
  | 
  | private ListString selectedRoles;
  | 
  | 
  | //constructors
  | public UserRegisterAction() {
  | logger.debug(constructing UserRegisterAction...);
  | 
  | }
  | 
  | @Factory(value = tempUser, scope = ScopeType.STATELESS)
  | public User loadUser() {
  | if(reload || tempUser == null) {
  | if(selectedUsername.equals(0)) {
  | logger.debug(instantiating a new User);
  | tempUser = new User();
  | verifyPassword = password = ;
  | selectedGroup = 0L;
  | }else{
  | logger.debug(loading User with username 
'+selectedUsername+');
  | tempUser = userDao.load(selectedUsername);
  | if(tempUser.getGroup() != null)
  | selectedGroup = 
tempUser.getGroup().getId();
  | verifyPassword = password = 
tempUser.getPassword();
  | selectedRoles = new ArrayListString();

  | for(UserRole r : tempUser.getRoles()) {
  | selectedRoles.add(r.getRoleName());
  | }
  | //setInputValuesWithUser();
  | }
  | }
  | return tempUser;
  | }
  | 
  | //private methods...
  | private void loadAllRoles() {
  | ListObjectMap list = null;
  | try {
  | list = 
ActionUtil.getClassResourceBundle().getList(AccessRole.class, new 
java.util.Locale(en));
  | } catch (Exception e) {
  | e.printStackTrace();
  | }
  | 
  | if(list != null) {
  | allRoles = new ArrayListSelectItem();
  | for(int i = 0;i list.size();i++) {
  | if(list.get(i).getValue() == null || 
list.get(i).getValue().equals(AccessRole.Unknown.name())) {
  | continue;
  | }
  | SelectItem item = new SelectItem();
  | item.setLabel(list.get(i).getMeaning());
  | item.setValue(list.get(i).getValue());
  | allRoles.add(item);
  | }
  | }
  | }
  | 
  | @SuppressWarnings(unchecked)
  | private void loadAllGroups() {
  | ListGroup groups = groupDao.loadAll();
  | if(groups != null) {
  | allGroups = new SelectItem[groups.size()+1];
  | allGroups[0] = new SelectItem(new Long(0),--not-specified--);
  | for(int i = 0;i groups.size();++i) {
  | SelectItem item = new SelectItem();
  | item.setLabel(groups.get(i).getName());
  | item.setValue(groups.get(i).getId());
  | allGroups[i+1] = item;
  | }
  | }
  | }
  | 
  | private void loadAllUsers() {
  | logger.debug(loading...  + userDao);
  | List users = userDao.load();
  | if(users != null) {
  | allUsers = new SelectItem[users.size()];
  | for(int i = 0; i  users.size();++i) {
  | SelectItem item = new SelectItem();
  | User u = (User) users.get(i);
  | item.setLabel(u.getUsername());
  | item.setValue(u.getUsername());
  | allUsers = item;
  | }
  | }
  | }
  | 
  | private void saveNewUser() {

[jboss-user] [JBoss Seam] - Re: binding attribute doesnt work with Seam?

2007-10-08 Thread mnrz
Hi friends,
there is something strange! I have 6 text box in my page 
username, password, password verify, phone no, address, mobile no

astonishingly, when I press Save button to update changes, at server-side only 
changes to last text box is being seen and others remained intact and when I 
substitute another text box say phone no with the last one (change their 
position) again only changes to last text box (phone no) is visible and the 
others have the same value they already had 

what's the problem? is this an issue with Seam?

thanks


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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4092416
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: binding attribute doesnt work with Seam?

2007-10-07 Thread mnrz
thanks matt, but I couldn't see any question regarding binding a component,
in both link, and also the second link is for 2 version of the Seam I am using 
1.1.6 and at the moment I can't upgrade to version 2.

thanks anyway

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4092323
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: binding attribute doesnt work with Seam?

2007-10-07 Thread mnrz
[EMAIL PROTECTED] wrote : You can't bind to a CONVERSATION scoped backing 
component because the conversation context is not available in the RESTORE VIEW 
phase.

thanks christian, 
I put this as a FAQ in wiki page


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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4092329
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: binding attribute doesnt work with Seam?

2007-10-07 Thread mnrz
now that binding exception has been gone but new problem is that at server-side 
I get no changes and no value by binded components
I put following log at my backing bean

  | logger.debug(contactNo.getLocalValue()+ - 
+contactNo.getSubmittedValue()+ - +contactNo.getValue());
  | 

but two first methods return null and the last one (getValue) returns the same 
value that the component was set already and no changes of the user will be 
applied, what's the problem here?

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4092330
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - binding attribute doesnt work with Seam?

2007-10-06 Thread mnrz
Hi everybody,
I have a SFSB in which I managed creating and editing user profile as follows:


  | @Stateful
  | @Name(userRegister)
  | @Scope(ScopeType.CONVERSATION)
  | public class UserRegisterAction implements UserRegister   {
  | 
  | private Log logger = LogFactory.getLog(UserRegisterAction.class);
  | 
  | private User tempUser;
  | 
  | private HtmlSelectOneMenu selectOneUser;
  | 
  | private SelectItem[] allUsers;
  | private ArrayListSelectItem allRoles;
  | private SelectItem[] allGroups;
  | private boolean newUser;
  | private Long selectedGroup = 0L; 
  | private String selectedUsername = 0;
  | private boolean reload = false;
  | private UIInput username;
  | private UIInput address;
  | private UIInput contactNo;
  | private UIInput mobilePhone;
  | private String verifyPassword; 
  | private String password;
  | 
  | @EJB
  | private UserDao userDao;
  | @EJB
  | private GroupDao groupDao ;
  | 
  | 
  | private ListString selectedRoles;
  | //rest of the codes...
  | }
  | 

the problem is when I press the Save button to apply changes the new values 
never submit to the server and they will remain intact.

so I think the only way is to bind the items with its corresponding field at 
server-side but binding doesnt work!!

it throws exception which means this identifier can not resolve


  | javax.servlet.ServletException: /pages/main/userDifination.xhtml @57,77 
binding=#{userRegister.username}: Target Unreachable, identifier 
'userRegister' resolved to null
  | javax.faces.webapp.FacesServlet.service(FacesServlet.java:154)
  | 
org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
  | 
org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
  | 
org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:100)
  | 
org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
  | 
org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:29)
  | 
org.jboss.seam.servlet.SeamCharacterEncodingFilter.doFilter(SeamCharacterEncodingFilter.java:41)
  | 
  | 
  | root cause 
  | 
  | javax.faces.el.PropertyNotFoundException: /pages/main/userDifination.xhtml 
@57,77 binding=#{userRegister.username}: Target Unreachable, identifier 
'userRegister' resolved to null
  | 
com.sun.facelets.el.LegacyValueBinding.isReadOnly(LegacyValueBinding.java:84)
  | 
org.apache.myfaces.shared_impl.util.RestoreStateUtils.recursivelyHandleComponentReferencesAndSetValid(RestoreStateUtils.java:84)
  | 
org.apache.myfaces.shared_impl.util.RestoreStateUtils.recursivelyHandleComponentReferencesAndSetValid(RestoreStateUtils.java:57)
  | 
org.apache.myfaces.shared_impl.util.RestoreStateUtils.recursivelyHandleComponentReferencesAndSetValid(RestoreStateUtils.java:94)
  | 
org.apache.myfaces.shared_impl.util.RestoreStateUtils.recursivelyHandleComponentReferencesAndSetValid(RestoreStateUtils.java:57)
  | 
org.apache.myfaces.shared_impl.util.RestoreStateUtils.recursivelyHandleComponentReferencesAndSetValid(RestoreStateUtils.java:94)
  | 
org.apache.myfaces.shared_impl.util.RestoreStateUtils.recursivelyHandleComponentReferencesAndSetValid(RestoreStateUtils.java:57)
  | 
org.apache.myfaces.shared_impl.util.RestoreStateUtils.recursivelyHandleComponentReferencesAndSetValid(RestoreStateUtils.java:94)
  | 
org.apache.myfaces.shared_impl.util.RestoreStateUtils.recursivelyHandleComponentReferencesAndSetValid(RestoreStateUtils.java:57)
  | 
org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:96)
  | 
org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
  | 
org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
  | javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
  | 
org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
  | 
org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
  | 
org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:100)
  | 
org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
  | 
org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:29)
  | 
org.jboss.seam.servlet.SeamCharacterEncodingFilter.doFilter(SeamCharacterEncodingFilter.java:41)
  | 
  | 
  | 

here is a fragment of my xhtml file:

  | h:form id=userDifination
  | br/
  | h:panelGroup rendered=true 
id=mainPanel
  | !-- validateAll --
  | h:panelGrid 
rendered=true align=center 

[jboss-user] [EJB 3.0] - is this a bug in EJB?

2007-09-22 Thread mnrz
hello

I have some entity in my application, when I declare a method starting with 
term is the database will be updated with a new field whereas I didn't 
declare that field as a database field

here is an example:

  | import static org.jboss.seam.ScopeType.SESSION;
  | 
  | import java.io.Serializable;
  | import java.util.HashSet;
  | import java.util.Set;
  | 
  | import javax.persistence.CascadeType;
  | import javax.persistence.Column;
  | import javax.persistence.Entity;
  | import javax.persistence.FetchType;
  | import javax.persistence.GeneratedValue;
  | import javax.persistence.Id;
  | import javax.persistence.OneToMany;
  | import javax.persistence.Table;
  | 
  | import org.hibernate.validator.NotNull;
  | import org.jboss.seam.annotations.Name;
  | import org.jboss.seam.annotations.Scope;
  | 
  | @Entity
  | @Table(name =group_permission)
  | @Name(group)
  | @Scope(SESSION)
  | public class Group implements Serializable{
  | 
  | private String name;
  | private Long id;
  | private Integer permissionGroup = new Integer(0);
  | private SetPermission permissions =new  HashSetPermission();
  | private static final int Export_Permission = 8;
  | private static final String All_Permission = *;
  | 
  | @OneToMany(mappedBy=group, fetch = FetchType.EAGER 
,cascade=CascadeType.ALL )
  | public SetPermission getPermissions() {
  | return permissions;
  | }
  | 
  | public void setPermissions(SetPermission permissions) {
  | this.permissions = permissions;
  | }
  | @Id @GeneratedValue
  | @Column(name = id)
  | public Long getId() {
  | return id;
  | }
  | public void setId(Long id) {
  | this.id = id;
  | }
  | 
  | @NotNull
  | @Column(name=name)
  | public String getName() {
  | return name;
  | }
  | public void setName(String name) {
  | this.name = name;
  | }
  | public boolean equals(Object o) {
  | if (o == null)
  | return false;
  | 
  | if (!(o instanceof Group))
  | return false;
  | 
  | Group that = (Group) o;
  | 
  | return this.getName().equals(that.getName());
  | }
  | 
  | public int hashCode() {
  | 
  | return this.getName().hashCode()+720;
  | 
  | }
  | 
  | @Column(name=permissionGroup)
  | public Integer getPermissionGroup() {
  | return permissionGroup;
  | }
  | 
  | public void setPermissionGroup(Integer permissionGroup) {
  | this.permissionGroup = permissionGroup;
  | }
  | public void setPermission(boolean permission){
  | permissionGroup=0;
  | if(permission){
  | permissionGroup=permissionGroup | Export_Permission;
  | }
  | 
  | }
  | public void addPermission(ColumnHeader ch ,String categoryName){
  | 
  | if(permissions==null){
  | permissions=new HashSetPermission();
  | }
  | if(ch.isDisplayable() ||ch.isSearchable()){
  | Permission permission=new Permission();
  | permission.setGroup(this);
  | permission.setCategory(categoryName);
  | permission.displayablePermission(ch.isDisplayable());
  | permission.searchablePermission(ch.isSearchable());
  | permission.setFieldName(ch.getName());
  | permissions.add(permission);
  | }
  | }
  | 
  | public boolean hasExportPermission(){
  | if((Export_Permission  Export_Permission) == Export_Permission)
  | return true;
  | else
  | return false;
  | }
  | 
  | public void setExportPermission(boolean export){
  | if(export) {
  | permissionGroup = permissionGroup | Export_Permission;
  | }else {
  | permissionGroup = permissionGroup  ~Export_Permission;
  | }
  | }
  |  
  | public boolean hasDisplayPermission(String categoryName, String 
fieldName) {
  | for(Permission p: permissions) {
  | if(p.getCategory().trim().equals(All_Permission)){
  | return true;
  | }
  | if(p.getCategory().equals(categoryName)  
p.getFieldName().equals(fieldName)) {
  | return p.hasDisplayablePermission();
  | }
  | }
  | return false;
  | }
  | 
  | public boolean hasSearchPermission(String categoryName, String 
fieldName) {
  | for(Permission p: permissions) {
  | if(p.getCategory().equals(All_Permission)){
  |  

[jboss-user] [JBoss Seam] - Re: conversation ends unexpectedly!

2007-09-19 Thread mnrz

I put some log in my code, here is the result:

this is ExportDataUtil.exportToExcel() method:

  | public void exportToExcel(String filepath,MapClass, IndexResultSet 
indexResultSet,MapIndexCategory, ColumnHeaderListColumnHeader 
columnHeaders) throws Exception {
  | logger.debug(building Excel's sheet is in progress...);
  | int rowCount = 0;
  | int colCount = 0;
  | int savedCurrentIndex = 1;
  | int x = 0;
  | logger.debug(--- +x++);
  | String filename = .xls;
  | 
  | // Create Excel Workbook and Sheet
  | HSSFWorkbook wb = new HSSFWorkbook();
  | logger.debug(--- +x++);
  | HSSFSheet sheet = wb.createSheet(filename);
  | HSSFHeader header = sheet.getHeader();
  | header.setCenter(filename);
  | logger.debug(--- +x++);
  | HSSFFont tahomaFont = wb.createFont();
  | tahomaFont.setFontName(Tahoma);
  | logger.debug(--- +x++);
  | 
  | 

and the result is:

  | DEBUG building Excel's sheet is in progress...
  | DEBUG --- 0
  | DEBUG --- 1
  | starting IndexSearchAction
  | DEBUG destroying IndexSearchAction...
  | DEBUG --- 2
  | DEBUG --- 3
  | DEBUG --- 4
  | DEBUG --- 5
  | DEBUG --- 6
  | DEBUG --- 7
  | DEBUG --- 1
  | DEBUG --- 2
  | DEBUG --- 
  | DEBUG --- 
  | DEBUG --- 
  | DEBUG --- 
  | DEBUG --- 
  | DEBUG --- 
  | DEBUG --- 
  | DEBUG --- 
  | DEBUG --- 
  | DEBUG --- 
  | INFO Export to Excel done.
  | DEBUG EXCEL-END
  | 

as you can see, after two logs is displayed, the conversation ends, this is 
highlighted in green

any idea?

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4085858
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: conversation ends unexpectedly!

2007-09-19 Thread mnrz
sorry for the highlight color

  | DEBUG building Excel's sheet is in progress...
  | DEBUG --- 0
  | DEBUG --- 1
  | 
  | starting IndexSearchAction
  | DEBUG destroying IndexSearchAction...
  | 
  | DEBUG --- 2
  | DEBUG --- 3
  | DEBUG --- 4
  | DEBUG --- 5
  | DEBUG --- 6
  | DEBUG --- 7
  | DEBUG --- 1
  | DEBUG --- 2
  | DEBUG --- 
  | DEBUG --- 
  | DEBUG --- 
  | DEBUG --- 
  | DEBUG --- 
  | DEBUG --- 
  | DEBUG --- 
  | DEBUG --- 
  | DEBUG --- 
  | DEBUG --- 
  | INFO Export to Excel done.
  | DEBUG EXCEL-END
  | 

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4085861
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: conversation ends unexpectedly!

2007-09-18 Thread mnrz
in the ExportDataUtil I used FileOutputStream to create related files on the 
disk. Does this make the problem?

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4085351
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Gavin King: Bad tools of Seam is kill its uses!!!

2007-09-18 Thread mnrz
leave it out and do it yourself ;)

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4085359
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - conversation ends unexpectedly!

2007-09-17 Thread mnrz
Hello,

I have a SFSB with an action method as follows:


  | @Stateful 
  | @Name(searchResult)
  | @Scope(CONVERSATION) 
  | public class SearchResultAction implements SearchResult {
  |  //code 
  | 
  | public String export() {
  | if(!exportAvailable) {
  | 
if(!ActionUtil.clearUserExportFolder(user,FacesContext.getCurrentInstance())) {
  | logger.warn(some files may not be deleted!);
  | }
  | }
  | try {
  | if(!ExportDataUtil.checkCapacity(indexResultSet)) {
  | FacesMessages.instance().add(Sorry! too many 
records to export, please refine your query to decline the result);
  | return ;
  | }
  | 
  | logger.debug(exporting);
  | logger.debug(request parameter: + exportType);
  | 
  | ExportDataUtil export = new ExportDataUtil();
  | 
  | String path = 
ActionUtil.checkUserExportFolder(user,FacesContext.getCurrentInstance());
  | 
  | //commented code
  | 
  | //  if(xml.equals(exportType)) {
  | //  
export.exportToXML(path,indexResultSet,columnHeaders);
  | //  }else if(pdf.equals(exportType)) {
  | //  
export.exportToPDF(path,indexResultSet,columnHeaders);
  | //  }else if(word.equals(exportType)) {
  | //  
export.exportToRTF(path,indexResultSet,columnHeaders);
  | //  }else if(access.equals(exportType)) {
  | //  
export.exportToAccess(path,indexResultSet,columnHeaders);
  | //  }else if(excel.equals(exportType)) {
  | //  
export.exportToExcel(path,indexResultSet,columnHeaders);
  | //  }else {
  | //  logger.error(unable to export, invalid 
parameter.);
  | //  FacesMessages.instance().add(Unable to export, 
an unexpected error has been occured, please try again.);
  | //  return ;
  | //  }
  | 
  | exportAvailable = true;
  | return exportList;
  | }catch (Exception e) {
  | e.printStacktrace();
  | exportAvailable = false;
  | return ;
  | }
  | }
  | 
  | }
  | 

as you can see, I commented out the part of code in which I export the 
information to various formats, this is work with no problem but if I remove 
the comment, at this point the method will create the exported file correctly, 
but suddenly the conversation will ends!!! 

what is wrong with this code? I checked the ExportDataUtil and put many logs to 
see if there is any exception but no exception occurred, and the exported file 
will be created when this method is called

would you tell me what is the problem.

any help is appreciated


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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4084972
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: regarding Redirect.captureCurrentView()

2007-09-10 Thread mnrz
as I read in javadoc it is stated:

captureCurrentView():
Capture the view id and page parameters from the current request and squirrel 
them away so we can return here later in the conversation.

and 

returnToCapturedView():
Redirect to the captured view, and end any conversation that began in 
captureCurrentView().


I think it should work as they described


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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4082510
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: regarding Redirect.captureCurrentView()

2007-09-10 Thread mnrz
well, I checked the seam-gen but its login page and its authenticator is very 
simple without any use of Redirect. could you give me the file name you are 
meant?



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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4082568
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: problem with Authenticator

2007-09-09 Thread mnrz
[EMAIL PROTECTED] wrote : No transaction normally means that an earlier 
exception has occurred. Use your debugger to see what goes wrong.

I really appreciate your nice comment, you show me the way, as you told, I 
tried to comment out the code in authenticator and return true for every user 
then I saw many exceptions :))

after resolving problems, I restores the commented codes and now it works fine 

thank you again too much and sorry for sending email directly



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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4082383
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Seam and Downloading?

2007-09-09 Thread mnrz
Hi

Does Seam provide a convenient component to write into output stream rather 
than getting the request from the FaccesContext and producing the response 
manually?
this usually is for downloading a file on a user request.

thanks

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4082457
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - regarding Redirect.captureCurrentView()

2007-09-09 Thread mnrz
hello

I want to navigate from a page to my error page when an exception occurs, and 
after going to error page, the user is able to click on back button to go 
back to last page.

I am using Redirect.instance().captureCurrentView() and in my ErrorAction bean 
in its back() method I called Redirect.instance().returnToCapturedView() but it 
doesn't work. Am I doing wrong? 

thanks

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4082458
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - Re: No Transaction! please help

2007-09-07 Thread mnrz
I am stuck at this point. because I can't sign into my application I can't 
develop it anymore !

any comment would be of great help

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4082322
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - problem with Authenticator

2007-09-05 Thread mnrz
Hi

I have an Authenticator component in my application and it was working fine 
until yesterday and now it's treating weird, I had no changes since yesterday 
but it throws following exception. 


  | Hibernate: select user0_.username as username3_, user0_.address as 
address3_, user0_.group_id as group13_3_, u
  | ser0_.password as password3_, user0_.position as position3_, user0_.idCity 
as idCity3_, user0_.mobileContact a
  | s mobileCo6_3_, user0_.phoneNo1 as phoneNo7_3_, user0_.phoneNo2 as 
phoneNo8_3_, user0_.speciality as specialit
  | y3_, user0_.statusCode as statusCode3_, user0_.uPIN as uPIN3_, 
user0_.enabled as enabled3_ from user user0_ wh
  | ere user0_.username=? and user0_.password=?
  | Hibernate: select group0_.id as id1_1_, group0_.name as name1_1_, 
group0_.permissionGroup as permissi3_1_1_, g
  | roup0_.exportPermission as exportPe4_1_1_, permission1_.groupId as 
groupId3_, permission1_.id as id3_, permiss
  | ion1_.id as id2_0_, permission1_.permission as permission2_0_, 
permission1_.groupId as groupId2_0_, permission
  | 1_.fieldName as fieldName2_0_, permission1_.category as category2_0_, 
permission1_.displayablePermission as di
  | splaya5_2_0_, permission1_.searchablePermission as searchab6_2_0_ from 
group_permission group0_ left outer joi
  | n permission permission1_ on group0_.id=permission1_.groupId where 
group0_.id=?
  | java.lang.IllegalStateException: No transaction.
  | at org.jboss.tm.TxManager.setRollbackOnly(TxManager.java:751)
  | at 
org.hibernate.ejb.AbstractEntityManagerImpl.markAsRollback(AbstractEntityManagerImpl.java:392)
  | at 
org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.jav
  | a:545)
  | at 
org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.jav
  | a:567)
  | at org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:72)
  | at 
com.payvand.search.model.business.Authenticator.authenticate(Authenticator.java:59)
  | at 
com.payvand.search.model.business.Authenticator$$FastClassByCGLIB$$28b8687e.invoke(generated)
  | at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
  | at 
org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:45)
  | at 
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:55)
  | at 
org.jboss.seam.interceptors.OutcomeInterceptor.interceptOutcome(OutcomeInterceptor.java:21)
  | 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 org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
  | at 
org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
  | at 
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
  | at 
org.jboss.seam.interceptors.RollbackInterceptor.rollbackIfNecessary(RollbackInterceptor.java:29)
  | 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 org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
  | at 
org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
  | at 
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
  | at 
org.jboss.seam.interceptors.BijectionInterceptor.bijectNonreentrantComponent(BijectionInterceptor.j
  | ava:79)
  | at 
org.jboss.seam.interceptors.BijectionInterceptor.bijectComponent(BijectionInterceptor.java:58)
  | 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 org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
  | at 
org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
  | at 
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
  | at 
org.jboss.seam.interceptors.ConversationInterceptor.endOrBeginLongRunningConversation(ConversationI
  | nterceptor.java:52)
  | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  | at 

[jboss-user] [JBoss Seam] - Re: problem with Authenticator

2007-09-05 Thread mnrz
can we inject an ejb component into authenticator using @EJB?

@EJB
private UserDao userDao;

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4081206
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - No Transaction! please help

2007-09-05 Thread mnrz
Hi

I have a component in my application to authenticate users and it was working 
fine until yesterday and now it's treating weird, I had no changes since 
yesterday but it throws following exception.


  | Hibernate: select user0_.username as username3_, user0_.address as 
address3_, user0_.group_id as gro
  | up13_3_, u
  | ser0_.password as password3_, user0_.position as position3_, user0_.idCity 
as idCity3_, user0_.mobil
  | eContact a
  | s mobileCo6_3_, user0_.phoneNo1 as phoneNo7_3_, user0_.phoneNo2 as 
phoneNo8_3_, user0_.speciality as
  |  specialit
  | y3_, user0_.statusCode as statusCode3_, user0_.uPIN as uPIN3_, 
user0_.enabled as enabled3_ from user
  |  user0_ wh
  | ere user0_.username=? and user0_.password=?
  | Hibernate: select group0_.id as id1_1_, group0_.name as name1_1_, 
group0_.permissionGroup as permiss
  | i3_1_1_, g
  | roup0_.exportPermission as exportPe4_1_1_, permission1_.groupId as 
groupId3_, permission1_.id as id3
  | _, permiss
  | ion1_.id as id2_0_, permission1_.permission as permission2_0_, 
permission1_.groupId as groupId2_0_, 
  | permission
  | 1_.fieldName as fieldName2_0_, permission1_.category as category2_0_, 
permission1_.displayablePermis
  | sion as di
  | splaya5_2_0_, permission1_.searchablePermission as searchab6_2_0_ from 
group_permission group0_ left
  |  outer joi
  | n permission permission1_ on group0_.id=permission1_.groupId where 
group0_.id=?
  | java.lang.IllegalStateException: No transaction.
  | at org.jboss.tm.TxManager.setRollbackOnly(TxManager.java:751)
  | at 
org.hibernate.ejb.AbstractEntityManagerImpl.markAsRollback(AbstractEntityManagerImpl.java
  | :392)
  | at 
org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManag
  | erImpl.jav
  | a:545)
  | at 
org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManag
  | erImpl.jav
  | a:567)
  | at org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:72)
  | at 
com.payvand.search.model.business.Authenticator.authenticate(Authenticator.java:59)
  | at 
com.payvand.search.model.business.Authenticator$$FastClassByCGLIB$$28b8687e.invoke(generated)
  | at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
  | at 
org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:45)
  | at 
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:55)
  | at 
org.jboss.seam.interceptors.OutcomeInterceptor.interceptOutcome(OutcomeInterceptor.java:2
  | 1)
  | 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 org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
  | at 
org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
  | at 
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
  | at 
org.jboss.seam.interceptors.RollbackInterceptor.rollbackIfNecessary(RollbackInterceptor.j
  | ava:29)
  | 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 org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
  | at 
org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
  | at 
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
  | at 
org.jboss.seam.interceptors.BijectionInterceptor.bijectNonreentrantComponent(BijectionInt
  | erceptor.j
  | ava:79)
  | at 
org.jboss.seam.interceptors.BijectionInterceptor.bijectComponent(BijectionInterceptor.jav
  | a:58)
  | 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 org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
  | at 
org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
  | at 
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
  | at 
org.jboss.seam.interceptors.ConversationInterceptor.endOrBeginLongRunningConversation(Con
  | versationI
  | nterceptor.java:52)
  | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native 

[jboss-user] [EJB 3.0] - Re: No Transaction! please help

2007-09-05 Thread mnrz
BTW, I am using Tomcat and Embedded EJB


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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4081269
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - Re: JTA EntityManager cannot access a transactions

2007-09-05 Thread mnrz
Hi

could you find what is the problem on your exception? I am getting this 
exception as well and I've stuck at this point :(

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4081316
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: problem with Authenticator

2007-09-05 Thread mnrz
ok but why I get IllegalArgumentException: No transaction when I call 
entityManager?

I also tried to call entityManager.getTransaction().begin and I get new 
exception java.lang.IllegalStateException: JTA EntityManager cannot access a 
transactions 

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4081546
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - Re: No Transaction! please help

2007-09-05 Thread mnrz
any idea? :(

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4081548
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: how to use @Roles?

2007-09-04 Thread mnrz
any other idea? :)

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4080725
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: how to use @Roles?

2007-09-04 Thread mnrz
what simple :)
ok so it has an issue only with auto instantiation and not further benefits.

I thought a great usability for that.

thank you both for your reply

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4080757
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: please help me out of this problem

2007-09-03 Thread mnrz
fernando,
really thanks for your nice solution, it worked fine, but another problem

when I select a user the information is displayed correctly, now consider I am 
changing some info say, address or contact number, how to manage this changed 
data at server and synchronize the changed User with the database? because the 
outjected with @Factory only set an attribute with stateless scope and now how 
to send back the new data to the server?

first, I tried to add @In for the user as follows:


  |  @In(tempUser)
  |  private User user;
  | 
  | // consider @Factory's value is tempUser
  | 
  | @Factory(value=tempUser,scope=STATELESS)
  | public User initUser(){
  |  //.
  |}
  | 

but it didn't work

any solution?

thanks

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4080393
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: please help me out of this problem

2007-09-03 Thread mnrz
yes, but saveCurrentUser() that you declared only updates the instance variable 
user and the changes maded by user at client is not visible here. in other 
words, when I click on submit the changes I've made, not binded to any variable 
at server-side. 

I'm not sure I could clarify myself or not

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4080487
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: please help me out of this problem

2007-09-03 Thread mnrz
thanks Fernando, it works fine :)

with relaod, it works, but would you please tell me how this works? 
as I understood, this @Factory will be called when at client-side an attribute 
of that name is referred (for example tempUser) 
and relaod flag compels loading the user only when my combobox has been 
changed.

Am I right?

thank you again for your nice solution.

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4080524
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: please help me out of this problem

2007-09-02 Thread mnrz
I had this problem in another page and after binding that component it worked 
but here I have 6 text fields I don't want to bind all of them. 

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4080273
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: please help me out of this problem

2007-09-01 Thread mnrz
my User's scope is SESSION is this the issue which cause this problem?

because I just read somewhere in seam reference about @Role that we can define 
many roles for an entity but I don't know how to use them?



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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4080224
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - how to use @Roles?

2007-09-01 Thread mnrz
Hello

I've read something in Seam reference about @Roles which you can define many 
roles for an entity, a User stated as an example as follows:


  | @Roles({
  | @Role(name=user, scope=ScopeType.CONVERSATION),
  | @Role(name=currentUser, scope=ScopeType.SESSION)
  | })
  | 

it seems to me very useful but I can't comprehend its concepts and the benefits 
and also I don't know how to use? unfortunately I couldn't find any sample in 
which this feature is utilized.

can anyone explain this annotation and tell me how to use it?

thanks 

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4080226
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: how to use @Roles?

2007-09-01 Thread mnrz
ok, I know about it. Assume that we defined those roles, now, in our session 
beans how we can use it?

for example, I have an Authenticator Session bean in which a User instance 
variable is defined as follows:


  | 
  | @Stateless
  | @Name(authenticator)
  | class Authenticator {
  | 
  | @Out(currentUser, scope=ScopeType.SESSION)
  | private User user;  
  | 
  |   // rest of the codes
  | }
  | 
  | 

and in another bean in which I provide a facility to manage other users for 
administrators as follows:


  | @Name(userManager)
  | @Stateful
  | class UsreManagerAction implements UserManager {
  | 
  | private User user;
  | 
  | //rest of the codes
  | }
  | 

I want to know how do I use those roles in such these beans?

thanks again 
how can I use 

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4080238
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - please help me out of this problem

2007-08-30 Thread mnrz
Hi

I have a SFSB as follows, it has an entity named user, in page when I change 
a list box I want the selected user to be loaded but nothing will be displayed


  | @Stateful
  | @Name(userRegister)
  | @Scope(ScopeType.SESSION)
  | public class UserRegisterAction implements UserRegister  {
  | 
  | private Log logger = LogFactory.getLog(UserRegisterAction.class);
  | 
  | private User user;
  | private String selectedUsername = 0;
  | 
  | //rest of the codes 
  | 
  | public void userListValueChanged(ValueChangeEvent event) {
  | 
  | try {
  | selectedUsername = (String) event.getNewValue();
  | if(selectedUsername.equals(0)){
  | logger.debug(new user);
  | User u = new User();
  | setUser(u);
  | }else{
  | logger.debug(edit:+ selectedUsername);
  | User u = userDao.load(selectedUsername);
  | setUser(u);
  | logger.debug(test:+ user.getUsername());
  | }
  | } catch (Exception e) {
  | e.printStackTrace();
  | }
  | }
  | 
  | 
  | 
  |  //getters and setters
  | 

now in xhtml file:


  | 
h:panelGroup id=exportUser
  | 
h:outputLabel id=userL
  | 
value=#{bundle['userDefination.group']} for=groupMenu /
  | 
t:selectOneMenu id=userMenu required=false 
value=#{userRegister.selectedUsername}
  | 
valueChangeListener=#{userRegister.userListValueChanged}
  | 
onchange=submit(this) 
  | 
f:selectItem itemLabel=New User ... itemValue=0 /
  | 
f:selectItems id=userList value=#{userRegister.allUsers} /
  | 
/t:selectOneMenu
  | 
/h:panelGroup
  | 
  | 

after the user change the list this form will submit but any reference to 
userRegister.user.username or other properties of user don't work .

at first, user is not null it is a user with null property values. the thing 
wondering me is that in change value listener I load the user with new values 
but new values won't be displayed at page!!!

and #{userRegister.user} returns the object reference of User with the same 
value that it was already.

any help would be appreciated

thanks

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4079587
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: please help me out of this problem

2007-08-30 Thread mnrz
#{userRegister.user} always returns value [EMAIL PROTECTED] 
even after I set the user to new User() it won't change !!!

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4079591
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: Handling all exception with one action?

2007-08-28 Thread mnrz
any idea? :)

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4078640
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: @Startup and user session

2007-08-28 Thread mnrz
well, I didn't know about @RaiseEvent, I will try it 

the thing that make me reluctant to use Event...raseEvent is that, in my 
opinion, if you use this too much it will make your application complex and 
hard to understand and debug it in future

anyway, thank you very much for your help, currently I am using the same 
Events...raseEvent() but I will take a look at @RaiseEvent

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4078844
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: @Startup and user session

2007-08-27 Thread mnrz
matt.drees wrote : Probably what I would do is put an 
@Observer(org.jboss.seam.postAuthenticate) method in your userSettings 
component.

thanks matt.drees, it worked fine, but another problem came about, there are 
three other component which depend on this unique component method. In other 
words, after invoking this method some variable will be outjected so other 
comp. will inject those variables.

how to manage this?

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4078232
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Handling all exception with one action?

2007-08-27 Thread mnrz
Hello

how to handle all exception in a seam component. I am thinking of having an 
stateless bean in which some action methods are defined so I can handle 
exceptions regarding to its type and also provide some functionality such as 
sending exception message to administrator by user, etc.

actually, I need something like  tag of pages.xml but using java codes.

one solution I am considering is using @Observer but don't know how to notify 
that method when an exception is thrown.

any suggestion would be of great help
thanks

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4078310
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: @Startup and user session

2007-08-27 Thread mnrz
matt.drees wrote : I'm not sure what you mean.

well, let me explain more. when a user logged in, the application should find 
which fields and categories he is allowed to search so I defined an action in 
which a Map of accessible fields will be created. this map is creating after 
authenticating the user (using the solution you suggest: @Observer) 

now other actions like Exporting, query builder , etc need to work only with 
authorized fields and these are presented by the same map. I need to notify 
them as well to initialize themself. I can use Events.instance().raiseEvent to 
notify the other actions but I think this is not good. what do you think?



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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4078575
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - @Startup and user session

2007-08-26 Thread mnrz
Hi

I have a Stateful session scoped component namely userSettings. I want when 
user logged in its build method (annotated with @Create) being invoked. 

first I marked it with @Startup but when the pages are loading this component 
will load as well but at that time, there is no user logged in, so this throws 
an exception and after the user enters his username and password this component 
won't initialize for his session

how can I make a component to be loaded just when a user is signing in? 
@Startup will load for any session even if no user signed in.



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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4078099
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: beans and different packages

2007-08-14 Thread mnrz
well, I meant in the same archive but different package
for example:
com.my.dao
   SomeEjbBean.java
and 
com.my.model
  SomeOtherBean.java


but how about two archives (two different jar files)? 

please note I am using embeddable EJB with Tomcat 5.5 

thanks

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4073915
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: regarding jboss-bean.xml?

2007-08-13 Thread mnrz
Any Idea?

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4073478
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - beans and different packages

2007-08-13 Thread mnrz
Hi all

I want to put different beans in different packages, for example, my ejbs to 
perform the persistence operations in a package say dao and my jsf beans 
regarding presentation layer in another package namely view but the problem 
is that Seam doesn't know them, JBoss Seam only knows the beans located in 
view package

is there any way to declare which packages contain my beans?

thank you very much

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4073480
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: regarding jboss-bean.xml?

2007-08-13 Thread mnrz
[EMAIL PROTECTED] wrote : To which server?

I am using Tomcat 5.5 and JBoss Seam v1.1.6

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4073481
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - regardig jboss-beans.xml

2007-08-13 Thread mnrz
HI

because we have to deploy our application in many servers with different 
specifications and configurations, I need to have an external config file in 
which I declare simply IP and connection url
the question is that how can I put these info into a file so jboss-beans.xml 
read those information because this file currently located in jar file it is 
difficult to alter the file and create a new jar file for each server

thank you

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4073492
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [EJB 3.0] - Re: regardig jboss-beans.xml

2007-08-13 Thread mnrz
thank you all
but what if I use embedable EJB with Tomcat 5.5 ?
do you have any solution for that?

thanks again

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4073812
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - regarding jboss-bean.xml?

2007-08-12 Thread mnrz
HI

because we have to deploy our application in many servers with different 
specifications and configurations, I need to have an external config file in 
which I declare simply IP and connection url 
the question is that how can I put these info into a file so jboss-beans.xml 
read those information because this file currently located in jar file it is 
difficult to alter the file and create a new jar file for each server

thank you 

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4073349
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - stupid question about message Welcome of seam security

2007-05-29 Thread mnrz
Hi

When I log in using seam Authenticator, a message Welcome user_name will be 
displayed

I can't find that message in any resource bundle. I want to display another 
message with related language that user specified how can I remove that message 
:)) 

I am using Seam v1.1.6
thanks

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4049195
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: stupid question about message

2007-05-29 Thread mnrz
No I have Messages.properties under the specific path

com.mypackage.bundle.Messages.properites

but the problem is it can't understand it

this is from Seam tutorial:

  | You can select a different name for the resource bundle by setting the Seam 
configuration property named
  | org.jboss.seam.core.resourceBundle.bundleNames. You can even specify a list 
of resource bundle names
  | to be searched (depth first) for messages.
  | core:resource-bundle
  | core:bundle-names
  | valuemycompany_messages/value
  | valuestandard_messages/value
  | /core:bundle-names
  | /core:resource-bundle
  | 
  | 

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4049213
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: why conversation-timeout doesn't work properly?

2007-05-22 Thread mnrz

Thanks Fernando

yes you are right, so the Session timeout overrides the conversation timeout

thanks again

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4047779
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - why conversation-timeout doesn't work properly?

2007-05-21 Thread mnrz
Hello

I set the conversation timeout to a value representing 1 hour but after a 
couple of the minutes the conversation will end 

here is the line in component.xml


  | core:manager  conversation-timeout=360 
  |   concurrent-request-timeout=500
  |   conversation-id-parameter=cid
  |   conversation-is-long-running-parameter=clr/
  | 
  | 

and this is the message will be shown:


The conversation ended, timed out or was processing another request 
You must be logged in to perform this action 


I have two components in conversation scope

SearchQuery  -- SearchResult

and one statefull component in Session scope

UserSettings

when the user is in the SearchResult which is actually in a long running 
conversation he/she may click on a button to go to settings page (UserSettings) 
and after change the settings will get back to SearchResult

however, I set a @Begin(join=true) in method of UserSettings but I think this 
is the point of my problem

is it possible to go to a statefull component  and then back to the last long 
running conversation?

thank you very much in advance


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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4047209
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - problem with security and login

2007-05-05 Thread mnrz
Hi

I have a problem with security.
I am using JBoss Seam 1.1.6
when I press login button I encounter following exception:


  | ERROR Servlet.service() for servlet Faces Servlet threw exception
  | javax.faces.FacesException: Error calling action method of component with 
id login:_id13
  | at 
org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:72)
  | at javax.faces.component.UICommand.broadcast(UICommand.java:109)
  | at 
javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:97)
  | at 
javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:171)
  | at 
org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:32)
  | at 
org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
  | at 
org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
  | at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
  | at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
  | at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
  | at 
org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:100)
  | at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
  | at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
  | at 
org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
  | at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
  | at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
  | at 
org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:29)
  | at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
  | at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
  | at 
org.jboss.seam.servlet.SeamCharacterEncodingFilter.doFilter(SeamCharacterEncodingFilter.java:41)
  | at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
  | at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
  | at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
  | at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
  | at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
  | at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
  | at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
  | at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
  | at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
  | at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
  | at 
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
  | at 
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
  | at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
  | at java.lang.Thread.run(Thread.java:595)
  | Caused by: javax.faces.el.EvaluationException: /pages/main/login.xhtml 
@35,71 action=#{identity.login}: java.lang.IllegalStateException: no security 
rule base available - please install a RuleBase with the name 'securityRules'
  | at 
com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:73)
  | at 
org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:61)
  | ... 33 more
  | Caused by: java.lang.IllegalStateException: no security rule base available 
- please install a RuleBase with the name 'securityRules'
  | at 
org.jboss.seam.security.Identity.assertSecurityContextExists(Identity.java:276)
  | at 
org.jboss.seam.security.Identity.populateSecurityContext(Identity.java:245)
  | at 
org.jboss.seam.security.Identity.postAuthenticate(Identity.java:223)
  | at org.jboss.seam.security.Identity.authenticate(Identity.java:207)
  | at org.jboss.seam.security.Identity.authenticate(Identity.java:199)
  | at org.jboss.seam.security.Identity.login(Identity.java:184)
  | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  | at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  | at 

[jboss-user] [JBoss Seam] - can I join a session with a conversation?

2007-05-05 Thread mnrz
hello

I have some beans in one conversation (or rather some pages) but I want to use 
another page which is in session scope and then back to last conversation and 
resume the job but when I enter the session scope page after pressing the 
button to go back it throws exception and tell me the conversation has been 
ended.

is this possible? or I missed something to resolve that.

here is my pages.xml:
setting.xhtml is the page in session scope:

  | pages
  | page view-id=/pages/main/searchQuery.xhtml 
  | navigation from-action=#{indexSearch.search} 
  | rule if-outcome=resultQuery
  | begin-conversation join=true /
  | redirect 
view-id=/pages/main/resultQuery.xhtml /
  | /rule
  | /navigation
  | /page
  | 
  | page view-id=/pages/main/setting.xhtml  
  | navigation from-action=#{userSetting.continueNextPage} 
  | rule if-outcome=nextPage
  | redirect 
view-id=/pages/main/resultQuery.xhtml /
  | /rule
  | /navigation
  | navigation from-action=#{userSetting.apply} 
  | rule if-outcome=resultQuery
  | redirect 
view-id=/pages/main/resultQuery.xhtml /
  | /rule
  | /navigation
  | /page
  | 
  | page view-id=/pages/main/resultQuery.xhtml 
conversation-required=true
  | no-conversation-view-id=/pages/main/searchQuery.xhtml
  | navigation from-action=#{searchResult.back}
  | rule if-outcome=back
  | end-conversation/
  | render view-id=/pages/main/searchQuery.xhtml 
/
  | /rule 
  | /navigation
  | navigation from-action=#{searchResult.setting}
  | rule if-outcome=setting
  | redirect view-id=/pages/main/setting.xhtml /
  | /rule 
  | /navigation
  | /page
  | 
  | page view-id=/login.xhtml
  | navigation from-action=#{identity.login}
  | rule if-outcome=success
  | redirect view-id=/resultQuery.xhtml/
  | /rule
  | /navigation
  | /page
  | /pages
  | 

thank you very much

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4043417
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: can I join a session with a conversation?

2007-05-05 Thread mnrz
petemuir wrote : What you are saying makes no sense.  Views aren't bound to 
conversations or the session, components are.

well, I meant the same component, sorry I made mistake

I want to go to a page which has a component in session scope but when I want 
to go back to conversation it says it has ended

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4043433
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: can I join a session with a conversation?

2007-05-05 Thread mnrz
here is the component in session scope:


  | @Stateful
  | @Name(userSetting)
  | @Scope(ScopeType.SESSION)
  | public class UserSettingAction implements UserSetting {
  | 
  | private Log logger = LogFactory.getLog(SearchResultAction.class);
  | 
  | private ListString selectedItems;
  | 
  | private ListString categoryList;
  | 
  | private HtmlSelectOneMenu selectOneCategory;
  | 
  | private SelectItem categorySelectItem[];
  | private SelectItem selectedCategory;
  | private HtmlSelectManyPicklist picklist;
  | private boolean sorted = false;
  | 
  | @Out
  | private String headerName;
  | 
  | private ColumnHeaderListColumnHeader columns;
  | 
  | @Out
  | private MapClass, ColumnHeaderListColumnHeader columnHeaders;
  | 
  | @Create
  | @Begin(join=true)
  | public void build() {
  | logger.debug(Populating column headers);
  | selectedItems = new ArrayListString();
  | categoryList = new ArrayListString();
  | columnHeaders = new HashMapClass, 
ColumnHeaderListColumnHeader();
  | try {
  | int j = 0;
  | categorySelectItem = new 
SelectItem[Infrastructure.getStructure()
  | .keySet().size()];
  | for (Class cat : 
Infrastructure.getStructure().keySet()) {
  | IndexRoot indexRoot = 
Infrastructure.getStructure().get(cat);
  | SelectItem selectItem = new 
SelectItem(indexRoot.getClassName().getName(), indexRoot.getName());
  | categorySelectItem[j] = selectItem;
  | headerName = indexRoot.getName();
  | ColumnHeaderListColumnHeader columns = new 
ColumnHeaderListColumnHeader();
  | int i = 1;
  | for (FieldData f : indexRoot.getFields()) {
  | if (f.isExpanded())
  | columns.add(new 
ColumnHeader(f.getOriginalName(), f
  | .getAlias(), i, 
i = 3));
  | else
  | columns.add(new 
ColumnHeader(f.getName(),
  | f.getAlias(), 
i, i = 3));
  | ++i;
  | }
  | columnHeaders.put(indexRoot.getClassName(), 
columns);
  | j++;
  | }
  | 
  | //set defaults...
  | Class clazz = 
getClassFromName((String)categorySelectItem[0].getValue());
  | selectOneCategory = new HtmlSelectOneMenu();
  | picklist = new HtmlSelectManyPicklist();
  | 
selectOneCategory.setValue((String)categorySelectItem[0].getValue());
  | //columns = columnHeaders.get(clazz);
  | setCurrentFields(clazz);
  | } catch (Exception e) {
  | logger.error(exception in loading column names:);
  | e.printStackTrace();
  | }
  | }
  | 
  |   rest of the codes...
  | }
  | 

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4043436
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: can I join a session with a conversation?

2007-05-05 Thread mnrz
I think I put @Begin in wrong place because when the session is creating it 
will calls the @Create method and it is also lunches a conversation so this 
conversation is different from the next one that I will lunch later

but I dont know, if I remove @Begin how can I notify to join to current 
conversation if the user clicks on the link or button to go in that page with 
session scope component (the above component) 

there is no attribute on pages.xml to define a page to join the current 
conversation. 

is there any way?

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

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4043440
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [JBoss Seam] - Re: can I join a session with a conversation?

2007-05-05 Thread mnrz
ok

here is the page that has a button to go to setting.xhtml:


  | ?xml version=1.0 encoding=utf-8 ?
  | !DOCTYPE html 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:t=http://myfaces.apache.org/tomahawk;
  | xmlns:s=http://myfaces.apache.org/sandbox;
  | xmlns:f=http://java.sun.com/jsf/core;
  | xmlns:c=http://java.sun.com/jstl/core;
  | xmlns:fn=http://java.sun.com/jsp/jstl/functions;
  | ui:composition template=/pages/template.xhtml
  | ui:define name=topnav
  | ui:include src=/pages/incl/navbar.xhtml /
  | /ui:define
  | ui:define name=body
  | f:view
  | h:form id=resultQuery
  | s:fieldset legend=Settings: align=left
  | h:panelGrid bgcolor=#cc 
columns=5
  | t:selectOneMenu 
id=rowPerPageOption onchange=submit(this)
  | 
valueChangeListener=#{searchResult.rowPerPageChanged}
  | f:selectItem 
itemLabel=5 itemValue=5 /
  | f:selectItem 
itemLabel=10 itemValue=10 /
  | f:selectItem 
itemLabel=20 itemValue=20 /
  | f:selectItem 
itemLabel=30 itemValue=30 /
  | f:selectItem 
itemLabel=40 itemValue=40 /
  | f:selectItem 
itemLabel=50 itemValue=50 /
  | f:selectItem 
itemLabel=100 itemValue=100 /
  | f:selectItem 
itemLabel=200 itemValue=200 /
  | /t:selectOneMenu
  | 
  | h:commandButton 
action=#{searchResult.setting}
  | value=Columns... /
  | 
  | h:commandButton 
actionListener=#{exportData.export}
  | value=Export to Excel 
/
  | h:commandButton 
actionListener=#{exportDataIText.exportToPDF}
  | value=Export to PDF /
  | h:commandButton 
actionListener=#{exportDataIText.exportToRTF}
  | value=Export to Word 
/
  | 
  | s:pprPanelGroup 
id=pprInlineMsg
  | 
partialTriggers=resultQuery:rowPerPageOption
  | 
inlineLoadingMessage=Loading.../s:pprPanelGroup
  | 
  | t:popup styleClass=popup 
id=popupMenu
  | 
  | h:outputText 
value=loading file
  | 
rendered=#{exportData.loading} /
  | f:facet name=popup
  | h:panelGroup
  | 
h:panelGrid columns=1
  | 
ui:repeat value=#{exportData.listDownload} var=down
  | 
h:commandLink action=#{dounloadFile.downloading}
  | 
f:param name=fileupload_type value=#{down.contentType} /
  | 
f:param name=fileupload_name value=#{down.filename} /
  | 
h:outputText value=#{down.filename} /
  | 
/h:commandLink
  | 
/ui:repeat
  | 
/h:panelGrid
  | /h:panelGroup
  | /f:facet
  | /t:popup
  | /h:panelGrid
  | /s:fieldset
  | hr /
  | 

  1   2   >