users@glassfish.java.net

Re: No RESPONSE in 10 days???

From: Daniel Cavalcanti <dhcavalcanti_at_gmail.com>
Date: Thu, 11 Sep 2008 19:48:34 -0400

Thank you Jane.

On Thu, Sep 11, 2008 at 3:02 PM, Jane Young <Jane.Young_at_sun.com> wrote:

> Hi Daniel,
>
> Here's how you can disable JMS queue/topic auto creation in the broker
> using CLI, asadmin:
>
> asadmin set
> cluster-config.jms-service.start-args="-Dimq.autocreate.queue=false
> -Dimq.autocreate.topic=false"
>
> HTH,
> Jane
>
>
>
> Daniel Cavalcanti wrote:
>
> Hi,
>
> I posted a couple of questions more than 10 days ago and I am still waiting
> for a response.
> I used to post questions in this mailing list before and would get answers
> within a day.
> I'd be nice to get a response for this question...
>
> Here are the original messages:
>
>
>
> Hi...
>
> I want to disable the JMS queue/topic auto creation in the broker.
> I know I can accomplish this by setting the following in the
> Configuration -> {cluster}-config -> Java Message Service -> Start
>
> Arguments field: -Dimq.autocreate.queue=false -Dimq.autocreate.topic=false
>
> But I want to be able to do this in a different way: CLI and AMX/JMX.
> What is the equivalent command for CLI. How about the MBean?
>
>
>
> AND
>
> Hi...
>
> I have something very strange happening.
> In an enterprise application that contains an ejb module and a war
> module (JSF), a managed bean calls a business method from the ejb
> module. However, the returned object is always null.
>
>
> When I put some printout statements inside the managed bean method and
> the session bean business method, I get that in the session bean, the
> object being returned is not null. But the object assigned in the
>
> managed bean is null.
>
> This seems like a bug, or am I doing something wrong?
>
> Here are the classes...
>
> Session Bean (with its local interface):
>
> @Local
> public interface AdvertisingLocal {
>
>
> public byte[] getAdvertising();
>
> }
>
>
> @Stateless
> public class AdvertisingBean
> implements AdvertisingLocal {
>
> private static final long HOUR = 3600000L;
>
> private static Object lock = new Object();
>
>
> @Resource
> private TimerService timerService;
>
> @Resource(name="timer-interval")
> private int interval;
>
> private Timer timer;
>
> @EJB
> private AdsFacadeLocal adsFacade;
>
>
> private Iterator<Ads> iterator;
>
> public AdvertisingBean() {
> }
>
> @PostConstruct
> private void construct() {
>
> int count = 0;
> List<Ads> results = adsFacade.findAll();
>
> for (Ads ad : results)
> count += ad.getTokens();
>
> List<Ads> rotation = new ArrayList<Ads>(count);
> for (Ads ad : results)
> for (int i = 0 ; i < ad.getTokens() ; i++)
>
> rotation.add(ad);
>
> synchronized (lock) {
> iterator = rotation.iterator();
> }
>
> }
>
> @PreDestroy
> private void destroy() {
> if (timer != null)
>
> timer.cancel();
> }
>
> @Timeout
> private void timeout(Timer timer) {
> construct();
> }
>
> @AroundInvoke
> private void createTimer(InvocationContext context) {
>
>
> try {
> if (timer == null) {
>
> // set expire for the next hour turn
> Calendar calendar = Calendar.getInstance();
> calendar.setTimeInMillis(System.currentTimeMillis() +
>
> HOUR);
> calendar.set(Calendar.MINUTE, 0);
> calendar.set(Calendar.SECOND, 0);
>
> timer = timerService.createTimer(calendar.getTime(),
> interval, null);
>
> }
>
> } catch (Exception ex) {
> ex.printStackTrace();
> } finally {
> try {
> context.proceed();
> } catch (Exception ex) {
> ex.printStackTrace();
>
> }
> }
> }
>
> public byte[] getAdvertising() {
>
> synchronized (lock) {
>
> if (!iterator.hasNext())
> construct();
>
> byte[] buffer = iterator.hasNext()
>
> ? iterator.next().getContent()
> : "Advertising...".getBytes();
>
> System.out.println("buffer: " + buffer);
>
> return buffer;
>
>
> }
>
> }
>
> }
>
> Here the "buffer" printout is NOT null.
>
>
> Managed Bean:
>
> public class AdvertisingBean {
>
> @EJB
> private AdvertisingLocal advertisingService;
>
>
> public AdvertisingBean() {
> }
>
> public String getContent() {
> System.out.println("service: " + advertisingService);
> System.out.println("content: " +
>
> advertisingService.getAdvertising());
> return String.valueOf(advertisingService.getAdvertising());
> }
>
> }
>
> Here "service" is NOT null, and "content" IS null.
>
> Any help is greatly appreciated.
>
>
> I'm using glassfish version Sun Java System Application Server 9.1.1
> (build b24c-fcs). This is from the admin GUI.
>
> thanks,
> Daniel.
>
>
>
>
>