CMIS connection issue - alfresco

cannot tell if this issue is the same as some others posted. ours simply throws a msg, but it appears CMIS connection related - our application uses CMIS/Alfresco. i am not very familiar, but we have a server related to it. not sure if a power outage is related to the fact that we this error[pwr outage yesterday, then mysteriously this error was later noticed]. we normally post information on the web page that is populated by our sql data[a table field populates a textarea/text editor] - instead we get the error above: "CMIS connection issue". that verbiage comes from a file that instantiates connection with CMIS, here is the related code:
//Check cmis service connect or not
try{
$client = new CMISService($repo_url, $repo_username, $repo_password);
}catch (Exception $ec) {
echo "CMIS connection issue";
echo "<br >\n" ;
echo $ec->getMessage() ;
die;
}
the CMISService parms have not changed, and they appear to be proper values. i even tried "admin", and "root" as "repo_username" in addition to the defined username.
Ideas on what we can check?

Related

PHPMailer SMTP connection timeout

I've recently moved a Wordpress site from one server to another and I can no longer send mail via SMTP.
There is clearly somesort of network/resolver/credentials problem and I'm trying to debug it, but I've encountered some really unusual behaviour.
I'm looking at the connect method of the SMTP class. If I just try the code as it stands, then the line
$this->smtp_conn = #stream_socket_client(
$host . ":" . $port,
$errno,
$errstr,
$timeout,
STREAM_CLIENT_CONNECT,
$socket_context
);
causes a timeout. However if I add my own member variable eg protected $myvariable; and change the above code to assign the stream socket to $myvariable rather than smtp_conn, there is no time out.
If I check the unaltered code using var_dump on $this->smtp_conn just before trying to open the connection, it is NULL.
I've can't see any other code in PHPMailer which would effect the member variable $smtp_conn and I can't see how changing the name of a variable could stop the timeout.
Can anyone help me to debug this further.
================= EDIT =====================
I've discovered the assignment of $this->smtp_conn to the result of stream_socket_client causes the get_lines method to execute directly. That is, if I place an exit command directly after the assignment of $this->smtp_conn = stream_socket_client, the code in get_lines still runs.

i have a error 401 with microsoft emotion api in java

im using the example code to call the emotions api but i have an error 401 and i cannot identify the error
the result: { "error": { "code": "Unauthorized", "message": "Access denied due to invalid subscription key. Make sure you are subscribed to an API you are trying to call and provide the right key." } }
HttpClient cliente = HttpClients.createDefault();
String key ="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
try{
URIBuilder builder= new URIBuilder("https://api.projectoxford.ai/emotion/v1.0/recognize");
URI uri = builder.build();
HttpPost request = new HttpPost(uri);
request.setHeader("Content-type","application/json");
request.setHeader("Opc-Apim-Subscription-Key",key);
StringEntity reqEntity = new StringEntity("\"url\": \"http://am-elsalv-cdn.agilecontents.com/resources/jpg/5/3/1458595472835.jpg\"");
request.setEntity(reqEntity);
HttpResponse response = cliente.execute(request);
HttpEntity entity = response.getEntity();
if(entity!=null){
System.out.println(EntityUtils.toString(entity));
}
}catch(Exception e){
System.out.println(e.getMessage());
}
The 401 error is typically shown when you’re using an invalid subscription key to call our APIs. This could happen for a number of reasons:
Incorrect key as result of a copy/Paste error when pulling the key from http://www.microsoft.com/cognitive-services/en-us/subscriptions. Additionally, make sure there are no leading or trailing spaces in your key (it doesn’t look like it from your code, but calling out for completeness).
If your key was working before and now is no longer working, you could be out of your monthly quota (number of calls) or trying to make calls too quickly for the TPS (transactions per second) supported for your key. You can check the status of your key by going to the subscriptions page, finding the emotion subscription, and clicking “Show quota”.
There is a service interruption currently on-going. If you think this is the case, please let us know through tickets#cognitive.uservoice.com.
If you’ve tried all of these things and are still experiencing issues, try to make an API call using your subscription key through our testing console. If this still fails, regenerate your key through the subscriptions page by finding the Emotion API, identify the key column, and clicking “Regenerate” under the key that is not working. Note that you’ll have to update all references to your old key as this will completely invalidate it in favor of the newly generated key.

Regarding AmazonClientException

I have to implement some error handling logic for DynamoDb errors. As said by AWS documentation, the errors are divided into client and server errors.
May be I am missing something in the object browser, but I don't understand how I will retrieve the "HttpStatusCode StatusCode" for the client errors (AmazonClientException) ?
This is just part of the server errors (AmazonServiceException) only.
As, I need to do some logging based on the error code, it seems that it can not be obtained from client exceptions currently.
There is no status code for a AmazonClientException which is not also an AmazonServiceException. If you have one from the service, it will be of the second type and you can get the status code. If you have one of the first type, it could be because you don't have an internet connection, or the service responded with a malformed response (perhaps not even HTTP, who knows!).
It's a little confusing that they decided to extend AmazonClientException with AmazonServiceException, because it means that (in java) you might have to do something like this:
try {
// ... make some dynamo requests ...
} catch (AmazonServiceException e) {
// aha, I can get at the status code!
} catch (AmazonClientException e) {
// OK, something really bizarre happened... perhaps dynamo is
// down, or I'm having internet issues.
}

