Juan Sotelo

Greenhorn
+ Follow
since Dec 01, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Juan Sotelo

I solve the problem with the following code:



Thanks.
12 years ago
I already solve the problem. The issues was that I was calling a configuration file twice and this actions produce 2 listeners (2 consumers).

Thanks.
Hello everybody.. well I am working with spring and ActiveMQ.I followed some examples and I was able to send and receive a message to a JMS queue. But I have a doubt, since, when I look into the ActiveMQ console I have 2 consumers! and I wonder why??? I Should have just one!.

I made a quick example project (so, you dont have to loose much time), so you can see all the code and test it... so you can replicate the problem..

Also this example app could be helpfull for some one else. (Spring MVC and ActiveMQ, example project)

I hope someone have time to take a look at this and answer this doubt!

Thanks.

http://www.megaupload.com/?d=A79K8F1V
Like you see in the code, I already made the changes in order to change the destination and send all the messages to a topic:
<bean id="destination" class="org.apache.activemq.command.ActiveMQTopic"

Before I got:
<bean id="destination" class="org.apache.activemq.command.ActiveMQQueue">

The rare thing is that bouth configurations throws same results. What I am doing wrong?

regards and thanks for reading!
12 years ago
No sure if this is the right place to do my ask, but I am going to give a try:

This is the code:


Well, I want to send my messages to a topic, not to a Queue. With this configuration all the messages are going to the Queue, not to the topic. I can see in the activemq admin page that the topic is not been created, and is created under the queue section?.

What, I am doing wrong?
12 years ago

Like the title said: I want to send logs to a queue in ActiveMQ using log4j - I already did it, but to a topic. is this possible?? What do I have to change in the appender??

log4j.appender.jms=org.apache.log4j.net.JMSAppender
log4j.appender.jms.InitialContextFactoryName=org.apache.activemq.jndi.ActiveMQInitialContextFactory
log4j.appender.jms.ProviderURL=tcp://localhost:61616
log4j.appender.jms.TopicBindingName=logTopic
log4j.appender.jms.TopicConnectionFactoryBindingName=ConnectionFactory
log4j.appender.jms.Threshold=ERROR

log4j.rootLogger=INFO, jms

Thanks in advance!
Hello Hussein, thanks for the reply!.

Hussein Baghdadi wrote:It isn't a good practice to access Spring managed beans from JSP pages. Separate the logic from the presentation.
What I'm talking about is to employ MVC design pattern. Access your Spring managed beans from a servlet/controller and then use JSP to display the data in question.



I am trying to follow the MVC pattern like you said but now I am confused. How can I access a bean without using the JSP??

I mean, in the controller that I made I am returning the "authentication" bean, which is the one that I will use in the JSP:



And in the JSP (login.jsp):



Am I following the MVC pattern right? did I made a mistake?

Thanks if you can clarify this to me!..

Take care

PD: with the AuthenticationResult class what I am trying to do.. if the authentication is false, I get some error codes from the authentication service. What I want to do in the JSP, if the authentication is false.. then I show this messages in the JSP. (login.jsp)


12 years ago
Hello everyone, well I have been searching for information about this (accesing a Spring managed bean from a JSP), and I am confused. So my question is? how can I access to a spring managed bean from a jsp?

Thanks! I need ideas!..
12 years ago
In other words I want to access spring managed session beans from jsp.. ??

Regards
12 years ago
Hello to all, I am new in the forum and since I found a lot of solutions in this forum I want to participate.

TOMCAT 7 - Jboss 5.1.0.GA - Spring - JSP

Well I am learning how to work with JSP. I made an app that runs under Tomcat 7 without a problem. But I want to use Jboss so I tried to run my war file in Jboss and I found an error:

JSP


Well authentication is an object of one simple class that I made that has 2 atributes State and Description (getter/setter). I am working with SPRING

Error: org.apache.jasper.JasperException: /WEB-INF/jsp/login.jsp(19,34) The function getState must be used with a prefix when a default namespace is not specified

The poing of this topic is to ask about this (I need some council):

1- Well I am not sure why is working on Tomcat 7 and is not working on Jboss 5.1.0.GA?
2- Well I now that the problem is the JSP (<br /><font color="red">${authentication.getState()} .. <br /><font color="red">${authentication.getDesc()}), how can I resolve this?. I mean I am reading a lot of things in Internet and I am a little bit confuse.. So I want to know which could be the best way to fix this? I am very new to JSP and I am not sure how to proceed. Where to look?
I tried with:
<jsp:useBean id="authentication" class="com.tangoe.test.security.client.models.AuthenticationResult" scope="application">
<jsp:getProperty name="authentication" property="state" />
<jsp:getProperty name="authentication" property="desc" />
</jsp:useBean>
And I changed all the scopes but Is not working so I am not sure.. HELP!!
3- If you can provide me a complete tutorial about this would be great.

That is all! and thanks for reading and trying to help! :D
12 years ago