robyne vaughn

Ranch Hand
+ Follow
since Jun 04, 2003
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 robyne vaughn

Hello,
I used Java in a class years ago.  I have not needed it in my endeavors since then.. amazing, I know.  Anyway, I find that I want to move into that arena and need a jumping off spot.  This idea of functional java programming appeals to me as potentially more reliable and easier to code, read, and maintain.  What is a good jumping off spot for a beginner?  This book plus what companion learning materials for learning java?  Is there a resource that has real, life-use examples?

Thanks so much for the help!
Hi Kathy,
Looking forward to using the book!
Thanks,
6 years ago
Hello,
I tried to look at the sample chapters, but the links push you to an opening page, and on a quick glance, I didn't see any sample chapters to download.
I am new to mobile and web app development. I'm still trying to determine the best tools to use and best practices. There are so many options. For the moment, my team has started with Eclipse. We're using some jquery mobile and trying to figure out phone gap. We have developed a couple of Android apps which use a restful web service and pull json data from our DB2/LUW database. We expect to build an Apache Tomcat web server after we reach a certain point. For now, we're serving from Eclipse/tomcat.

In our googling around about how to do what, we cross trails that point to Node.js, but since we have started down a path, we hate to add still one more thing to learn, especially since we're still in the "feeling our way through" stage.

Can you tell me what is Node.Js's primary purpose, what need it fills and why we should consider using it?

Then, is your book good for the novice?

Thanks,
In my server.xml, I have a JNDI realm which works for authenticating every user against Microsoft Active Directory.

The user requests a URL which I have set up as an alias in my web.xml for a servlet which authenticates the user against the active directory and then does a dispatcher.forward(request,response) to what is essentially an opening page for the user. (A menu of links to specific programs.)

I am trying to implement further authorization for certain programs for administrators.

If a person tries to open (I�m only testing 1 page at the moment) the protected page, before doing the dispatcher.forward(request,response), I rewrite the http header to be basic authentication in an effort to trick Tomcat into re-authenticating for this page.

response.setStatus(response.SC_UNAUTHORIZED); // Ie 401
response.setHeader("WWW-AUTHENTICATE","BASIC");
dispatcher.forward(request,response);

I have set up a context fragment similar to tomcat_home/webapps/application.xml trying to set up the additional basic authentication.

It wants to use the user database, and in fact, it does pop up the basic login window after the user has cleared the jndi authentication. However, after 3 attempts to login, it neither gives me a �bad password� message, nor a �successful� message, instead after the 3 attempts, it just allows the already authenticated user access whether or not they have been assigned the appropriate role in the tomcat-users.xml.

Any ideas why it doesn�t seem to be actually using the tomcat-users.xml?
It�s a miracle that it�s this close to working. I�m feeling my way through this, I�m not very experienced at Tomcat or Java or Jndi, I only touch on them occasionally. So, please answer in full, rich answers.

Thanks so much
16 years ago
I have a jndi realm set up in my tomcat 4.12 which is working and authenticates against microsoft's Active Directory Server. (not my choice, mandated)

Within that same context, I have a need to secure several programs to an administrator only and would rather not have to edit every one of them to programmatically check for the user who is trying to access them. In other words, some programs within the context will be available to everyone and some should only be available to the administrator.

Any clever ideas on how to go about this?

Here is my context from my server.xml:

<Context path="/mrcjava" docBase="/mrcjava" debug="0" reloadable="true" privileged="true">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="mrcjava_log" suffix=".txt" timestamp="true"/>
<!-- Robyne's code: JNDI to ActiveDirectoryServer Authentication: -->
<Realm className="org.apache.catalina.realm.JNDIRealm" debug="99"
connectionURL="ldap://99.999.9.9:389"
connectionName="CN=name,OU=CO,dc=name1,dc=name2"
connectionPassword="password"
referrals="follow"
userBase="dc=name1,dc=name2"
userSearch="(&(sAMAccountName={0})(objectClass=user))"
userSubtree="true"
roleSearch="(uniqueMember={0})"
rolename="cn"
/>
</Context>


I wish I could add within the context this additional memory realm:

<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
debug="0" resourceName="UserDatabase"/>

Which I did try. Interestingly, tomcat will run, but nothing will authenticate.


ps. here is the bottom of my web.xml where I tried to enable the above:
<security-constraint>
<web-resource-collection>
<web-resource-name>/mrcjava</web-resource-name>
<url-pattern>*.jsp</url-pattern>
<url-pattern>/LNGDIST/mrcmenu.html</url-pattern>
<url-pattern>/GetAttsMaint</url-pattern>
<url-pattern>/GetAttsRpt</url-pattern>
<url-pattern>/GetAttsOptions</url-pattern>
<url-pattern>/GetAttsOptionsNew</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>*</role-name>
</auth-constraint>
</security-constraint>


<security-constraint>
<web-resource-collection>
<web-resource-name>/mrcjava</web-resource-name>
<url-pattern>/GetAttsAdmin</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>NTSADMIN</role-name>
</auth-constraint>
</security-constraint>




<login-config>
<auth-method>FORM</auth-method>
<realm-name>ldapRealm</realm-name>
<form-login-config>
<form-login-page>/LNGDIST/login.jsp</form-login-page>
<form-error-page>/LNGDIST/login_error.jsp</form-error-page>
</form-login-config>
</login-config>

