Friday 28 October 2016

Alfresco : ObjID already in Use Issue

While working on alfresco today, I encountered an issue which took almost 2 hours to debug.

Issue :
While starting the alfresco, the process starts fine but in the end the following error logs were popping out.

ERROR [web.context.ContextLoader] Context initialization failedorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.remoting.rmi.RmiServiceExporter' defined in class path resource [alfresco/emailserver/email-service-context.xml]: Invocation of init method failed; nested exception is java.rmi.server.ExportException: internal error: ObjID already in useCaused by: java.rmi.server.ExportException: internal error: ObjID already in use

On googling one of the suggestion was that the alfrsco port is blocked by firewall. I disabled the firewall but issue was still there. At the end the issue was turned out to be weird.  The solution was...

Solution :
There was wrong entry for my machine inside /etc/hosts file. To fix the issue i had to fixed it by assigning my machine ip (the correct ip, as it was changed) to node name. To fix the issue, add entry 127.0.0.1 localhost.

  

Tuesday 11 October 2016

Playing with tensorflow

import tensorflow as tf
import numpy as np

#Declare variable in tensorflow

#constant(value, dtype, shape, name)

strng = tf.constant("hello tensor");
session = tf.Session();
print session.run(strng);


#shape means the shape of output. In this case it will be 3x4 matrix. Where the missing values will be filled
#using last value i.e 4

cont_tensor = tf.constant([1,2,3,4],dtype=tf.int32,shape=[3,4],name="SimpleTensor");
print session.run(cont_tensor);

cont_tensor2=tf.constant(1, dtype=tf.float16, shape=[4,4], name="TensorWithAllValues");
result = session.run(cont_tensor2);
#print tensor's name
print cont_tensor2.name

#Define Place holder
m1PH = tf.placeholder(tf.int32, shape=[3,3], name="Matrix1PlaceHoler")
m2PH = tf.placeholder(tf.int32, shape=[3,3], name="Matrix2PlaceHolder")

#Define operations
#addOperation =  tf.add(m1PH, m2PH, name="Add Operation");
mulOperation = tf.matmul(m1PH, m2PH);

#create a matrix of random values and feed it to both place holders
randomMatrix = np.random.random_integers(1,10, [3,3])

print session.run(mulOperation, feed_dict={m1PH: randomMatrix, m2PH: randomMatrix})

#saving graph for tensorboard
tf.train.SummaryWriter("/home/shahzeb/tensorflow/tensorboardlogs",session.graph)

#Once code is executed, launch tensorboard to view the graph generated.
#execute the following command
#$> tensorboard --logdir=/path/to/log/dir #in my case its /home/shahzeb/...