Jboss 7.X application server on mac? - eclipse

I am currently trying to set up the jboss server and every time I use the command ./standalone.sh to start it....I end up with the following results.
jamess-iMac:bin jameslockhart$ ls
add-user.bat domain.conf jconsole.sh standalone.sh
add-user.sh domain.conf.bat jdr.bat vault.bat
appclient.bat domain.sh jdr.sh vault.sh
appclient.conf init.d run.bat wsconsume.bat
appclient.conf.bat jboss-cli.bat run.sh wsconsume.sh
appclient.sh jboss-cli.sh standalone.bat wsprovide.bat
client jboss-cli.xml standalone.conf wsprovide.sh
domain.bat jconsole.bat standalone.conf.bat
jamess-iMac:bin jameslockhart$ ./standalone.sh
=========================================================================
JBoss Bootstrap Environment
JBOSS_HOME: /Users/jameslockhart/desktop/apps/jboss
JAVA:/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/bin/java
JAVA_OPTS: -server -XX:+UseCompressedOops -XX:+TieredCompilation -Xms64m-Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Djboss.server.default.config=standalone.xml
=========================================================================
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
19:08:17,223 INFO [org.jboss.modules] JBoss Modules version 1.1.1.GA
19:08:17,362 INFO [org.jboss.msc] JBoss MSC version 1.0.2.GA
19:08:17,400 INFO [org.jboss.as] JBAS015899: JBoss AS 7.1.1.Final "Brontes" starting
All the tutorials I have watched have it going beyond the "Brontes" starting. Mine just sits there. Does anyone know what is wrong?
Any help would be appreciated!!

There was a bug in JBoss 7.1.1 that prevented it from starting on JDK8. JBoss AS7 is extremely outdated, you need to either use JDK7, or ideally upgrade to a recent version of Wildfly or JBoss EAP.

I was able to download wildfly and the system works flawlessly. Thanks for the help everyone.

Related

JBoss: get know the listening port

Sorry for a silly question. I am starting JBoss for a first time. I need to know what is happening.
I started server on my linux machine with command:
./standalone.sh -Djboss.bind.address=127.0.0.1 -Djboss.bind.address.management=127.0.0.1&
This is what I see in terminal right now:
=========================================================================
JBoss Bootstrap Environment
JBOSS_HOME: /usr/local/share/jboss
JAVA: /usr/lib/jvm/java-8-oracle/bin/java
JAVA_OPTS: -server -XX:+UseCompressedOops -Xms1303m -Xmx1303m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true
=========================================================================
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
13:46:46,874 INFO [org.jboss.modules] (main) JBoss Modules version 1.2.2.Final-redhat-1
13:46:47,032 INFO [org.jboss.msc] (main) JBoss MSC version 1.0.4.GA-redhat-1
13:46:47,090 INFO [org.jboss.as] (MSC service thread 1-7) JBAS015899: JBoss EAP 6.1.1.GA (AS 7.2.1.Final-redhat-10) starting
The silly question is: which port I should try to find JBoss there?
Default port is 8080 for web applications. Admin web console is on 9990

Jenkins auto deploy to Jboss AS 7.1.1 fails with java.lang.OutOfMemoryError: Java heap space

I've been facing this error for few days, appreciate if somebody could kindly advise.
My pom is configured with jboss auto deploy plugin version 7.1.1.Final. When I build the project from jenkins it builds fine but cannot deploy to jboss, fails with below exception:
Oct 21, 2013 6:55:02 PM org.jboss.remoting3.EndpointImpl <clinit>
INFO: JBoss Remoting version 3.2.3.GA
Authenticating against security realm: ManagementRealm
Exception in thread "management-client-thread 1-1" java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:2271)
at java.io.ByteArrayOutputStream.grow(ByteArrayOutputStream.java:113)
at java.io.ByteArrayOutputStream.ensureCapacity(ByteArrayOutputStream.java:93)
at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:140)
at org.jboss.as.protocol.StreamUtils.copyStream(StreamUtils.java:49)
at org.jboss.as.controller.client.impl.AbstractModelControllerClient$ReadAttachmentInputStreamRequestHandler.copyStream(AbstractModelControllerClient.java:226)
at org.jboss.as.controller.client.impl.AbstractModelControllerClient$ReadAttachmentInputStreamRequestHandler$1.execute(AbstractModelControllerClient.java:202)
at org.jboss.as.protocol.mgmt.AbstractMessageHandler$2$1.doExecute(AbstractMessageHandler.java:287)
at org.jboss.as.protocol.mgmt.AbstractMessageHandler$AsyncTaskRunner.run(AbstractMessageHandler.java:487)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
at org.jboss.threads.JBossThread.run(JBossThread.java:122)
This is jvm setting I've got:
-Xms128m -Xmx512m -XX:MaxPermSize=256m
Thanks
Prash
Add more memory to Maven:
(Windows) Set the Variable name to MAVEN_OPTS and set the Variable value to -Xmx1024m (or more)
In IntellijIdea Settings -> Build, Excecution, Deployment ->Build tools-> Maven -> Runner -> add param (-Xmx1024m (or more)) to VM Options.

