If you have installed the latest and greatest JBossAS tools into eclipse, try using the following version instead:
?2.2.0.v20110216-175
It seems as though there are some problems with the latest and greatest that causes compilation problems.
Principal Software Engineer/Architect, motorcyclist, drummer, and artist
If you have installed the latest and greatest JBossAS tools into eclipse, try using the following version instead:
?2.2.0.v20110216-175
It seems as though there are some problems with the latest and greatest that causes compilation problems.
For any of you who are used to picking colors with the Photoshop color picker, you will love this:
I am building a project whereby I have a Singleton Bean that I want to fire up when the .jar is deployed in the EJB container, thus I have it annotated as follows:
package com.ryanchapin.ejbTest
@Startup
@Singleton
public class SingletonTest{}
Of course, I have the requisite Local and Remote interfaces set, up, I’ve just left that off for brevity. I am attempting to do a JNDI lookup, from a Servlet in the same JVM using the Local interface which results in:
22:14:31,481 ERROR
[org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/TestWebProject].[ChartData]]
Allocate exception for servlet TestServlet: java.lang.ClassCastException:
$Proxy188 cannot be cast to com.ryanchapin.ejbTestLocal
?at com.ryanchapin.TestServlet<init>(TestServlet.java:51) [:]
?at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)[:1.6.0_17]
?at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)[:1.6.0_17]
?at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)[:1.6.0_17]
?at java.lang.reflect.Constructor.newInstance(Constructor.java:532)[:1.6.0_17]
?at java.lang.Class.newInstance0(Class.java:372) [:1.6.0_17]
?at java.lang.Class.newInstance(Class.java:325) [:1.6.0_17]
?at org.jboss.web.tomcat.service.TomcatInjectionContainer.newInstance(TomcatInjectionContainer.java:280)[:6.0.0.Final]
?at org.jboss.web.tomcat.service.TomcatInjectionContainer.newInstance(TomcatInjectionContainer.java:264)[:6.0.0.Final]
?at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1162)[:6.0.0.Final]
?at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:955)[:6.0.0.Final]
?at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:188)[:6.0.0.Final]
?at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)[:6.0.0.Final]
?at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181)[:6.0.0.Final]
?at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285)[:1.1.0.Final]
?at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261)[:1.1.0.Final]
?at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88)[:6.0.0.Final]
?at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100)[:6.0.0.Final]
?at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)[:6.0.0.Final]
?at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)[:6.0.0.Final]
?at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)[:6.0.0.Final]
?at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)[:6.0.0.Final]
?at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53)[:6.0.0.Final]
?at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362)[:6.0.0.Final]
?at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)[:6.0.0.Final]
?at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:654)[:6.0.0.Final]
?at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951)[:6.0.0.Final]
?at java.lang.Thread.run(Thread.java:636) [:1.6.0_17]
When I lookup the Remote interface JNDI name in the Servlet it works just fine. This only occurs if I have the bean annotated with @Startup. If I remove the @Startup annotation I can access the EJB via the local interface without a problem.
Perhaps a bug in Jboss-6.0.0, I’m not sure. For the time-being I am just going to use the remote interface.
?
The Helios JavaScript validator does not seem to like the jquery-1.5.min.js (or for that matter a number of other know good js libraries). As a result Eclipse complains a lot when building a project.
The quick fix that I found was to disable JavaScript validation under the Builder preferences, for your project:
Project/Properties/Builders
Simply, uncheck the “JavaScript Validator” and you should be all set.
Let’s say that all that you have access to is the command line on a Linux box and you want to know what the network throughput is. If you have another Linux box you can use netcat to do a quick test:
On box a:? Set up netcat to listen to a given port:
nc -l 12345 > /dev/null
Fire up netcat to listen on port 12345 and to dump the output to /dev/null.
On box b:? Send data via netcat to the listening machine:
dd if=/dev/zero bs=16000 count=50000 | nc -v boxa 12345
This will use dd to generate a ‘file’ with 50000 blocks that are 16000 bytes in size and invoke netcat in verbose mode. When invoked you will get something like:
Connection to boxa 12345 port [tcp/*] succeeded!
50000+0 records in
50000+0 records out
800000000 bytes (800 MB) copied, 6.85282 seconds, 117 MB/s
?When I first set up a developoment VM with CentOS I must have forgotten to install the Java source because I could not navigate to Java SE method declarations in my Eclipse IDE.
To have access to the Java source I did the following:
I created a src dir in the aforementioned containing dir and unpacked the zip
I then linked to the source from Eclipse by:
Right-clicking on some java.lang.* method in a class and selecting “view source”
Originally it presented me with a view of the .class file
Clicking on the Add Source button, I navigated to the /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/src/ dir
When I then ran through the Eclipse add server wizard the 6.0 version of JBoss AS was available.
By default, the newer versions of Eclipse do not include the libraries that you add to the build path in .war files. There are three approaches to solving this problem:
In some cases it is helpful to have your Java project automatically built and deployed for you by Eclipse. For me, when working on a dynamic web or JavaEE project I’d much rather run it on the server through the IDE manually, as I tend to save often and I end up having to wait for a previous deployment to finish on a regular basis.
To disable the feature:
You will need to shutdown the server before you can save the change.
A couple of links with lists of the default set of Linux daemons installed on most systems. Helpful to know which ones that you need to disable when locking down a machine.