Hot questions for Using Ubuntu in jboss

Question:

I am trying to teach myself how to utilize Hibernate. I am working on Ubuntu 14.0.4 using Eclipse Luna. I have come across some tutorials showing how to use hibernate itself but not really a definitive one for how to actually set it up and use it within a project in eclipse.

I am hoping that someone can shed some light on that. As of now I have downloaded hibernate_release_4.3.6 from the official website and I have installed JBoss in eclipse. I was hoping that JBoss would just install the hibernate stuff for me (and maybe it did) but I am still no closer to using it or importing it into a project.

Any guidance on this would be useful.


Answer:

I suggest clone the Wildfly (newest JBoss) examples repo and look into this project. The readme file is quite descriptive.

Also you may consider using the JBoss Developer Studio. It's based on Eclipse and it has support for JBoss technologies. Youtube tutorial how to set up the Hibernate is here.

Question:

I'm starting with Play Framework and when I'm sending the following commands, it throws a exception.

# play

In Play Console:

[play-java] $ run

It throws:

org.jboss.netty.channel.ChannelException: Failed to bind to: /0.0.0.0:9000
at org.jboss.netty.bootstrap.ServerBootstrap.bind(ServerBootstrap.java:272)
at play.core.server.NettyServer$$anonfun$10.apply(NettyServer.scala:171)
at play.core.server.NettyServer$$anonfun$10.apply(NettyServer.scala:168)
at scala.Option.map(Option.scala:145)
at play.core.server.NettyServer.<init>(NettyServer.scala:168)
at play.core.server.NettyServer$$anonfun$mainDev$1.apply(NettyServer.scala:347)
at play.core.server.NettyServer$$anonfun$mainDev$1.apply(NettyServer.scala:345)
at play.utils.Threads$.withContextClassLoader(Threads.scala:18)
at play.core.server.NettyServer$.mainDev(NettyServer.scala:344)
at play.core.server.NettyServer$.mainDevHttpMode(NettyServer.scala:340)
at play.core.server.NettyServer.mainDevHttpMode(NettyServer.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at play.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$1.apply(PlayRun.scala:233)
at play.PlayRun$$anonfun$playRunTask$1$$anonfun$apply$1.apply(PlayRun.scala:91)
at scala.Function7$$anonfun$tupled$1.apply(Function7.scala:35)
at scala.Function7$$anonfun$tupled$1.apply(Function7.scala:34)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)

Caused by: java.net.BindException: Address already in use
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:463)
at sun.nio.ch.Net.bind(Net.java:455)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.jboss.netty.channel.socket.nio.NioServerBoss$RegisterTask.run(NioServerBoss.java:193)
at org.jboss.netty.channel.socket.nio.AbstractNioSelector.processTaskQueue(AbstractNioSelector.java:366)
at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:290)
at org.jboss.netty.channel.socket.nio.NioServerBoss.run(NioServerBoss.java:42)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)

I'm trying using my local user, root user, changing ports (ie: run 8080), start instead of run, and it always throw the same exception.

By the way, port 9000 is not in use by another application.

Anyone has any clue?

I'm using Ubuntu 12.04 LTS, and Play Framework 2.2.6.

Thanks.


Answer:

The error is that your port is being used by another process.

In a UNIX machine the command lsof -i:9000 will give the processes that are using the port.


As you have noted correctly processes with root permissions can be hidden if you use the terminal not as root

Question:

I am trying to run java EE application on server (using wild fly which is the JBoss community edition). I have built a .war file (named Project_war.war which I have located in wildfly/standalone/deployments) and now I just go to wildfly/bin and run ./standalone.bat but it gives the following error:

./standalone.bat: line 1: @echo: command not found 
./standalone.bat: line 2: rem: command not found 
./standalone.bat: line 3: rem: command not found 
./standalone.bat: line 4: rem: command not found
./standalone.bat: line 5: $'\r': command not found 
./standalone.bat: line 6: rem: command not found 
./standalone.bat: line 7: rem: command not found 
./standalone.bat: line 8: rem: command not found
./standalone.bat: line 9: $'\r': command not found 
./standalone.bat: line 10: @if: command not found 
./standalone.bat: line 11: $'setlocal\r': command not found 
./standalone.bat: line 12: $'\r': command not found 
./standalone.bat: line 13: rem: command not found
./standalone.bat: line 16: rem: command not found 
./standalone.bat: line 18: $'\r': command not found 
./standalone.bat: line 19: $'\r': command not found 
./standalone.bat: line 20: syntax error near unexpected token `(' '
./standalone.bat: line 20: `if NOT "x%DEBUG%" == "x" (

Any suggestions? P.S. I am using ubuntu


Answer:

Why would you run the standalone.bat file on Ubuntu. Try running the corresponding .sh file. That should work for you.