Accessing ejb deployed in JBoss 7.0.1 from another client

Having deployed an EJB module in JBoss 7.0.1, I am trying to access it from a client executing on another JVM. However, I am unable to figure out the client side jars needed to add to my client's classpath.
I tried out with the following:-
jboss-ejb-api_3.1_spec-1.0.1.Final.jar
jboss-ejb-client-1.0.0.Beta11.jar
3.jboss-logging-3.1.0.CR2.jar
jboss-marshalling-1.3.4.GA.jar
5.jboss-marshalling-river-1.3.4.GA.jar
jboss-remoting-3.2.0.CR8.jar
7.jboss-sasl-1.0.0.Beta9.jar
jboss-transaction-api_1.1_spec-1.0.0.Final.jar
xnio-api-3.0.0.CR7.jar
There seems to be some inconsistency in this setup and I get this exception:-
INFO: JBoss EJB Client version 1.0.0.Beta11 Nov 9, 2012 12:01:04 AM
org.xnio.Xnio INFO: XNIO Version 3.0.0.CR7 Nov 9, 2012
12:01:04 AM org.jboss.ejb.client.ConfigBasedEJBClientContextSelector
createConnections ERROR: Could not create connection for connection
named default java.lang.IllegalArgumentException: No matching XNIO
provider found at org.xnio.Xnio.doGetInstance(Xnio.java:192) at
org.xnio.Xnio.getInstance(Xnio.java:146) at
org.jboss.remoting3.Remoting.createEndpoint(Remoting.java:73)
...
I didn't have any issues while having a client access an ejb deployed in JBoss 7.1.0 Final, JBoss 6.1.0 Final or Glassfish servers. The jars required at the client side war available.
I am a newbie in Java EE and Application Servers by the way and I am trying to learn in the process.
Thanks.
please add xnio-nio-3.0.3.GA.jar in your classpath
In addition to Ramkumar's answer, I am adding the maven dependency for this jar. Following the maven dependency for the jar:
<dependency>
<groupId>org.jboss.xnio</groupId>
<artifactId>xnio-nio</artifactId>
<version>3.0.3.GA</version>
</dependency>

JBoss 7.1.1 and JBoss Web Native

I'm trying to enable the JBoss Web Native libraries in JBoss 7.1.1. I have read this question and the answers and have tried the following steps to enable the native libraries in JBoss, but it didn't work so far. I'm on OS X:
Downloaded the macosx archive from http://www.jboss.org/jbossweb/downloads/jboss-native-2-0-10
Unzipped it into the JBoss directory, so the contents of the archive are available in bin/native.
Updated bin/standalone.conf to include the library path: JAVA_OPTS="$JAVA_OPTS -Djava.library.path=/path/to/jboss-as-7.1.1.Final-native/bin/native:$PATH"
Starting JBoss, I can still see the following in the log file:
[org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-1) Starting Coyote HTTP/1.1 on http-localhost-127.0.0.1-8080
instead of the expected Http11AprProtocol.
What am I missing?
Turns out the above steps are no longer necessary for JBoss 7.1.1, as the native libraries are now bundled under modules/org/jboss/as/web/main/lib.
To enable their usage, I had to set the native attribute to true in the web subsystem in standalone.xml. For some reason it was set to false in the default configuration:
<subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host"
native="true">
<connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>
<virtual-server name="default-host" enable-welcome-root="true">
<alias name="localhost"/>
<alias name="example.com"/>
</virtual-server>
</subsystem>
JBOSS EAP 6.0
Check if you have modules/org/jboss/as/web/main/lib in JBOSS_HOME.
If not as it is in my version of JBoss EAP 6.0.
first: yum install tomcat-native.x86_64
Now your system has got tomcat native library under /usr/lib64 that is generally in the java.library.path
then set native=true in subsystem web as nwinkler's suggested:
<subsystem xmlns="urn:jboss:domain:web:1.1" default-virtual-server="default-host"
native="true">
<connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>
<virtual-server name="default-host" enable-welcome-root="true">
<alias name="localhost"/>
<alias name="example.com"/>
</virtual-server>
and now restart JBOSS.
Without tomcat native libraries installed you have in log:
10:12:31,700 INFO [org.apache.catalina.core.AprLifecycleListener] (MSC service thread 1-1) The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/jdk1.6.0_37/jre/lib/amd64/server:/usr/java/jdk1.6.0_37/jre/lib/amd64:/usr/java/jdk1.6.0_37/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
10:12:32,203 INFO [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-8) Starting Coyote HTTP/1.1 on http-/127.0.0.1:8080
With tomcat native libraries installed your log writes:
10:22:56,147 INFO [org.apache.coyote.http11.Http11AprProtocol] (MSC service thread 1-5) Starting Coyote HTTP/1.1 on http-/127.0.0.1:8080
ALTERNATIVE
1) Download native library from JBoss web sites:
wget http://downloads.jboss.org/jbossnative/2.0.10.GA/jboss-native-2.0.10-linux2-x64-ssl.tar.gz
2) untar
tar xvzf jboss-native-2.0.10-linux2-x64-ssl.tar.gz
3) Create a folder for your native-libraries:
mkdir -p tomcat-native
4) Move bin/native in your new folder
mv bin/native tomcat-native
5) Make your folder visible by java. Add this in standalone.conf or domain.conf
JAVA_OPTS="$JAVA_OPTS -Djava.library.path=[the tomcat-native's folder path]

