How to load APR Connector (Native) in JBoss 7 - jboss

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

Related

gwt server not found after deployment

I've a strange problem. I created the plain vanilla Greetings example with the webAppCreator of gwt. That means I created a project called Test and after that I did not modify it in any way. Then I created a war file with "ant war" and deployed this on my local tomcat 7. The server starts fine and the Grettings page is loaded properly. But, when clicking on the Send button I get the following error:
There a no error messages in the tomcat logs. However in the development mode the stuff works fine. I'm using gwt 2.5. Any idea what could cause this problem?
Edit: Maybee this gives some further insights:
I found a stack trace:
java.lang.UnsupportedClassVersionError: com/server/GreetingServiceImpl : Unsupported major.minor version 51.0 (unable to load class com.server.GreetingServiceImpl)
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2908)
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1173)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1681)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:461)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
java.lang.Thread.run(Thread.java:680)
But what does it mean?
Okay, I found the problem.
The error UnsupportedClassVersionError means that I tried to run a compiled java file with an older runtime, i.e. I compiled the servlets with java 7 and tried to run them with java 6.
I repaired this by setting the correct JAVA_HOME path to my .bash_profiles file like this
export JAVA_HOME=/path/to/java_7/Home
That was it, now everything runs fine. Thanks for reading anyway.

Unable to call JAX-WS client deployed on JBoss 7.1.1

I have a generated jax-ws web service client that runs fine when I run it as a java standalone project. However if I add it to a web application (war) deployed on JBoss 7.1.1 and call the web service it throws the following exception:
Caused by: java.lang.NoClassDefFoundError: com/ctc/wstx/io/DefaultInputResolver
at com.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:628)
at com.ctc.wstx.stax.WstxInputFactory.createXMLStreamReader(WstxInputFactory.java:324)
at __redirected.__XMLInputFactory.createXMLStreamReader(__XMLInputFactory.java:139) [jboss-modules.jar:1.1.1.GA]
at org.apache.cxf.staxutils.StaxUtils.createXMLStreamReader(StaxUtils.java:1176)
at org.apache.cxf.interceptor.StaxInInterceptor.handleMessage(StaxInInterceptor.java:104)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:795)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1626)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1493)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1401)
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:648)
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:531)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:461)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:364)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:317)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:88)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:134)
at $Proxy189.getcodelists(Unknown Source)
Idea what I may be missing?
As the error says, the App server is unable to find the said class file. Is it possible in your standalone app your classpath has the library but JBoss AS 7 is unable to find it.
If you can isolate where this library is, you can either bundle it with your WAR file or create a jboss_module to satisfy the dependency.
Good luck!

Tomcat 7 in Eclipse Indigo: javax.naming.NameNotFoundException: Resource /WEB-INF/classes not found

I am trying to configure Tomcat 7 in Eclipse Indigo, i added the Tomcat plugin from http://www.eclipsetotale.com/tomcatPlugin.html#A3 into eclipse\plugins folder.
Now when i start tomcat i am getting the below error:
Feb 13, 2012 4:23:35 PM org.apache.catalina.startup.ContextConfig webConfig
SEVERE: Unable to determine URL for WEB-INF/classes
javax.naming.NameNotFoundException: Resource /WEB-INF/classes not found
at org.apache.naming.resources.BaseDirContext.listBindings(BaseDirContext.java:733)
at org.apache.naming.resources.ProxyDirContext.listBindings(ProxyDirContext.java:546)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1197)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:825)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:300)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5161)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:897)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:873)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1095)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1617)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Feb 13, 2012 4:23:35 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
SEVERE: Unable to determine URL for WEB-INF/classes
javax.naming.NameNotFoundException: Resource /WEB-INF/classes not found
This is actually a bug in Tomcat 7.0.25 and fixed in Tomcat 7.0.26. See also issue 52511. Please note that you can just continue using your web application! This log is purely informal and does not block Tomcat from starting and functioning. It's caused by a change in the way how Tomcat scans annotated classes. This stacktrace will be printed when you don't have any classes in your Eclipse project and hence the /WEB-INF/classes remains empty.
Upgrading to Tomcat 7.0.26 will hide this log. You can also just ignore it altogether and continue using Tomcat as usual.
As per the comments,
i Installed Eclipse for Java EE, in that in the server tab i added the server , when i run the server and try to open the localhost:8080 in the browser, it did not give me the welcome page, therefore i added the plugin in the eclipse plugins, now it gives me the welcome page in browser but adding to that it gives above error in console.
What did it give instead? A server-specific 404 error page or a browser specific "Connection timeout" page? If 404, then the server runs perfectly fine, it's just the URL which did not point anything. Note that Eclipse does by default not deploy Tomcat's own homepage, simply because that's not useful at all while developing. It will only deploy Tomcat's own homepage when you configure Eclipse to take over Tomcat installation instead of using its engine:
You need to let the URL point to the real URL of the deployed web project. It defaults to the project name which is configureable in project's properties. If the project name is for example "Playground", then you need to open http://localhost:8080/Playground instead. If you want to have it on domain root, then you need to change the Context root in Web Project Settings to /:
Last but not least, I recommend to remove that Sysdeo plugin which you installed without any necessary reason. It is not in any way better than the Eclipse-builtin plugin.
See also:
Tomcat started in Eclipse but unable to connect to http://localhost:8085/

Tomcat not starting