<security-role>
<role-name>LD</role-name>
</security-role>

<security-role>
<role-name>NTSADMIN</role-name>
</security-role>

</web-app>


newbie, would appreciate any creative ideas you have.
Thanks,
16 years ago
Thank you all for your responses.
I never meant to "fault" Peter for anything. My Ultimate question was about whether there were examples and help for errors. I should have specified "common" errors. It turns out that my problem with EXIT_ON_CLOSE will remain and is probably not common to those who are in a seasoned shop or who know something more about what they're doing.

I do not have access to J2S??.

That answers a question I had about what is the difference between Java and Java2.

I have access to JDK1.2 and JDK1.3. I choose to use JDK1.2 as it handles a certain JNDI problem for me better than the JDK1.3.


Anyway, if I in anyway implied fault, please forgive me. I was trying to ask an honest question and find out if this book is a good choice for someone so new to Java that they don't know what a JDK is.

I see that Peter's book serves a good purpose in keeping Java programmers up to date with the most current options.

Thanks,
17 years ago
Peter,
I was a cobol programmer in a former life and have been having some trouble teaching myself java. In fact, I'm working on a project where even my co-workers don't know any java and can't be used as resources. Therefore, I'm always looking for "THE" book which will clear up whatever it is that I'm not understanding. One of the things which really helps, is a good example. So, I went to http://afu.com/jj6/ and copied your clock example. I compiled it on my AS/400 and have a couple of small errors. It is hard for noobes to know where to start to fix problems - even small ones, when there are so many unknowns. Does your book help the real beginner to find answers to problems?

ps: I encountered 2 errors when I compiled your code:
Clock.java:51: class clock4 is public, should be declared in a file named clock4.java

and

Clock.java:26: cannot resolve symbol
symbol : variable EXIT_ON_CLOSE
location: interface javax.swing.WindowConstants
this.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);


I've done enough to know that I needed to re-name the program. That fixed that.
The other is less clear to me, I believe I have to find the javax.swing stuff and put it in my class path. I'll work on that. My classpath was set up long ago, and I'm not sure if I remember right, how to add to it on the IBM iSeries AS/400 I'm using. I'll research that.

Any way, sorry for the long discourse. Still, a good beginner book has good examples and good help for when those examples don't work. Does your book have those?
17 years ago
In case anyone else ever has this problem.

The only file I needed to copy was the catalina.jar I hated to use such an integral piece. However, just by using the catalina.jar from 4.1.17 and replacing the catalina.jar in 4.1.12, I am now able to authenticate to the Active Directory Server and handle my vendor supplied software also.
17 years ago
Great explanation of the synopsis of the book. At first, it seemed the book would be too advanced for me. Now, it has become appealing.
Thanks,
17 years ago
I've had this problem several times.

On our AS400, if I am re-configuring Tomcat and stopping and starting it much, there will come a time when it just won't start again.

We've re-IPL'd the machine at those times. (it is not used for production, only testing.) Still, it's very inconvenient.

Can someone tell me how to fix or avoid this problem?

It won't even start with a backup copy of itself which I know was working.

Thanks,
17 years ago
I need to accomplish JNDIrealm authentication in tomcat 4.1.12. It has to be 4.1.12 for vendor supplied software reasons. I have a working JNDIrealm in 4.1.17. But I can't get 4.1.12 to work. I've even begun to steal .jar files from 4.1.17 and copy them into 4.1.12.

If I copy the entire contents of 4.1.17/server/lib and 4.1.17/common/lib down to my 4.1.12, my authentication works, but my vendor supplied software doesn't.

I originally only copied the 4.1.17/common/lib/jndi.jar & naming-factory.jar. That wasn't enough. So I also copied the 4.1.17/tomcat-util.jar, tomcat-jk2.jar, tomcat-jk.jar and jaas.jar out of desperation. That didn't work either.(I mean: won't authenticate)

I have not tried copying only the entire server/lib or the entire common/lib. I guess I'll do that while I'm waiting to see if anyone knows what the secret is.

I'm using jdk1.2.
The error I get is javax.naming.PartialResultException: Unprocessed Continuation References.....

I think I've seen this problem mentioned in some forum before as one which is caused by a bug in the way 4.1.12 throws this exception when it shouldn't. However, I can't find that reference again.

I don't get that error in my 4.1.17 implementation, and I copied that to the 4.1.12. (I hope I didn't forget to copy something!)

Any help would be appreciated.

Oh yea. My 4.1.17 was configured as stand-alone. The 4.1.12 uses an apache front end. However, when I test the authentication, I force the port-number in my URL I bypass Apache and go straight to tomcat. It is a form-based authentication and the form does open correctly.

Thanks,
17 years ago
Thanks. Since posting, I have figured that out. I appreciate your helpfulness.
Robyne
Carlisia,
You will need to put a context for your directory in your server.xml

something similar to:

<Context path="/mydirectory" docBase="/mydirectory" debug="0"
reloadable="true" privileged="true">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="mydirectory_log" suffix=".txt"
timestamp="true"/>
</Context>

apply it at the host level.

If you use apache front end you'll need to add some stuff in the httpd.conf file also.

hope this helps.
Robyne
17 years ago
John,
Finding help for Active Directory is hard. I don't know much, but I know that Active Directory will not allow an anonymous connection. You must set up a user to connect with.

hope this helps,
Robyne
17 years ago