Oliver Chase

Greenhorn
+ Follow
since Feb 09, 2010
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
(keep public parts private until JForum day)
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt
Moderation Tools

Recent posts by Oliver Chase

Hi, I do not understand the practical usage of the @Produces annotation.

@Produces
@Random
int next() {
// a number between 1 and 100
return getRandom().nextInt(maxNumber - 1) + 1;
}

@Produces
@MaxNumber
int getMaxNumber() {
return maxNumber;
}



taken from:
http://www.jboss.org/jdf/quickstarts/jboss-as-quickstart/guide/NumberguessQuickstart/#_the_numberguess_quickstart_in_depth


What is being produced and how does the container know to call a Producer method? I would never have thought that I need a @produces just to return an int.

Thanks
Hi everyone,

I would like to learn Java EE 6. (second or third attempt)

For months, I have been messing around--looking at various online tutorials and so forth, anything I could get my hands on.

I've come to several conclusions as to why I can't seem to learn this (I have been able to learn about 3 other object-oriented languages)

1. There are so many moving parts. I hear this is better than before, but since this is a newbie forum--

2. Each part of the Spec has too many choices, resulting in not only paralysis by analysis. For every piece of the EE spec, there seem to be about 5 legitimate frameworks that I could use.

3. Each part of the Spec tends to depend on other parts--ie JSF using EJBs and in turn using JPA.

3. Tutorials are very hard to follow for a newbie b/c each tutorial uses its own combination of the multiple frameworks in place. For example, I wanted to learn some EJB, but in the course of the tutorial things are going fine until a tutorial will
say, we'll use Spring for an MVC framework or something like that. Or things will look good only to find out that they are using glassfish and not jboss, or vice versa. Then I realize that we need to use Apache CXF for my a job at work,
only to find that the tutorial uses Jersey. So I'm finding it pretty tough to find tutorials that will use the frameworks for my situation. Contrast this with .NET or other closed approaches, and the IDE is what you get. I sometimes debate with myself,
do I need to take a detour and learn JSF when I know we'll be using HTML and something like Jquery? B/c many tutorials keep referencing JSF and for me to follow along I feel like I need to learn it.

4. Maven--the beast. Honestly most of the other languages you just hit build and run, and I know all the hard stuff is happening under the covers, but Java appears to really want to let you know what every little thing is doing.
I do not know why, but many projects simply do not build...either a repo is down, or that version of a plugin is no longer compatible, or some what I'd term odd Eclipse errors, and a mvn clean will work although I am not sure why.
I've realized that if you don't take a detour and learn maven, tutorials aren't going to run.

5. Eclipse--just all kinds of JAVAHL errors and projects not refreshing or becoming out of sync....just not sure if my workflow is all wrong, but it gives me the impression that Eclipse is more finicky than other IDEs that I've used in the past.

6. I have found myself wondering, quite often, why the Java EE approach is better in that I know in other languages I would be able to implement the same project much faster. Do these other languages or more integrated ones such as Ruby
or .NET hide so much of the underlying complexity from you or are these more amateur approaches compared to the Java EE way?

All that whining aside, I do like the open source aspect, and there are just too many java-only projects that in my mind are 'must haves'. The community behind these must have projects are just too large and they've been developing them for 10 years,
so I'm certainly not going to find equivalents in other languages.

So moving forward, I'm wondering if:
1. There is a hidden gem of a book that uses eclipse since everywhere I've been it's the standard over netbeans it seems by a 10:1 factor (all figs approximate). I am not a fan of the command line roll your own 'javac 'helloworld.java' tutorials
since I'm skewed towards real world usage, and eclipse is the IDE that I'm going to be using.
2. Is there a book that sticks to jboss and their stack? I have tried for about 12 hours to build alot of the mastertheboss tutorials (maybe they are actually not affiliated), but unfortunately the tutorials already assume that you know what a @producer is and so forth, in their most basic one.
It seems like Jboss is the champion these days.
3. Should I just conquer and divide--that is, do nothing but learn JSF, forget about everything else...and then keep going to EJB....then JPA....then JAX-RS....then Soap Services....MDBs, ESBs, etc.
4. Any other suggestions as to how you guys became literate in Java EE? I assume that there must be a big payoff at the end for the investment (non monetary).

My problem is that I can not understand the Oracle official docs. Official docs tend to be too detailed or obscure for me.
In the past what has worked for me are things like a Deitel book or a Cay Horstman book, something that basically does not assume any prior knowledge and explains lines of code, and shows you the entire code rather than snippets which
at least for me make it difficult to follow along. Should I keep hunting for a book, or is it more of a try ten different tutorials, and each time I may pick up something new from each, and by the tenth one together I may have a complete enough
picture to start learning on my own?

Thank you!

fred rosenberger wrote:PATH is used by the OS to find executables to run.

CLASSPATH is used by the JVM to find class files to run.

So, the OS uses the PATH variable to find the java executable, which then in turn uses the CLASSPATH to find the class files to run.

Note that you don't actually have to set either one. They are both a convenience that allow you to type less.



Thank you...this is the clearest explanation that I have seen yet. Concise yet complete.
5 years ago
Hi,

