Preston Thornton

Ranch Hand
+ Follow
since Jun 24, 2008
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
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Preston Thornton

In this very rapid pace environment of software development where you must quick spin up (How much time can I afford to devout v.s time to productivity?) on the next greatest thing, particularly in mobile application development, what factors should sway me to learn and utilize Kotlin verses GO Lang for Android mobile development?
2 years ago
Good morning everyone,

I am exploring the use of JSP coding with command utilities and have found some quick success. I am, however, having issues with formatting out with from the following code sample:



This output is misaligned and looks like this:


Hello World of Java

Volume in drive C has no label. Volume Serial Number is 749D-D60E Directory of C:\Users\Preston 3rd\Desktop\eclipse-jee-mars-R-win32\eclipse 01/08/2016 03:50 AM . 01/08/2016 03:50 AM .. 06/03/2015 07:07 PM 60 .eclipseproduct 06/09/2015 06:42 AM 1,434 about.html 08/02/2015 07:55 AM 1,160,346 artifacts.xml 01/08/2016 03:50 AM configuration 07/12/2015 10:29 AM dropins 06/21/2015 12:08 PM 326,640 eclipse.exe 08/02/2015 07:56 AM 477 eclipse.ini 06/21/2015 12:08 PM 31,728 eclipsec.exe 02/20/2015 04:35 AM 12,637 epl-v10.html 08/02/2015 07:55 AM features 05/11/2015 02:55 PM 6,297 notice.html 01/08/2016 03:49 AM p2 08/02/2015 07:55 AM plugins 07/12/2015 10:30 AM readme 8 File(s) 1,539,619 bytes 8 Dir(s) 381,339,762,688 bytes free Done





I have tried trim() and replaceall() but without success. Any help would be very appreciated.
5 years ago
JSP
I resolved my problem by returning the use of simple shell commands. So, within the script I just used `<shell commands> ` to get what I needed. Keep it simple I guess.

Thanks.
9 years ago
Thanks! I will make the adjustment and give it a try.

L Thornton
9 years ago
Hi, everyone,

I am working to sew together a two java programs, and I need to have them execute at the command (DOS prompt, for example) so that I can integrate it into HP Openview Operations as a Monitor program. I was able to test and run the program in Eclipse fine, and not at the command prompt. Here is the code and class files.



Class Files:
03/11/2012 11:30 AM 1,493 RuntimeExec$StreamWrapper.class
03/11/2012 11:30 AM 2,124 RuntimeExec.class

Windows CMD prompt:





I know its something I am over looking.
Thanks for your help in advance.

L Thornton
9 years ago
Hi, Perl Gang!

I was wondering if any has a simple example of using the File::Tasks::Edit Perl Module. I am working a script to edit a script in place using the (-i) option, but I wanted to see if there was other way to do so. I am coding a search algorithm to search the file to find confirm the desired string. In reviewing the CPAN information

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CPAN - File::Tasks::Edit - Search

Where this is what is available:



Sorry Adam, but I need something more in the line of an example to utilize your module. Anyone have one you are will to share.
9 years ago
I am quickly reading through Joss In Action, and I see something on page 30 that might encourage you to move forward in your efforts:


. . .This new microcontainer architecture has serval benefits over the old JMX kernel architecture. First, it's much lighter because it doesn't have to support JMX, allowing you to build even smaller minimal configurations. SECOND, services built on top of the microcontainer can be deployer standalone, within another application server such as BEA's WebLogic Server (Thinking the reverse is also true), or even within a web server such as Tomcat.



So, I am thinking that you can harvest the servlets, JSP, and deployment descriptor and migrate fairly easily, but again, I am new to the field.
10 years ago
Hey! Peter!

Thank you!

As you can see, I have been running across sites looking for the solution to the problem(s). And yes, you are correct. I did see my mistake from the other site. Tell the editer at Manning that the image in the book is way too small for old people like me. (That's my excuse and I'm sticking to it!)

I did sign up at the book site and did note the update and errata information. I have to fly through this book fast! I hope to be done by the end of next week. I will try to find the bread crumb trail at the various site first. Thanks again for this great post.



