Package org.jboss.netty.channel.socket.nio does not exist - java

Which JAR contains org.jboss.netty.channel.socket.nio?
I'm not using Maven or Ivy, just Ant.
Ant compile gives:
-do-compile:
[javac] Compiling 4 source files to /home/thufir/NetBeansProjects/EchoClient/build/classes
[javac] /home/thufir/NetBeansProjects/EchoClient/src/net/bounceme/dur/netty/client/ObjectEchoClient.java:3: error: package org.jboss.netty.channel.socket.nio does not exist
[javac] import org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory;
In the classpath is:
thufir#dur:~/NetBeansProjects/EchoClient/nbproject$
thufir#dur:~/NetBeansProjects/EchoClient/nbproject$ head -n 58 project.properties | tail -n 29
endorsed.classpath=
excludes=
file.reference.netty-all-4.0.21.Final-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/all-in-one/netty-all-4.0.21.Final-sources.jar
file.reference.netty-all-4.0.21.Final.jar=/home/thufir/jars/netty-4.0.21.Final/jar/all-in-one/netty-all-4.0.21.Final.jar
file.reference.netty-buffer-4.0.21.Final-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-buffer-4.0.21.Final-sources.jar
file.reference.netty-buffer-4.0.21.Final.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-buffer-4.0.21.Final.jar
file.reference.netty-codec-4.0.21.Final-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-codec-4.0.21.Final-sources.jar
file.reference.netty-codec-4.0.21.Final.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-codec-4.0.21.Final.jar
file.reference.netty-codec-http-4.0.21.Final-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-codec-http-4.0.21.Final-sources.jar
file.reference.netty-codec-http-4.0.21.Final.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-codec-http-4.0.21.Final.jar
file.reference.netty-codec-socks-4.0.21.Final-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-codec-socks-4.0.21.Final-sources.jar
file.reference.netty-codec-socks-4.0.21.Final.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-codec-socks-4.0.21.Final.jar
file.reference.netty-common-4.0.21.Final-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-common-4.0.21.Final-sources.jar
file.reference.netty-common-4.0.21.Final.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-common-4.0.21.Final.jar
file.reference.netty-example-4.0.21.Final-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-example-4.0.21.Final-sources.jar
file.reference.netty-example-4.0.21.Final.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-example-4.0.21.Final.jar
file.reference.netty-handler-4.0.21.Final-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-handler-4.0.21.Final-sources.jar
file.reference.netty-handler-4.0.21.Final.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-handler-4.0.21.Final.jar
file.reference.netty-tcnative-1.1.30.Fork2-linux-x86_64.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-tcnative-1.1.30.Fork2-linux-x86_64.jar
file.reference.netty-tcnative-1.1.30.Fork2-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-tcnative-1.1.30.Fork2-sources.jar
file.reference.netty-transport-4.0.21.Final-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-transport-4.0.21.Final-sources.jar
file.reference.netty-transport-4.0.21.Final.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-transport-4.0.21.Final.jar
file.reference.netty-transport-rxtx-4.0.21.Final-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-transport-rxtx-4.0.21.Final-sources.jar
file.reference.netty-transport-rxtx-4.0.21.Final.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-transport-rxtx-4.0.21.Final.jar
file.reference.netty-transport-sctp-4.0.21.Final-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-transport-sctp-4.0.21.Final-sources.jar
file.reference.netty-transport-sctp-4.0.21.Final.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-transport-sctp-4.0.21.Final.jar
file.reference.netty-transport-udt-4.0.21.Final-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-transport-udt-4.0.21.Final-sources.jar
file.reference.netty-transport-udt-4.0.21.Final.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-transport-udt-4.0.21.Final.jar
includes=**
thufir#dur:~/NetBeansProjects/EchoClient/nbproject$
The library is netty-4.0.21.Final.tar.bz2, which was downloaded from the official Netty website.
I added each JAR from that download to the project. Yes, I realize it's not using the CLI javac classpath, but the JAR's are visible in the project, as well as in the output above.
I looked through some of the JAR's and was unable to find this specific class.

You seem to be trying to build an application developed against Netty 3.x using Netty 4.0.
There have been API changes, including channel creation and bootstrap. Also, the package prefix changed from org.jboss.netty to io.netty reflecting the project status change.
Use the API documentation (which no longer documents NioClientSocketChannelFactory) corresponding to the release you're using and checkout the provided examples (netty-example-4.0.21.Final-sources.jar) to help port any code you have that's built against Netty 3.x.