i always get the following error when trying to start Tomcat in eclipse (or also from the terminal with this specific war file)the build using ant is successful of course:
08.08.2011 08:21:02 org.apache.catalina.core.StandardContext loadOnStartup
SCHWERWIEGEND: Servlet threw load() exception
java.lang.ClassNotFoundException: dea.alo.aloWeb.spring.StxxDelegatingRequestProcessor
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1678)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1523)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at com.oroad.stxx.plugin.StxxPlugin.initRequestProcessorClass(StxxPlugin.java:153)
at com.oroad.stxx.plugin.StxxPlugin.init(StxxPlugin.java:102)
at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:1158)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:473)
at javax.servlet.GenericServlet.init(GenericServlet.java:160)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1216)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1135)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1031)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4957)
at org.apache.catalina.core.StandardContext$3.call(StandardContext.java:5284)
at org.apache.catalina.core.StandardContext$3.call(StandardContext.java:5279)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)
It runs perfectly on a pc using linux and eclipse galileo, but not on my mac using eclipse indigo. the libraries are all in place..does anyone have an idea what the problem might be?
Looks like I syncyronisation problem I often have.
Refresh the Workspace
Project Build (most time not needed) - But make sure that there are no build errors
Then run the two tasks from the Servers/(tomcat) Context menu
Clean...
Clean Tomcat Working Directory
If this all does not help, then Remove the application from the Server, clean the Server and Deploy the application again to the server.
The class StxxDelegatingRequestProcessor is missing in your classpath -> "ClassNotFoundException: dea.alo.aloWeb.spring.StxxDelegatingRequestProcessor"
I think you copied the struts conf from a site but not the class :)

JavaEE in netbeans giving BUILD FAILED error upon deployment

When I try to run my Java EE program in Netbeans consisting of servlets (java pages), JSP's, beans(java pages) and HTML pages I get this error in the output:
In-place deployment at C:\Users\Derek\Documents\NetBeansProjects\EJBProject\EJBProject-war\build\web
Initializing...
deploy?path=C:\Users\Derek\Documents\NetBeansProjects\EJBProject\EJBProject-war\build\web&name=EJBProject-war&force=true failed on Personal GlassFish v3 Domain
C:\Users\Derek\Documents\NetBeansProjects\EJBProject\EJBProject-war\nbproject\build-impl.xml:611: The module has not been deployed.
BUILD FAILED (total time: 1 second)
And then in the command prompt when I run asant run in the appropriate directory, I get:
C:\Users\Derek\Documents\NetBeansProjects\EJBProject\nbproject\build-impl.xml:19: Class org.apache.tools.ant.taskdefs.condition.Not doesn't support the nested "antversion" element.
Do you know why this would be? Why won't netbeans deploy my application so I can run and test it?
EDIT:
ant version is actually came up with...
Apache Ant version 1.6.5 compiled on June 2 2005
The glassfish output logs say:
SEVERE: Exception while loading the app
java.lang.RuntimeException: EJB Container initialization error
at org.glassfish.ejb.startup.EjbApplication.loadContainers(EjbApplication.java:219)
at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:197)
at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:63)
at org.glassfish.internal.data.ModuleInfo.load(ModuleInfo.java:175)
at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:216)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:338)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:183)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:272)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:305)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:320)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1176)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$900(CommandRunnerImpl.java:83)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1235)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1224)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:365)
at com.sun.enterprise.v3.admin.AdminAdapter.service(AdminAdapter.java:204)
at com.sun.grizzly.tcp.http11.GrizzlyAdapter.service(GrizzlyAdapter.java:166)
at com.sun.enterprise.v3.server.HK2Dispatcher.dispath(HK2Dispatcher.java:100)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:245)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.RuntimeException: Error while binding JNDI name x.results#x.results for EJB : resultsBean
at com.sun.ejb.containers.BaseContainer.initializeHome(BaseContainer.java:1530)
at com.sun.ejb.containers.StatefulSessionContainer.initializeHome(StatefulSessionContainer.java:214)
at com.sun.ejb.containers.ContainerFactoryImpl.createContainer(ContainerFactoryImpl.java:161)
at org.glassfish.ejb.startup.EjbApplication.loadContainers(EjbApplication.java:207)
... 32 more
Caused by: javax.naming.NameAlreadyBoundException: Use rebind to override
at com.sun.enterprise.naming.impl.TransientContext.doBindOrRebind(TransientContext.java:275)
at com.sun.enterprise.naming.impl.TransientContext.bind(TransientContext.java:214)
at com.sun.enterprise.naming.impl.SerialContextProviderImpl.bind(SerialContextProviderImpl.java:79)
at com.sun.enterprise.naming.impl.LocalSerialContextProviderImpl.bind(LocalSerialContextProviderImpl.java:81)
at com.sun.enterprise.naming.impl.SerialContext.bind(SerialContext.java:586)
at com.sun.enterprise.naming.impl.SerialContext.bind(SerialContext.java:602)
at javax.naming.InitialContext.bind(InitialContext.java:404)
at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.publishObject(GlassfishNamingManagerImpl.java:206)
at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.publishObject(GlassfishNamingManagerImpl.java:187)
at com.sun.ejb.containers.BaseContainer$JndiInfo.publish(BaseContainer.java:5484)
at com.sun.ejb.containers.BaseContainer.initializeHome(BaseContainer.java:1515)
EDIT:
It seems to be regarding my 'stateful' session bean, as when I delete it, it runs perfectly.
My best guess is that you downloaded and installed the 'Web Profile' of GlassFish Server 3 OR you have created a web app that has a deployment descriptor that forces the server to treat it as a Java EE 5 (or even J2EE 1.4) and then created an EJB in that web app... which would probably lead to these sorts of errors.
It seems you have some fields on your Stateful session bean that may have the same name of another Stateful Session bean fields. It just a guess. There is no much info about your EJBS to make a deep analysis. Hope it helps