• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to deploy standalone java Api in JBoss

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have a standalone java project which is basically a Snmp trap listener. this application will keep listening in a port. currently this app will be started by calling main method.
how to deploy this project in Jboss. whenever jboss server is started this application should also started and keep listening in a port.

please advice me what should i do for this.


Thanks in advance,
Maurice
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sounds like you want to convert this app into a service. Exactly how to do this depends on the version of Boss AS. For 6.x and earlier you would convert it into an MBean. Not sure what the corresponding thing would be in 7.x.
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Peter Johnson wrote:Not sure what the corresponding thing would be in 7.x.


AS 7.x supports MBeans too although the xsd for -service.xml files has changed slightly (some advanced features have been removed and no longer supported).
 
Rancher
Posts: 989
9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In EE6 you'll want to look at @Startup and @Singleton but remember that


Why can an enterprise bean not listen to or accept connections on a socket?
Because if an enterprise bean is listening on a socket, it can't be passivated -- it must always be available. Enterprise beans can be network socket clients, and so they can use other network resources (including other enterprise bean servers) to do their jobs. Just as with a database connection, don't hang on to open client sockets across method calls; instead, open them, communicate through the socket, and close it before returning from the method.

from http://java.sun.com/blueprints/qanda/ejb_tier/restrictions.html

Of course you could use container specific strategies to turn off passivation and probably get it to work but the question here is what is the motivation for deploying this into an EJB container?
 
reply
    Bookmark Topic Watch Topic
  • New Topic