Preston@Large
Detroit
10 years ago
Okay, when in doubt . . . check the author's site and use the source code provided. Go figure.

HelloWorldServlet.java


Web.xml






Preston@Large
Detroit
10 years ago
Okay, I found the problem the last issue.




Peter Johnson (Author)
webpage


1. Jan 7, 2010 11:09 AM (in response to marco scagliola)
Correct AnswerRe: WARNING [config] unable to process deployment descriptor for context /xxx
I am not sure that I follow your file hierachy diagram, but it looks as if you have the web.xml located at WEB-IFN/classes/web.xml - it should be at WEB-INF/web.xml.

P.S. - it would have been better if you ran "jar -tf Helloapp.war" (assuming you hvae a WAR file, and not an exploded diectory) and posted the response.



Now looking at the web site: http://localhost:8080/helloapp/sayhello



HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Error instantiating servlet class com.manning.jbia.HelloWorldServlet
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
java.lang.Thread.run(Thread.java:619)
root cause

java.lang.ClassNotFoundException: com.manning.jbia.HelloWorldServlet
java.net.URLClassLoader$1.run(URLClassLoader.java:200)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(URLClassLoader.java:188)
java.lang.ClassLoader.loadClass(ClassLoader.java:307)
java.lang.ClassLoader.loadClass(ClassLoader.java:252)
org.jboss.web.tomcat.service.TomcatInjectionContainer.newInstance(TomcatInjectionContainer.java:262)
org.jboss.web.tomcat.service.TomcatInjectionContainer.newInstance(TomcatInjectionContainer.java:256)
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
java.lang.Thread.run(Thread.java:619)
note The full stack trace of the root cause is available in the JBoss Web/2.1.3.GA logs.



Now this is interesting . . .

javax.servlet.ServletException: Error instantiating servlet class com.manning.jbia.HelloWorldServlet

Looking back at the javac command:



Wow! The last directory "intro," is being cut off - Error instantiating servlet class com.manning.jbia.<<?? intro ??>>HelloWorldServlet

Okay, that is a problem.



10 years ago
I am taking a guess, but review carefully your import starting at the beginning of your program. Second, confirm that you can actually locate what it's complaining about.

Preston @ Large
10 years ago
Okay, one problem down, one to go . . . I hope. I am now see the following error:





Here, I have just copy or exploded directory to the server/default/deploy directory



Here is the site page:



I did restart the AS to confirm the issue. So . . . any thoughts would help.

Thanks.
10 years ago
<< WINDOWS XP or 7 USERS . . . >>

Oh, I got it! I just needed some lunch and some music (Aaliyah - Are You The Somebody). I was missing comma in the java file (throws ServletException, IOException{ ):



The class file is now created. The deployment descriptor is as follows



To recap the source of trouble was that the "servlet-api.jar" was not found in the JBOSS server/default directory. I had to copy it from the the java jre directory. What I forgot to do will restart the AS for only the deploy directory is dynamics and detect changes as files are placed in that directory.

The final results . . .

C:\JBoss5>javac -classpath C:\JBoss5\server\default\lib\servlet-api.jar -d C:\JBoss5\helloWorldBuild\helloapp.war\WEB-INF\classes <<It's a space here>> C:\JBoss5\helloWorldBuild\src\com\manning\jbia\intro\*

Remember: javac (options) (Source Files)

So just remember, throw on some 50 Cent "In Da Club," and rock your head back and forward . . . you'll get it.


Preston @ Large
Detroit
10 years ago
Hi, all

I searched the archives for a solution to my problem to no success. I am trying to deploy the HelloWorld application used in the JBoss In Action book, but I am encountering a few issues has seen here.

Using Windows XP I had to modify the example with back spaces


hmm . . . help! please!

Preston.
10 years ago
Are you kidding? Heck yeah! I am trying to learn J2EE but I keep looking at this 1000+ page tutorial and loose heart. I think they are paying more for Flex developers than J2EE, but you need the J2EE in order to utilize the BlazeDS for remote object access.


Here is learn flex in a week:
http://www.adobe.com/devnet/flex/videotraining.html

Preston Thornton
Flex Hype Man . . .
10 years ago