Translate

Tuesday, October 6, 2015

Java - Secure LDAP - simple bind failed: internews.local:636 Error

This took me a while to fix because I had to get the right certificates to install in the Java certificate store on the new server. I finally found the "cer" files on one of the domain controllers, copied the files to the new server, and then used the Java keytool utility to import the certificates into the Java certificate store.
Some tips:
Use "keytool.exe" located the the Java bin folder to import the certificates.
Import the certificates into the "cacerts" file located in the security folder under "jre\lib\security".

Monday, October 5, 2015

Tomcat - CertificateFile must be defined when using SSL with APR error

Setting Tomcat to use SSL and I was getting the "Connector attribute SSLCertificateFile must be defined when using SSL with APR" error. Had to disable APR in server.xml as follows:


  <!--
  <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
  -->

Tomcat - Cannot Start Tomcat Service

I'm setting up a new server with Java Server 1.8 and Tomcat 8. Went to install Tomcat as a service on a Windows Server 2008 box and the install finished with an error but the Tomcat Service was there as a Windows Service. When I tried to start the service I would get an error message. The event log showed an error with Event ID 7024. The Tomcat commons-daemon log showed "[2015-10-04 07:18:16] [error] [12756] Failed creating java". What I needed to do is tell Tomcat the location of the "jvm.dll" file. I ran the tomcat8w utility located in the Tomcat bin folder and set the location on the Java tab:

Wednesday, September 16, 2015

SharePoint 2013 - Cannot Delete or Save Documents

Working on the new SharePoint 2013 and we were running into different issues. Could not save or delete documents and we received the following "Unexpected response from server. The status code..." error when replying on a list/discussion.
Looked like a permissions or authentication problem to me. Doing a trace after a save or delete I saw that it was cycling between the HTTP request and redirect to login. Changing the authentication settings on the site in IIS fixed the problems.

SharePoint - Set Trusted Root Certificate

The SharePoint sight was not displaying, there was just a blank page and no errors. I looked at the log using the ULS Viewer and found an error message "An operation failed because the following certificate has validation errors...". To fix the problem I had to add my SSL certificate as a Trusted Certificate using the Certificate Manager Snap-in in the MMC. This site has a simple explanation on how to do it.

Monday, September 14, 2015

SharePoint - Map Missing AD Attribute to User Profile Property

There are a few Active Directory Attributes that are not listed on the "Add User Profile Property" page. To add a missing attribute you have to first add a user profile property that uses any attribute from the attribute list and then modify the entry using the SharePoint Management Shell. You need to run the Management Shell with a user account that will have right permissions or you will run into errors.
The following is an example of the script:

# Richrd Golebiowski
# January 12, 2012
# Run in Sharepoint Managemnt Shell as SP_Farm
$url = "http://myssp:1000" #URL of your Central Admin site.
$spsProperty = "PostOfficeBox” #Internal name of the SharePoint user profile property
$fimProperty = "postOfficeBox” #Name of the attribute in FIM/LDAP source
$connectionName = “Ad Primary Connection” #Name of the SharePoint synchronization connection

$site = Get-SPSite $url

if ($site)
{Write-Host “Successfully obtained site reference!”}
else
{Write-Host “Failed to obtain site reference”}

$serviceContext = Get-SPServiceContext($site)

if ($serviceContext)
{Write-Host “Successfully obtained service context!”}
else
{Write-Host “Failed to obtain service context”}
$upManager = new-object Microsoft.Office.Server.UserProfiles.UserProfileConfigManager($serviceContext)

if ($upManager)
{Write-Host “Successfully obtained user profile manager!”}
else
{Write-Host “Failed to obtain user profile manager”}
$synchConnection = $upManager.ConnectionManager[$connectionName]

if ($synchConnection)
{Write-Host “Successfully obtained synchronization connection!”}
else
{Write-Host “Failed to obtain user synchronization connection!”}

Write-Host “Adding the attribute mapping…”
$synchConnection.PropertyMapping.AddNewMapping([Microsoft.Office.Server.UserProfiles.ProfileType]::User, $spsProperty, $fimProperty)
Write-Host “Done!”

I tried running the script with my personal admin account instead of the farm account and ran into a lot of errors. The most interesting was executing "new-object Microsoft.Office.Server.UserProfiles.UserProfileConfigManager($serviceContext)" would set "$upManager" and then show "Successfully obtained user profile manager!" but the ConnectionManager would be empty and I would get a "Cannot index into a null array." error when executing "$synchConnection = $upManager.ConnectionManager[$connectionName]"

Wednesday, September 9, 2015

Spring - Using @Async to execute methods asynchronously

I have a long running database update that was added to a web application. Didn't seem right to have a method running for so long with the final result being a "Success!" message on the web page and no feedback to the client in the meantime so I made the method run asynchronously using Spring @EnableAsync and @Async. You can get my Eclipse test web application at Git Project.