jboss
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
jboss [2014/10/28 15:08] – skipidar | jboss [2020/12/27 20:35] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ==== Debug in Eclipse IDE ==== | ||
+ | Open the configuration file of the JBoss **standalone.conf** | ||
+ | |||
+ | Uncomment the following line at the bootom of the file | ||
+ | < | ||
+ | # Sample JPDA settings for remote socket debugging | ||
+ | JAVA_OPTS=" | ||
+ | </ | ||
+ | |||
+ | Open the configuraion file of the JBoss **standalone.conf.bat** | ||
+ | |||
+ | Uncomment the following line: | ||
+ | < | ||
+ | rem # Sample JPDA settings for remote socket debugging | ||
+ | set " | ||
+ | </ | ||
+ | |||
+ | Debugging via Port 8787 is enabled after you restart the server. | ||
+ | |||
+ | |||
+ | |||
+ | Connect with the debugger: | ||
+ | |||
+ | {{http:// | ||
+ | |||
+ | Add debuggin points in server Code, there will be an own debugging stack: | ||
+ | |||
+ | {{http:// | ||
+ | |||
+ | ==== Publishing Services over IP ==== | ||
+ | The settings are located in **standalone.xml** | ||
+ | To make the JBoss7 reachable not over localhost only do: | ||
+ | * provide a new interface (named " | ||
+ | * assing this interface to the sockets you wish to open | ||
+ | |||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | |||
+ | ==== Deployment ==== | ||
+ | |||
+ | To Deploy an artifact on jboss it ust be annotated as a Service or Bean: | ||
+ | <sxh java> | ||
+ | // annotating a service as Stateless is enough to make in injectable. Here it is injectable via intrerfaces | ||
+ | @Remote(BasicService.class) | ||
+ | @Local(BasicServiceLocal.class) | ||
+ | @Stateless | ||
+ | public class BasicServiceBean{ ... } | ||
+ | |||
+ | // annotating a bean maps it to a table in the DB | ||
+ | @Entity | ||
+ | @Table(name = " | ||
+ | @NamedQueries({@NamedQuery(name = PersonenBean.FIND_NEXT_PERSON_ID, | ||
+ | @FilterDef(name = HasCtxMandant.FILTER, | ||
+ | @Filter(name = HasCtxMandant.FILTER, | ||
+ | public class PersonenBean extends AbstractEntity< | ||
+ | |||
+ | private static final long serialVersionUID = 1L; | ||
+ | |||
+ | public static final String FIND_NEXT_PERSON_ID = " | ||
+ | |||
+ | @EmbeddedId | ||
+ | public PersonenId id; | ||
+ | |||
+ | @Column(name = " | ||
+ | public String name; | ||
+ | |||
+ | @Column(name = " | ||
+ | public String firstName; | ||
+ | ... | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | If the bean is not within the deployed war - it has to be introduced to the system manually, by adding an entry to the **persistance.xml** | ||
+ | |||
+ | <sxh java> | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | |||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | |||
+ | ==== Socket bindings - ports==== | ||
+ | |||
+ | Jboss default ports can be checked by | ||
+ | * starting the WildFly server | ||
+ | * navigating the admin console via browser http:// | ||
+ | |||
+ | The ports can be seen in section **Socket Bindings**: | ||
+ | |||
+ | {{ http:// | ||
+ | |||
+ | |||
+ | ==== JNDI - Communication between Client and Server ==== | ||
+ | |||
+ | A technique, which allows to retrieve services via their names. | ||
+ | This is a way to communicate between Server and Client, by retrieving server-services by their names. | ||
+ | |||
+ | <sxh java> | ||
+ | |||
+ | public static <T> T get(Class< | ||
+ | try { | ||
+ | InitialContext initCtx = createInitialContext(); | ||
+ | return lookup(initCtx, | ||
+ | } catch (Throwable ex) { | ||
+ | log.error(" | ||
+ | if (ex instanceof RuntimeException) { | ||
+ | throw (RuntimeException) ex; | ||
+ | } else { | ||
+ | throw new RuntimeException(ex); | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | private static InitialContext createInitialContext() throws NamingException { | ||
+ | Properties prop = new Properties(); | ||
+ | prop.put(Context.INITIAL_CONTEXT_FACTORY, | ||
+ | return new InitialContext(prop); | ||
+ | } | ||
+ | </ |