Help coderanch get a
new server
by contributing to the fundraiser

Duc Quoc

Greenhorn
+ Follow
since Dec 15, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Duc Quoc

I also met those errors with Jersey & JBoss7. I have solved by following the answers in JBoss forum:

https://community.jboss.org/message/626705#626705
https://community.jboss.org/message/808749#808749

Hope this helps,
11 years ago
I'm not so sure about the article's implicit meanings (as English isn't my mother tongue), but this is what I got from the article:

+ Lots of Java developers tend to over-engineer the code, in this particular case they don't simply write a method (member function) or functional method (static one) to do the operation. Rather, they begin to "generalize" and "add abstractions" to the method call, apply "design patterns" like Command, Adapter, Factory, ... and may go overboard. That eventually results in lots of classes, which call each other in the chain and finally do the task (hopefully no bug occurs). Those classes cause a "kingdom of Nouns" , which may have a few merits but some other drawbacks that grow into trouble the long run.


--Duc
12 years ago

Emilia con wrote:If I get a process object in Java through Runtime.getRuntime().exec(...), or ProcessBuilder.start(), I can wait for it through Process.waitFor(), which is like Thread.join(), or I could kill it with Process.destroy(), which is like the deprecated Thread.stop(). BUT: How do I find the pid of the Process Object? I don't see a method for doing that in The Official Documentation. Can I do this in Java? If so, how?


Did you try the above suggestions?

I would try to invoke the "jps" (assumed Sun's JDK) with the Runtime.exec(...) , if I were you

--Duc
12 years ago

Sam Saha wrote:I have a log file which contains a big text lines. I wanted to keep the important lines and remove the unwanted lines from the big text file.
... ... ...
I wanted the output to be like this:


From the shell prompt (console), you can use simple grep command like this: (assumed the log file is "server.log" )



It will filter out all the lines with "at " strings, hence results to your expected text.

To write the output text to a new logfile (says, it's "newfile.log"), simply add like following:


We can also achieve the expected result with sed, awk, perl, vim, ... but I think grep is simple enough :-)
12 years ago