Learning java and web services. Why is this language so hard to learn? I've picked up python and php so much quicker than Java, and I'm thinking about jumping ship unless forced to by a future employer to use Java.
To me it seems verbose, and has an insane number of moving parts. Maybe that explains why when learning, everything is a prerequisite of everything else, so unless you learn the whole thing, you can't really accomplish anything.
I've never been so completely lost before, and if I was an alien or stock forecaster picking 15 years ago which language would be popular, Java would be my last choice.
Even tools like Maven, which purport to make the configuration easier, are really bad because they don't work. You have an out of date or dead repository, and you're hosed. Because the build process is taken out of your hands, people can't even begin to debug things. And the documentation for projects, always always assumes that you know little things like "maven" or servlets, which are entire topics unto themselves. Java is extremely heavyweight and I don't really see the benefits at all. You have so many competing standards, and no one even knows what the difference between JPA and Hibernate are, nor Spring vs everything else. It's just a mixtape of things in which nothing makes any sense.
6 years ago
So for examples of the things that I don't understand and wish people would explain better are in this popular tutorial. I get lost on step 2:

http://www.mastertheboss.com/web-interfaces/273-resteasy-tutorial-.html

2) Older JBoss releases

If you have got any other JBoss AS release you have to perform a few basic steps for installing RESTEasy:

Step 1# Download Resteasy from the Repository
The first step is to download the latest Resteasy stable release from:
http://sourceforge.net/projects/resteasy/files/Resteasy%20JAX-RS/

Step 2# Add the following libraries to your Web application:



I have downloaded the stable resteasy. Then it says to add resteasy to your web application. Well, I'm not sure how to start a web application.

Step 3# Define listeners and bootstrap classes:


I do not know what a boostrap class is.

Some tutorials also use Maven. Well, I know what Maven is, I even have it installed, but I don't know how to incorporate it.

These are examples of the many moving parts that get me confused into just a simple service. I actually understand the service code; it's the "plumbing" and set up that I am finding too confusing now.

Thanks
6 years ago
Thanks for your advice. I saw the myeclipse tutorial, but I quit reading because myeclipse is not free, correct? I don't want to pay a yearly fee to use eclipse.
6 years ago
Hi,

I am a greenhorn. I can read, understand, and write java. But not enterprise java. I have been reading up on what an EJB is and JAX-B, JAX-RS, and annotations are. However, I can't seem to put everything together.

Is there a good tutorial that explains how to write a RESTful service aimed at newbies? Many of them leave out steps and say "do this" and assume prior knowledge. I simply can't follow them. To make matters worse, I need to use Eclipse and RestEasy (most tutorials use Netbeans and Jersey) Can someone recommend me the best course of action to take? Basically, I'd like something to hand hold me, give me training wheels, talk to me like I'm an idiot, and then let me spread my wings and fly. Right now I'm looking at tutorials spread out over the net, and I get bits and pieces, but it seems really inefficient. I just want one example in Eclipse that I can study so that I can see how all of the moving parts fit together.

Thanks!
6 years ago
Hi,
Thanks for your tips! I got it installed, and the reason that I was having some issues is b/c I downloaded the wrong thing and then had to read up a little on the JAVA_HOME environment variable and where the JAVA JDK is on macs.

Now for the truly hard part :>

I think that I will try Jboss in Action b/c although it's slower, I find that I need both parts: the entire picture + learning by doing. Some people just seem to be able to learn by doing alone, lucky them.
7 years ago
Hi,

I must say that I am mystified by jboss. I am obviously new, but I do want to ask if it is common for newbies to think that the Jboss documentation is hard to understand. Step 1 is to download the jboss AS, and on sourceforge, in green, it's got jboss osgi installer, which is what I downloaded.
I have come to realize that this, the highlighted option, is actually not what you want, but I'm not sure how I would have known that. I don't know what the osgi version is, and I don't know which of the many choices to download.

I'm on a mac, and I've got to use jboss 5.1

Thanks
7 years ago
Hi,

I'm very new. I may be asked to write web services, but of course I don't know anything about how to do it other than what I read on the w3schools tutorial.
Do I need to learn how to write a SOAP service from scratch, i.e., not using jax-ws or axis? Or is this the day and age where SOAP is now considered low-level, and these JAX-WS and Apache Axis products mask the SOAP from you. In other words, knowing the general structure of SOAP is good enough?

So in other words I think that I get what SOAP is and the 10,000 foot view,but when it comes time to build something, what do I use?

Thanks!
7 years ago
Hi guys,

I'm about to be offered a developer job. We will be using spring, hibernate, and jboss. The job description is for someone with 3 years' experience. It is in Boston and salary.com states that the avg java dev makes $91K? Also, there may be some web dev responsibilities as well, and salary.com states that the avg web dev salary is $71k.

Could you guys give me what a good number to accept would be?

Thanks!
7 years ago

Charles Mulloy wrote:Simply going "String answer;", is not enough. You never constructed 'answer'.

I think that's what is wrong. What are you trying to do?



Thank you Charles!

So maybe I just have a general question...

Are local variables declared inside a static method considered local and static? Could another static method access my local variable?

like

method2() is referring to the x that is used in method1(). But x is local. But x is also static implicitly (I think), which means that there is one copy of x per class? Does my confusion seem to arise from some rational thought?
8 years ago
Hi,

I'm a bit confused here. Basically, I have two static methods, reverse() and reverseWords(). I have declared a String answer inside reverse() and a String answer inside reverseWords().

Why does the second answer variable inside reverseWords() not get recognized? Is this second answer variable a static variable implicitly b/c it's inside a static method? Or is it a local variable whose scope is just inside the reverseWords() method? Is there two copies of the answer variable, one for each method, or just one for the entire class?

Thanks

8 years ago