Related

Cannot get xmlread with IO Octave package to work even with proper .jar files

I am trying to get the Octave 5.1.0 + IO package xmlread() function to work. I have installed the IO package as well as the 2.12.0 version of Apache Xerces java libraries. Octave Forge claims that all you need to do is to load the IO package during runtime (pkg load IO) and include javaaddpath entries for two .jar files:
javaaddpath('pathToFile/xercesImpl.jar');
javaaddpath('pathToFile/xml-apis.jar');
I have done this, but I still get the following error:
error: xmlread: no xercesImpl.jar and/or xml-apis.jar > v2.11.0 in javaclasspath
error: called from
xmlread at line 72 column 7
I made sure to addpath the Xerces libary, but I get the same error no matter what. When I invoke the xmlread without a file (xmlread()), it seems to confirm the existence of the .jar files:
xerces:
- xercesImpl.jar OK
- xml-apis.jar OK
xerces version 2.9.1
The 2.9.1 might be the culprit (>2.11.0 needed?), but why does this get used when I point to more current versions? Any help is appreciated. Thanks!

JMeter 3.2 source not compiling

I try to work with JMeter 3.2 source but it's not compiling, It was missing mainly Bouncy Castle jars I added jars but still getting an error:
SMIMEAssertion.java include constructor SMIMESignedParser(BcDigestCalculatorProvider, MimeMultipart) which doesn't exists in JMeter's lib, Code failing:
s = new SMIMESignedParser(new BcDigestCalculatorProvider(), multipart);
s = new SMIMESignedParser(new BcDigestCalculatorProvider(), msg);
I added different jars of Bouncy Castle as latest bcprov-jdk15on-158.jar to older versions bcmail-jdk14-1.46.jar or others as bcpkix-jdk15on-1.55 or bcmail-jdk15-140.jar but still failed to compile
Does anyone knows the correct jars to add?
JMeter uses "ant" to build.
Based on https://github.com/apache/jmeter it looks like they use Travis to build and test (probably on Github).
Based on
before_script:
- test "x$RUN_CHECKSTYLE" != 'x' || ant -Djava.awt.headless=true download_jars install
(https://github.com/apache/jmeter/blob/trunk/.travis.yml)
it appears that you should run
ant download_jars
to get the jars you need. Locate them and add them to your build path.
(And this stuff is exactly why projects are typically migrating to Maven)
Edited in by other user after I wrote it:
Full explanation for building is here:
http://jmeter.apache.org/building.html
A PR of migration to maven is available and should be merged after 3.3 release.

How come I can't import org.apache.commons.lang.StringUtils?

I added the common lang jar file in the classpath, but when I compile it says:
error: package org.apache.commons.lang does not exist
I tried to follow the steps described below:
http://oopbook.com/java-classpath-2/classpath-in-jcreator/
but I don't it doesn't work. Is it the editor that's not working properly or is it something else?
Between major versions 2 and 3 apache changed the package naming scheme on their classes from lang to lang3.
Notice on the download site that for version 2.6 you are downloading "commons-lang-2.6" and for version 3.3.2 you are downloading "commons-lang3-3.3.2".
Also, if you check out the current API doc you'll see the new naming structure.
All you need to do is update your import statement to match the new package structure and your compiler will be able resolve it correctly.

Debugging java file compiling (using gwt)

I was asked in a precedent question to be more precise about my compilation error message. Here's the fact : I know nothing about GWT and Java. Following the docs, I tried to compile Java files from a web project that had been precedently developed using GWT. So, to test and understand how all this work, I took the java folder (that had been precedently compiled with an appropriate tool)
into src folder of a web app project in my ide Eclipse
When running the compiler using the command GWT Compile, I had this message error :
Compiling module java.org.primagora
Validating newly compiled units
Ignored 5 units with compilation errors in first pass.
Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.
Finding entry point classes
[ERROR] Unable to find type 'org.client.primagoraEntryPoint'
[ERROR] Hint: Check that the type name 'org.client.primagoraEntryPoint' is really what you meant
[ERROR] Hint: Check that your classpath includes all required source roots
When I look at the error on the file, for example java.org.client.primagoraEntryPoint, I find an error when it is declared "package org.client" at the very beginning of the file. There seem to be an error path. I thought the java folder I took would be correctly implemented in Eclipse.
Is that clearly a file path problem ? How should I debugg it ? (I reallly know nothing about gwt, java , eclipse)
Best,
Newben
Where is your GWT module file (i.e. a file that ends in .gwt.xml), and what are its contents? The package you list for your entrypoint is org.client, and the full name is org.client.primagoraEntryPoint, suggesting that there is a file in org/client/primagoraEntryPoint.java. By default, module files include the client package relative to them as source, so if the file is in the wrong location, this won't work correctly.
Based on this, your module file should be in the org package:
src/
org/
SampleModule.gwt.xml
client/
primagoraEntryPoint.java
From the very beginning of your error, you list java.org.primagora as the module:
Compiling module java.org.primagora
This suggests the following structure:
src/
org/
client/
primagoraEntryPoint.java
java/
org/
primagora.gwt.xml
This doesn't make sense, since GWT is now looking for a java.org.client package instead of a org.client package. Try using the package setup mentioned earlier here.
A better option might be to pick an existing working project, like what the GWT plugin for Eclipse will create, or one of the samples in the GWT download.

Groovy, Netbeans and Java EE

I want to develop a web application (no frameworks) mixing java with groovy. I am using the IDE Netbeans with the plugin.
If I start a new Java SE project and add a groovy class, it works with no problems.. but when I create a new java EE project and add a groovy class it can't compile and shows me the following error:
/home/webcodei/NetBeansProjects/testeGroovyWeb/src/java/pacote/Hello.java:23: cannot find symbol
symbol : class Hroovy
location: class pacote.Hello
Hroovy h = new Hroovy();
/home/webcodei/NetBeansProjects/testeGroovyWeb/src/java/pacote/Hello.java:23: cannot find symbol
symbol : class Hroovy
location: class pacote.Hello
Hroovy h = new Hroovy();
2 errors
/home/webcodei/NetBeansProjects/testeGroovyWeb/nbproject/build-impl.xml:383: The following error occurred while executing this line:
/home/webcodei/NetBeansProjects/testeGroovyWeb/nbproject/build-impl.xml:211: Compile failed; see the compiler error output for details.
FALHA NA CONSTRUÇÃO (tempo total: 0 segundos)
Does anybody have a clue of how do I enable Java EE + Groovy in netbeans?
ps: I know the existence of Grails
ps2: The Groovy jar is in my classpath.
Thank you for all!
It appears that the NetBeans 6.5 Java Webapp project manager does not have the "Enable Groovy" support that is present in the Java App and Java Class library projects.
I can think of two ways you might get around this:
First, you could put your Groovy code and tests in a separate project as a Java Class Library. Then make the Java webapp dependent on the Groovy project. NetBeans will build the dependent project automatically so you'll hardly notice they are in separate projects.
Second, the "Enable Groovy" isn't magic. All it does is write a groovy-build.xml in /nbprojects and modify build-impl.xml to import it. The groovy-build.xml overrides the default "javac" macro to invoke "groovyc" instead. If you're at all handy with Ant, you could copy a groovy-build.xml from a Java Application project and copy it to your Java Web project and then import it from your build.xml (before build-impl.xml is imported). The groovy-build.xml would likely need a few tweaks as some of the properties between a webapp and class library are a little different.
#Dave Smith,
This was exactly what I did. I created one javase project and one webapp and started to compare them. After a few minutes I realised that the only diference was the groovy-build.xml.
So I copied the groovy-build.xml into the dir, and inserted the following lines into my build.xml:
<import file="nbproject/groovy-build.xml"/>
Right before the regular
<import file="nbproject/build-impl.xml"/>
And then called the groovy file to overwrite the -init-macrodef-javac.
<target depends="-groovy-init-macrodef-javac" name="-pre-compile">
</target>
I also needed to change the namespace from the groovy-build.xml to mine ex:
<macrodef name="javac" uri="http://www.netbeans.org/ns/web-project/2">
And inserted the j2ee classpath (${j2ee.platform.classpath}) to the attribute a few lines later:
<attribute default="${javac.classpath}:${j2ee.platform.classpath}" name="classpath"/>
After that the project worked successfully! =D
Thank you for all!

Categories

Resources