How to load APR Connector (Native) in JBoss 7

I want to use Atmosphere XMPP but i need to load native connector APR. I am not very familiar as of yet with JBoss 7 so i was wondering if anyone knows how to do this? WIndows x64 or Linux x64 environment. Doesn't matter. Thanks
Assuming Linux x64 here. I am using Ubuntu 11.04 x64.
Download JBoss7 distribution and unzip it to a suitable directory ( from here I am assuming that you have it in your '/home/myname/tools/jboss701/' folder.
Start it using /jboss701/bin/standalone.sh and verify that it started properly ( check localhost:8080 url). Close the jboss for now.
Download the native libraries from here http://www.jboss.org/jbossweb/downloads/jboss-native-2-0-9.html . I have downloaded this one jboss-native-2.0.9-linux2-x64-ssl.tar.gz
Unpack it to the '/home/myname/tools/jboss701/' folder. You should see the contents of the archive in '/home/myname/tools/jboss701/bin' folder. Also, verify that you have 'native' folder under the '/home/myname/tools/jboss701/bin'
IMPORTANT: unfortunately, it doesn't work out of the box. You must make the following change: add the
JAVA_OPTS="$JAVA_OPTS
-Djava.library.path=/home/myname/tools/jboss701/bin/native:$PATH"
string to your 'standalone.conf' file.
Start JBoss with the 'standalone.sh' script. Verify that you have the following line in the console during the JBoss startup: 'org.apache.coyote.http11.Http11AprProtocol'. If you see 'org.apache.coyote.http11.Http11AprProtocol' instead of 'org.apache.coyote.http11.Http11Protocol' then everything is working as expected.
Thanks man, i got it working. I do see these lines now in my startup script. `15:13:09,687 INFO [org.apache.catalina.core.AprLifecycleListener] (MSC service thread 1-7) An older version 1.1.20 of the Apache Tomcat Native li
brary is installed, while Tomcat recommends version greater then 1.1.21
15:13:11,110 INFO [org.apache.coyote.http11.Http11AprProtocol] (MSC service thread 1-3) Starting Coyote HTTP/1.1 on http--127.0.0.1-8080` Atmosphere unforunately, is still throwing the same error.
java.lang.IllegalStateException: JBoss failed to detect this is a Comet application because the APR Connector is not enabled.
Make sure atmosphere-compat-jboss.jar is not under your WEB-INF/lib and
there is no context.xml under WEB-INF
org.atmosphere.container.JBossWebCometSupport.<clinit>(JBossWebCometSupport.java:66)
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
java.lang.reflect.Constructor.newInstance(Constructor.java:513)
org.atmosphere.cpr.DefaultCometSupportResolver.newCometSupport(DefaultCometSupportResolver.java:178)
org.atmosphere.cpr.DefaultCometSupportResolver.resolveWebSocket(DefaultCometSupportResolver.java:223)
org.atmosphere.cpr.DefaultCometSupportResolver.resolve(DefaultCometSupportResolver.java:217)
org.atmosphere.cpr.AtmosphereServlet.autoDetectContainer(AtmosphereServlet.java:900)
org.atmosphere.cpr.AtmosphereServlet.init(AtmosphereServlet.java:530)
org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:70)
org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765)
org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291)
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
java.lang.Thread.run(Thread.java:662)
I've set everything up as in the demos. too