Novell eDirectory with .NET DirectoryServices

In our company, we have a project which should use Novell eDirectory with .net applications.
I have tried Novell Api (http://www.novell.com/coolsolutions/feature/11204.html) to connect between .NET applications. It is working fine.
But, as per requirement, we specifically need .net API to connect not with Novell Api, which is not working. Connection and binding with .NET Api DirectoryServices not working.
Our Novell eDirectory is installed with following credentials:
IP address: 10.0.x.xx(witsxxx.companyname.com)
Tree : SXXXX
New Tree Context: WIxxxK01-NDS.OU=STATE.O=ORG
ADMIN Context is: ou=STATE,o=ORG
admin : admin
password: admin
I used Novell Api and used following code
String ldapHost ="10.0.x.xx";
String loginDN = "cn=admin,cn=WIxxxK01-NDS,OU=STATE,o=ORG";
String password = string.Empty;
String searchBase = "o=ORG";
String searchFilter = "(objectclass=*)";
Novell.Directory.Ldap.LdapConnection lc = new Novell.Directory.Ldap.LdapConnection();
try
{
// connect to the server
lc.Connect(ldapHost, LdapPort);
// bind to the server
lc.Bind(LdapVersion, loginDN, password);
}
This is binding correctly and searching can be done.
Now my issue is with when I trying to use .NET APi and to use System.DirectoryServices
or System.DirectoryServices.Protocols, it is not connecting or binding.
I can't even test the following DirectoryEntry.Exists method. It is going to exception.
string myADSPath = "LDAP://10.0.x.xx:636/OU=STATE,O=ORG";
// Determine whether the given path is correct for the DirectoryEntry.
if (DirectoryEntry.Exists(myADSPath))
{
Console.WriteLine("The path {0} is valid",myADSPath);
}
else
{
Console.WriteLine("The path {0} is invalid",myADSPath);
}
It is saying Server is not operational or Local error occurred etc. I don't know what is happening with directory path.
I tried
DirectoryEntry de = new DirectoryEntry("LDAP://10.0.x.xx:636/O=ORG,DC=witsxxx,DC=companyname,DC=com", "cn=admin,cn=WIxxxK01-NDS,o=ORG", "admin");
DirectorySearcher ds = new DirectorySearcher(de, "&(objectClass=user)");
var test = ds.FindAll();
All are going to exceptions.
Could you please help me to solve this? How should be the userDN for DirectoryEntry?
I used System.DirectoryServices.Protocols.LdapConnection too with LdapDirectoryIdentifier and System.Net.NetworkCredential but no result. Only same exceptions.
I appreciate your valuable time and help.
Thanks,
Binu
To diagnose your LDAP connection error, get access to the eDirectory server from the admins, and use iMonitor (serverIP:8028/nds and select Dstrace), in Dstrace clear all tabs and enable LDAP tracing, then do your bind see what happens on the LDAP side to see if there is a more descriptive error there. Or if you even get far enough to bind and make a connection.

Access is denied 0x80070005 in ASP.net using SQL Server SMO

I am trying to create a simple web form which will give me a service restart button onscreen.
Upon clicking the button, I am creating an SMO object to talk to a SQL Server database and trying to stop and start the MSSQLSERVER service. All goes well until the Stop() method is called, at which point an exception is thrown stating:
Access is denied. (Exception from HRESULT: 0x80070005
(E_ACCESSDENIED))
The code under the button is as follows:
// connect the to server
ManagedComputer computer =
new ManagedComputer("172.16.150.52",#"Administrator","secret");
// return if there is a problem
if (computer.Services["MSSQLSERVER"] == null)
{
PageErrorMessage = "Bad or missing service \"MSSQLSERVER\"";
return;
}
// get the SQL Server Service
Service sqlServer = computer.Services["MSSQLSERVER"];
// is the server running?
if (sqlServer.ServiceState == ServiceState.Running)
sqlServer.Stop();
// wait for it to stop completely
int timeout = 0;
while (sqlServer.ServiceState != ServiceState.Stopped || timeout <= 60)
{
Thread.Sleep(1000);
sqlServer.Refresh();
timeout++;
}
if (timeout > 60)
{
PageErrorMessage = "Stop operation has timed out after 60secs";
return;
}
// start it again!
sqlServer.Start();
The IP address, username & password are 100% correct. Does anyone know why this would throw an AccessDenied exception?
It sounds like you're missing the UAC. Often, to do system-wide tasks such as rebooting, shutting down (and probably also starting/stopping services), you have to get the elevated priviliges, which includes obtaining a token, etc.
Take a look at this article - http://www.codeproject.com/KB/vista-security/UAC__The_Definitive_Guide.aspx - it has helped me on a few occasions.
But http://www.codeproject.com/KB/vista-security/ElevatedPrivilegesDemand.aspx might also be helpful.
I have only ever done this client side myself - I don't know how it works when running on a server. For that, you might want to take a look at: http://blogs.msdn.com/b/lightswitch/archive/2011/04/07/how-to-elevate-permissions-in-server-code-ravi-eda.aspx
And if it's not code, but configuration, take a look at this: http://www.lansweeper.com/kb/WMI-Access-is-denied.aspx

Resources