Objects in Hashtable
Hi,
I have a very basic question?
If one were to store an object in a Hashtable and then make that Hashtable nullable will it also implicitly make the object within it nullable?
Or do we have to explicitly make the object nullable first and then make hashtable nullable
Thanks
Ash
Hi Ash,
Indeed a very basic question, but can really test ur fundamentals. Well if u make that hashtableas nuul after putting the objects in it the, objectes will still be alive. The reason is that the hashtable only stores the refernces of those obj instances. So on the hastable getting killed, doesnt really kill the individual object refernces. It can only kill it's own memger object, once the destrucvtor is called.
U can tyr the following code.
public static void main(String[] args) {
String a = "Mohit";
java.lang.Integer i= new java.lang.Integer(1);
java.util.Hashtable h= new java.util.Hashtable();
h.put("String",a);
h.put("Integer",i);
h=null;
System.out.println(a+","+i);
Similar Messages
-
Please help how to set/get a class object in hashtable or hashmap?
Hi, everybody.
I'd like to generate a class-object list in hashtable.
However, compilation is error. Here is my code:
Hashtable ht = new Hashtable();
Class tmp_obj;
tmp_obj = Class.forName("my_class_name_1");
ht.put("my_class_name_1", tmp_obj);
tmp_obj = Class.forName("my_class_name_2");
ht.put("my_class_name_2", tmp_obj);
Class selected_object = ht.get("my_class_name");
^here compilation error: incompitable types
Could anybody tell me where is wrong in my code and how to
correct it?
Thank you in advance.
JeffLook at the javadoc for Hashtable. The get method returns an Object. You will need to cast it to a Class object.
Class selected_object = (Class)ht.get( "my_class_name" );If you are using JDK5.0, then you should look up generics. -
Problem with Serializable JDO objects containing Hashtables
Hi,
I have a simple JDO object which contains a Hashtable and I would like to
declare as Serializable. It seems though, that whenever I serialize this
object, I get a NullPointerException. I've written a bare-bones test case
and reproduced the exception, so I suspect this may be an enhancement issue.
Thanks,
Eric
Exception in thread "main" javax.jdo.JDOException
NestedThrowables:
java.lang.NullPointerException
at
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteC
all.java:245)
at
sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:220)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
at
org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker_Stub.invoke(Unknown
Source)
at
org.jboss.ejb.plugins.jrmp.interfaces.GenericProxy.invokeContainer(GenericPr
oxy.java:357)
at
org.jboss.ejb.plugins.jrmp.interfaces.StatefulSessionProxy.invoke(StatefulSe
ssionProxy.java:136)
at $Proxy1.getHash(Unknown Source)
at test.HashEjb.getHash(Unknown Source)
at test.Test.doIt(Test.java:13)
at test.Test.main(Test.java:7)Thanks for the prompt reply Patrick. I can hold off on this until early
next week...
"Patrick Linskey" <[email protected]> wrote:
This is a confirmed bug. We do not correctly deserialize any proxy map
classes.
How soon is ASAP? None of us can work on it until later this evening at
the earliest.
-Patrick
Patrick Linskey [email protected]
SolarMetric Inc. http://www.solarmetric.com -
If I add an object to a hash table ....
put(keyX, ObjectX)
and then add the SAME object again but with a different key....
put(keyY, ObjectX)
Do I end up with two elements in the hashTable?yup.. with 2 exact object just different keys...
-
Hello, I am trying to persist an object with a Hashtable.
I have a Feature object which has a hashtable of qualifiers. Both of the
key and value are of java.lang.String data type.
In my System.jdo:
<package name="com.primaci.bioprojects.plugins.geneMap">
<class name="Feature">
<field name="_qualifiers">
<map key-type="java.lang.String" embedded-key="true"
value-type="java.lang.String" embedded-value="true"/>
</field>
</class>
</package>
After running ant, when I try to run the web application, I got the
following exception, is there anything wrong with the system.jdo?
javax.servlet.UnavailableException: Startup exception:
javax.jdo.JDOFatalUserException: The system could not initialize; the
following registered persistent types are missing metadata or have not
been enhanced: [class com.primaci.bioprojects.plugins.geneMap.Feature].
at
com.primaci.bioprojects.startup.StartupServlet.init(StartupServlet.java:68)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:852)
at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3267)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3384)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:612)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:307)
at
org.apache.catalina.core.StandardService.start(StandardService.java:388)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:505)
at org.apache.catalina.startup.Catalina.start(Catalina.java:776)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
at java.lang.reflect.Method.invoke(Native Method)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)Alex,
What you did looks about right. The exception that you are seeing is
because you have not registered the Feature class with Kodo JDO. You can
do this either by running the schematool or by enumerating all the
persistent types in the 'persistent-types' preference. See the Kodo JDO
User Guide for more information.
-Patrick
[email protected] (Alex Tang) writes:
Hello, I am trying to persist an object with a Hashtable.
I have a Feature object which has a hashtable of qualifiers. Both of the
key and value are of java.lang.String data type.
In my System.jdo:
<package name="com.primaci.bioprojects.plugins.geneMap">
<class name="Feature">
<field name="_qualifiers">
<map key-type="java.lang.String" embedded-key="true"
value-type="java.lang.String" embedded-value="true"/>
</field>
</class>
</package>
After running ant, when I try to run the web application, I got the
following exception, is there anything wrong with the system.jdo?
javax.servlet.UnavailableException: Startup exception:
javax.jdo.JDOFatalUserException: The system could not initialize; the
following registered persistent types are missing metadata or have not
been enhanced: [class com.primaci.bioprojects.plugins.geneMap.Feature].
at
com.primaci.bioprojects.startup.StartupServlet.init(StartupServlet.java:68)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:852)
at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3267)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3384)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:612)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:307)
at
org.apache.catalina.core.StandardService.start(StandardService.java:388)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:505)
at org.apache.catalina.startup.Catalina.start(Catalina.java:776)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
at java.lang.reflect.Method.invoke(Native Method)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)
Patrick Linskey [email protected]
SolarMetric Inc. http://www.solarmetric.com -
Trying to return a Hashtable object
Hi,
I'm trying to return a Hashtable object from a method defined as:
public static Hashtable getValues(String str){
In the calling method, I'm using:
Hashtable<Object,Object> table=new Hashtable<Object,Object>();
table=(Hashtable<Object,Object>)Test.getValues(str);
I get the compiler warning as shown below:
Note: App.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Upon compiling with -Xlint:unchecked option, I get:
App.java:10: warning: [unchecked] unchecked cast
found : java.util.Hashtable
required: java.util.Hashtable<java.lang.Object,java.lang.Object>
table=(Hashtable<Object,Object>)Test.getValues(str);
^
How can I correct this?
Thanks.
Vijaywere your method to return a Map<Object, Object> rather than a HashMapyou could transparently return either a HashMap or a HashTable - or anything else that implements the Map interface - without changing any of the code that actually calls this method. you will still, obviously, need to instantiate one inside the method
hence the mantra "code to an abstraction, not a concrete type" -
Strange memory behaviour using the System.Collections.Hashtable in object reference
Dear all,
Recently I came across a strange memory behaviour when comparing the system.collections.hashtable versus de scripting.dictionary object and thought to analyse it a bit in depth. First I thought I incorrectly destroyed references to the class and
child classes but even when properly destroying them (and even implemented a "SafeObject" with deallocate method) I kept seeing strange memory behaviour.
Hope this will help others when facing strange memory usage BUT I dont have a solution to the problem (yet) suggestions are welcome.
Setting:
I have a parent class that stores data in child classes through the use of a dictionary object. I want to store many differenct items in memory and fetching or alteging them must be as efficient as possible using the dictionary ability of retrieving key
/ value pairs. When the child class (which I store in the dictionary as value) contains another dictionary object memory handeling is as expected where all used memory is release upon the objects leaving scope (or destroyed via code). When I use a system.collection.hashtable
no memory is released at all though apears to have some internal flag that marks it as useable for another system.collection.hashtable object.
I created a small test snippet of code to test this behaviour with (running excel from the Office Plus 2010 version) The snippet contains a module to instantiate the parent class and child classes that will contain the data. One sub will test the Hash functionality
and the other sub will test the dictionary functionality.
Module1
Option Explicit
Sub testHash()
Dim Parent As parent_class
Dim d_Count As Double
'Instantiate parent class
Set Parent = New parent_class
'Create a child using the hash collection object
Parent.AddChildHash "TEST_hash"
Dim d_CycleCount As Double
d_CycleCount = 50000
'Add dummy data records to the child container with x amount of data For d_Count = 0 To d_CycleCount
Parent.ChildContainer("TEST_hash").InsertDataToHash CStr(d_Count), "dummy data"
Next
'Killing the parent when it goes out of scope should kill the childs. (Try it out and watch for the termination debug messages)
'According to documentation and debug messages not really required!
Set Parent.ChildContainer("TEST_hash") = Nothing
'According to documentation not really as we are leaving scope but just to be consistent.. kill the parent!
Set Parent = Nothing
End Sub
Sub testDict()
Dim Parent As parent_class
Dim d_Count As Double
'Instantiate parent class
Set Parent = New parent_class
'Create a child using the dictionary object
Parent.AddChildDict "TEST_dict"
Dim d_CycleCount As Double
d_CycleCount = 50000
'Blow up the memory with x amount of records
Dim s_SheetCycleCount As String
s_SheetCycleCount = ThisWorkbook.Worksheets("ButtonSheet").Range("K2").Value
If IsNumeric(s_SheetCycleCount) Then d_CycleCount = CDbl(s_SheetCycleCount)
'Add dummy data records to the child container
For d_Count = 0 To d_CycleCount
Parent.ChildContainer("TEST_dict").InsertDataToDict CStr(d_Count), "dummy data"
Next
'Killing the parent when it goes out of scope should kill the childs. (Try it out and watch for the termination debug messages)
'According to documentation and debug messages not really required!
Set Parent.ChildContainer("TEST_dict") = Nothing
'According to documentation not really as we are leaving scope but just to be consistent.. kill the parent!
Set Parent = Nothing
End Sub
parent_class:
Option Explicit
Public ChildContainer As Object
Private Counter As Double
Private Sub Class_Initialize()
Debug.Print "Parent initialized"
Set ChildContainer = CreateObject("Scripting.dictionary")
End Sub
Public Sub AddChildHash(ByRef ChildKey As String)
If Not ChildContainer.Exists(ChildKey) Then
Dim TmpChild As child_class_hashtable
Set TmpChild = New child_class_hashtable
ChildContainer.Add ChildKey, TmpChild
Counter = Counter + 1
Set TmpChild = Nothing
End If
End Sub
Public Sub AddChildDict(ByRef ChildKey As String)
If Not ChildContainer.Exists(ChildKey) Then
Dim TmpChild As child_class_dict
Set TmpChild = New child_class_dict
ChildContainer.Add ChildKey, TmpChild
Counter = Counter + 1
Set TmpChild = Nothing
End If
End Sub
Private Sub Class_Terminate()
Debug.Print "Parent being killed, first kill all childs (if there are any left!) - muahaha"
Set ChildContainer = Nothing
Debug.Print "Parent killed"
End Sub
child_class_dict
Option Explicit
Public MemmoryLeakObject As Object
Private Sub Class_Initialize()
Debug.Print "Child using Scripting.Dictionary initialized"
Set MemmoryLeakObject = CreateObject("Scripting.Dictionary")
End Sub
Public Sub InsertDataToDict(ByRef KeyValue As String, ByRef DataValue As String)
If Not MemmoryLeakObject.Exists(KeyValue) Then MemmoryLeakObject.Add KeyValue, DataValue
End Sub
Private Sub Class_Terminate()
Debug.Print "Child using Scripting.Dictionary terminated"
Set MemmoryLeakObject = Nothing
End Sub
child_class_hash:
Option Explicit
Public MemmoryLeakObject As Object
Private Sub Class_Initialize()
Debug.Print "Child using System.Collections.Hashtable initialized"
Set MemmoryLeakObject = CreateObject("System.Collections.Hashtable")
End Sub
Public Sub InsertDataToHash(ByRef KeyValue As String, ByRef DataValue As String)
If Not MemmoryLeakObject.ContainsKey(KeyValue) Then MemmoryLeakObject.Add KeyValue, DataValue
End Sub
Private Sub Class_Terminate()
Debug.Print "Child using System.Collections.Hashtable terminated"
Set MemmoryLeakObject = Nothing
End Sub
Statistics:
TEST: (Chronologically ordered)
1.1 Excel starting memory: 25.324 kb approximately
Max memory usage after hash (500.000 records) 84.352 kb approximately
Memory released: 0 %
1.2 max memory usages after 2nd consequtive hash usage 81.616 kb approximately
"observation:
- memory is released then reused
- less max memory consumed"
1.3 max memory usages after 3rd consequtive hash usage 80.000 kb approximately
"observation:
- memory is released then reused
- less max memory consumed"
1.4 Running the dictionary procedure after any of the hash runs will start from the already allocated memory
In this case from 80000 kb to 147000 kb
Close excel, free up memory and restart excel
2.1 Excel starting memory: 25.324 kb approximately
Max memory usage after dict (500.000 records) 90.000 kb approximately
Memory released: 91,9%
2.2 Excel starting memory 2nd consequtive dict run: 27.552 kb approximately
Max memory usage after dict (500.000 records) 90.000 kb approximately
Memory released: 99,4%
2.3 Excel starting memory 3rd consequtive dict run: 27.712 kb approximately
Max memory usage after dict (500.000 records) 90.000 kb approximately
Memory released:Hi Cor,
Thank you for going through my post and took the time to reply :) Most apreciated. The issue I am facing is that the memory is not reallocated when using mixed object types and is not behaving the same. I not understand that .net versus the older methods
use memory allocation differently and perhaps using the .net dictionary object (in stead of the scripting.dictionary) may lead to similar behaviour. {Curious to find that out -> put to the to do list of interesting thingies to explore}
I agree that allocated memory is not a bad thing as the blocks are already assigned to the program and therefore should be reallocated with more performance. However the dictionary object versus hashtable perform almost identical (and sometimes even favor
the dictionary object)
The hashtable is clearly the winner when dealing with small sets of data.
The issue arises when I am using the hash table in conjunction with another type, for example a dictionary, I see that the dictionary object's memory is stacked on top of the claimed memory space of the hashtable. It appears that .net memory allocation and
reuse is for .net references only. :) (Or so it seems)
In another example I got with the similar setup, I see that the total used memory is never released or reclaimed and leakage of around 20% allocated memory remains to eventually crash the system with the out of memory message. (This is when another class
calls the parent class that instantiates the child class but thats not the point of the question at hand)
This leakage drove me to investigate and create the example of this post in the first place. For the solution with the class -> parent class -> child class memory leak I switched all to dictionaries and no leakage occurs anymore but nevertheless thought
it may be good to share / ask if anyone else knows more :D (Never to old to learn something new) -
I need to retrieve an Object[] of all keys in java.util.Hashtable
public abstract class ArrayFunctionality {
* Construct {@link java.lang.Object} array of keys from {@link java.util.Hashtable}
* @param h {@link java.util.Hashtable}
* @return array {@link java.lang.String}
* @throws java.lang.IndexOutOfBoundsException Exception thrown if initial {@link java.lang.Object} array paramater cannot be indexed
public static Object[] arrayKeys(Hashtable<Object, Object> h) throws IndexOutOfBoundsException {
Vector<Object> v = new Vector<Object>();
Enumeration keys = h.keys();
while (keys.hasMoreElements()) v.add(keys.nextElement());
return v.toArray();
// HOWEVER, this occurs with Hashtable<String, String> attrs:
if (hasSetHashtable) String[] keyArray = ArrayFunctionality.arrayKeys(attrs);
// DOES NOT COMPILE: ".class expected - not a statement"I am not understanding why this is occurring, please advise, I'm lost on this one.
Thanx
PhilI still don't understand what you mean but it now
works..
I am sorry I just don't understand the difference
between
if (hasSetHashtable) {
String[] keyArray;
keyArray = ArrayFunctionality.arrayKeys(attrs);
}AND
if (hasSetHashtable) {
String[] keyArray =
ArrayFunctionality.arrayKeys(attrs);PhilThere is no difference between those two you posted. The difference is between
String[] keyArray;
if (...) {
keyArray = ArrayFunctionality.arrayKeys(attrs);
}and
if (...) {
String[] keyArray;
keyArray = ArrayFunctionality.arrayKeys(attrs);
}In the first, the keyArray will exist outside of the scope of the if statement. In the second, the keyArray will no longer exist once you leave the if statement. Which is the same thing jbish said. -
Inserting Hashtable into a BLOB column..
Hi,
Iam trying to store a hashtable object into a BLOB column..when i try to retrieve
from hte blob column i get the following exception
StreamCorruptedException:out of range is 0I could insert into database successfully,while retrieving I got this exception.
I could able to insert and retrieve anyother java objects except Hashtable and
HashMap...
also I tried putting Hasttable into a Vector..that also didn'
t work.
thanks in advance.
Muthu
public void conn(){
ht.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
ht.put(Context.PROVIDER_URL,"t3://localhost:7001");
try {
ctx = new InitialContext(ht);
javax.sql.DataSource ds = (javax.sql.DataSource) ctx.lookup ("WorkFlowDataSource");
java.sql.Connection connection = ds.getConnection();
connection.setAutoCommit(false);
Statement statement = connection.createStatement();
rs = statement.executeQuery("select blob_data from test for update");
while (rs.next()) {
myRegularBlob = rs.getBlob("blob_data");
OutputStream os = ((weblogic.jdbc.common.OracleBlob)myRegularBlob).getBinaryOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(os);
Hashtable hash = new Hashtable();
hash.put("1","111111111hgfdhgkdkvalue");
oos.writeObject(hash);
oos.flush();
connection.commit();
System.out.println("Object inserted into persistence..");
rs.close();
statement.close();
} catch(Exception ex){
ex.printStackTrace();
retrieve();
public void retrieve(){
try {
ctx = new InitialContext(ht);
javax.sql.DataSource ds = (javax.sql.DataSource) ctx.lookup ("WorkFlowDataSource");
java.sql.Connection connection = ds.getConnection();
Statement statement = connection.createStatement();
rs = statement.executeQuery("select blob_data from test ");
while (rs.next()) {
myRegularBlob = rs.getBlob("blob_data");
ObjectInputStream oos1 = new ObjectInputStream(os1);
Hashtable sections = (Hashtable)oos1.readObject();
System.out.println("Obj retrieved..\n"+sections);
statement.close();
rs.close();
connection.close();
} catch(Exception ex){
ex.printStackTrace();
"Slava Imeshev" <[email protected]> wrote:
Muthu,
could you show us how you write/read the hashtable?
Regards,
Slava Imeshev
"Muthu" <[email protected]> wrote in message
news:[email protected]...
Hi,
Iam trying to store a hashtable object into a BLOB column..when i tryto
retrieve
from hte blob column i get the following exception
StreamCorruptedException:out of range is 0 -
Ho to store java objects in oracle database
HI
for me the sceanario is,
i neeed to create , dynamically a table at the time of specified action.
i need to store the values retreieved from session and store it in a database..
for example
User usr=session.getAttribute("usr"); i need to store the user object.
and hashtable and hashmap values without iterating.
please suggest at the earliest
can it be done?
Regards,
Rameshmy requirement is like that,bcos of two different weblogic servers need to acess the central database.which contains user information.
The user object from first server will be stored in database.and the second server will retrieve the user information and it will set for its application.
please suggest me how to store java objects in database.
regards,
Ramesh -
Hi,
I am trying to check the PCD object permission for the logged in user with minimal performance impact.
I am using below code. This doesn't seem to work and "hasPermissions" always returns "false". Can someone tell me the problem with below code?
IUserFactory userFactory= UMFactory.getUserFactory();
IAclManager manager = UMFactory.getAclManager();
boolean hasPermission = manager.isAllowed("pcd:portal_content/ABC/XYZ/ROLE/TESTROLE", request.getUser(), IPermission.PCM_ADMIN_READ);
I tried another approach as well. This one did return "true" (expected result) but the issue is we have to lookup the object everytime. This might cause performance issues when checking permissions for many objects.
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, IPcdContext.PCD_INITIAL_CONTEXT_FACTORY);
env.put(Context.SECURITY_PRINCIPAL, request.getUser());
env.put("com.sap.portal.jndi.requested_aspect", PcmConstants.ASPECT_ADMINISTRATION);
InitialContext iCtx = null;
try {
String objectName = "pcd:portal_content/ABC/XYZ/ROLE/TESTROLE";
iCtx = new InitialContext(env);
IAdminBase myAdmin =(IAdminBase)iCtx.lookup(objectName);
IPermission myIview = (IPermission) myAdmin.getImplementation(IAdminBase.PERMISSION);
hasPermission = myIview.isAllowed(request.getUser(),IPermission.PCM_ADMIN_READ);
} catch (Exception e) {
e.printStackTrace();Hi,
If onlly certain pcd objects are locked which are used by other users parallely or if some one opened the object and not closed properly then you can go to the above path as suggested and unlock the objects.
If that is not the case then below threads will help you.
Re: Cannot update Pcd Configuration parameter Pcd.Xfs.Cache.HardReferenceLimit
Re: Service Configuration editor lock?
Raghu -
When we try to deploy a wsp to sharepoint containing code to generate quick launch menu we get the following error messages when running the last enable-spfeature command in powershell. The same code is working in the development environment, but when we
deploy to a test server the following error occurs:
Add-SPSolution "C:\temp\ImpactSharePoint.wsp"
Install-SPSolution -Identity impactsharepoint.wsp -GACDeployment
Enable-SPFeature impactsharepoint_branding -url http://im-sp1/sites/impact/
Enable-SPFeature impactsharepoint_pages -url http://im-sp1/sites/impact/
From UlsViewer.exe:
03.12.2014 15:21:25.45 PowerShell.exe (0x1620)
0x11F4 SharePoint Foundation
Database 880i
High System.Data.SqlClient.SqlException (0x80131904): Cannot insert duplicate key row in object 'dbo.NavNodes' with unique index 'NavNodes_PK'. The duplicate key value is (6323df8a-5c57-4d3e-a477-09aa8b66100a, 7ae114df-9d52-4b08-affa-8c544cbc27b6,
1000). The statement has been terminated. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj,
Boolean& dataReady) at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior
runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
behavior) at Microsoft.SharePoint.Utilities.SqlSession.ExecuteReader(SqlCommand command, CommandBehavior behavior, SqlQueryData monitoringData, Boolean retryForDeadLock) ClientConnectionId:2bb4004c-aa75-470e-b11e-dbf1c476aaed
5b7e05f7-49df-42ca-b7c9-8ae5b06b464f
03.12.2014 15:21:25.45 PowerShell.exe (0x1620)
0x11F4 SharePoint Foundation
Database 880k
High at Microsoft.SharePoint.SPSqlClient.ExecuteQueryInternal(Boolean retryfordeadlock) at Microsoft.SharePoint.SPSqlClient.ExecuteQuery(Boolean retryfordeadlock) at Microsoft.SharePoint.Library.SPRequestInternalClass.AddNavigationNode(String
bstrUrl, String bstrName, String bstrNameResource, String bstrNodeUrl, Int32 lType, Int32 lParentId, Int32 lPreviousSiblingId, Boolean bAddToQuickLaunch, Boolean bAddToSearchNav, String& pbstrDateModified) at Microsoft.SharePoint.Library.SPRequestInternalClass.AddNavigationNode(String
bstrUrl, String bstrName, String bstrNameResource, String bstrNodeUrl, Int32 lType, Int32 lParentId, Int32 lPreviousSiblingId, Boolean bAddToQuickLaunch, Boolean bAddToSearchNav, String& pbstrDateModified) at Microsoft.SharePoint.Library.SPRequest.AddNavigationNode(String
bstrUrl, String bstrName, String bstrNameResource, String bstrNodeUrl, Int32 lType, Int32 lParentId, Int32 lPreviousSiblingId, Boolean bAddToQuickLaunch, Boolean bAddToSearchNav, String& pbstrDateModified) at Microsoft.SharePoint.Navigation.SPNavigationNode.AddInternal(Int32
iPreviousNodeId, Int32 iParentId, Boolean bAddToQuickLaunch, Boolean bAddToSearchNav) at Microsoft.SharePoint.Navigation.SPNavigationNodeCollection.AddInternal(SPNavigationNode node, Int32 iPreviousNodeId) at ImpactSharePoint.ConfigureSharePointInstance.NavigationConfig.<ConfigureQuickLaunchBar>b__0()
at Microsoft.SharePoint.SPSecurity.<>c__DisplayClass5.<RunWithElevatedPrivileges>b__3() at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode) at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(WaitCallback
secureCode, Object param) at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated secureCode) at ImpactSharePoint.ConfigureSharePointInstance.NavigationConfig.ConfigureQuickLaunchBar() at ImpactSharePoint.Features.Pages.PagesEventReceiver.FeatureActivated(SPFeatureReceiverProperties
properties) at Microsoft.SharePoint.SPFeature.DoActivationCallout(Boolean fActivate, Boolean fForce) at Microsoft.SharePoint.SPFeature.Activate(SPSite siteParent, SPWeb webParent, SPFeaturePropertyCollection props, SPFeatureActivateFlags
activateFlags, Boolean fForce) at Microsoft.SharePoint.SPFeatureCollection.AddInternal(SPFeatureDefinition featdef, Version version, SPFeaturePropertyCollection properties, SPFeatureActivateFlags activateFlags, Boolean force, Boolean fMarkOnly)
at Microsoft.SharePoint.SPFeature.ActivateDeactivateFeatureAtWeb(Boolean fActivate, Boolean fEnsure, Guid featid, SPFeatureDefinition featdef, String urlScope, String sProperties, Boolean fForce) at Microsoft.SharePoint.SPFeature.ActivateDeactivateFeatureAtScope(Boolean
fActivate, Guid featid, SPFeatureDefinition featdef, String urlScope, Boolean fForce) at Microsoft.SharePoint.PowerShell.SPCmdletEnableFeature.UpdateDataObject() at Microsoft.SharePoint.PowerShell.SPCmdlet.ProcessRecord()
at System.Management.Automation.CommandProcessor.ProcessRecord() at System.Management.Automation.CommandProcessorBase.DoExecute() at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object
input, Hashtable errorResults, Boolean enumerate) at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][]
commandRedirections, FunctionContext funcContext) at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame
frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0
arg0) at System.Management.Automation.DlrScriptCommandProcessor.RunClause(Action`1 clause, Object dollarUnderbar, Object inputToProcess) at System.Management.Automation.CommandProcessorBase.DoComplete() at System.Management.Automation.Internal.PipelineProcessor.DoCompleteCore(CommandProcessorBase
commandRequestingUpstreamCommandsToStop) at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate) at System.Management.Automation.Runspaces.LocalPipeline.InvokeHelper()
at System.Management.Automation.Runspaces.LocalPipeline.InvokeThreadProc() at System.Management.Automation.Runspaces.PipelineThread.WorkerProc() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext,
ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()
5b7e05f7-49df-42ca-b7c9-8ae5b06b464f
03.12.2014 15:21:25.45 PowerShell.exe (0x1620)
0x11F4 SharePoint Foundation
Database 880j
High SqlError: 'Cannot insert duplicate key row in object 'dbo.NavNodes' with unique index 'NavNodes_PK'. The duplicate key value is (6323df8a-5c57-4d3e-a477-09aa8b66100a, 7ae114df-9d52-4b08-affa-8c544cbc27b6, 1000).'
Source: '.Net SqlClient Data Provider' Number: 2601 State: 1 Class: 14 Procedure: 'proc_NavStructAddNewNode' LineNumber: 92 Server: 'IMPACTCLUSTER\IMPACTDB'
5b7e05f7-49df-42ca-b7c9-8ae5b06b464f
03.12.2014 15:21:25.45 PowerShell.exe (0x1620)
0x11F4 SharePoint Foundation
Database 880j
High SqlError: 'The statement has been terminated.' Source: '.Net SqlClient Data Provider' Number: 3621 State: 0 Class: 0 Procedure: 'proc_NavStructAddNewNode' LineNumber: 92 Server: 'IMPACTCLUSTER\IMPACTDB'
5b7e05f7-49df-42ca-b7c9-8ae5b06b464f
03.12.2014 15:21:25.45 PowerShell.exe (0x1620)
0x11F4 SharePoint Foundation
Database tzku
High ConnectionString: 'Data Source=IMPACTCLUSTER\IMPACTDB;Initial Catalog=WSS_Content;Integrated Security=True;Enlist=False;Pooling=True;Min Pool Size=0;Max Pool Size=100;Connect Timeout=15;Application Name=SharePoint[powershell][1][WSS_Content]'
Partition: 6323df8a-5c57-4d3e-a477-09aa8b66100a ConnectionState: Closed ConnectionTimeout: 15
5b7e05f7-49df-42ca-b7c9-8ae5b06b464f
03.12.2014 15:21:25.45 PowerShell.exe (0x1620)
0x11F4 SharePoint Foundation
Database tzkv
High SqlCommand: 'BEGIN TRAN DECLARE @abort int SET @abort = 0 DECLARE @EidBase int,@EidHome int SET @EidBase = 0 SET @EidHome = NULL IF @abort = 0 BEGIN EXEC @abort = proc_NavStructAllocateEidBlockWebId @wssp0, @wssp1,
@wssp2, @wssp3, @EidBase OUTPUT SELECT @wssp4 = @EidBase, @wssp5 = @abort END IF @abort = 0 BEGIN EXEC @abort = proc_NavStructAddNewNodeByUrl '6323DF8A-5C57-4D3E-A477-09AA8B66100A','7AE114DF-9D52-4B08-AFFA-8C544CBC27B6',1,2072,-1,0,N'sites/impact/default.aspx',N'PersonSøk',N'PersonSøk',NULL,0,0,0,NULL,@EidBase,@EidHome
OUTPUT SELECT @wssp6 = @abort END IF @abort = 0 BEGIN EXEC proc_NavStructLogChangesAndUpdateSiteChangedTime @wssp7, @wssp8, NULL END IF @abort <> 0 BEGIN ROLLBACK TRAN END ELSE BEGIN COMMIT TRAN END IF @abort = 0 BEGIN EXEC proc_UpdateDiskUsed
'6323DF8A-5C57-4D3E-A477-09AA8B66100A' END ' CommandType: Text CommandTimeout: 0 Parameter: '@wssp0' Type: UniqueIdentifier Size: 0 Direction: Input Value: '6323df8a-5c57-4d3e-a477-09aa8b66100a' Parameter: '@wssp1'
Type: UniqueIdentifier Size: 0 Direction: Input Value: '7ae114df-9d52-4b08-affa-8c544cbc27b6' Parameter: '@wssp2' Type: Int Size: 0 Direction: Input Value: '1' Parameter: '@wssp3' Type: Int Size: 0 Direction: Input Value: '2072'
Parameter: '@wssp4' Type: Int Size: 0 Direction: Output Value: '2072' Parameter: '@wssp5' Type: Int Size: 0 Direction: Output Value: '0' Parameter: '@wssp6' Type: Int Size: 0 Direction: Output Value: '10006'
Parameter: '@wssp7' Type: UniqueIdentifier Size: 0 Direction: Input Value: '6323df8a-5c57-4d3e-a477-09aa8b66100a' Parameter: '@wssp8' Type: UniqueIdentifier Size: 0 Direction: Input Value: '7ae114df-9d52-4b08-affa-8c544cbc27b6'
5b7e05f7-49df-42ca-b7c9-8ae5b06b464f
03.12.2014 15:21:25.45 PowerShell.exe (0x1620)
0x11F4 SharePoint Foundation
Database aek90
High SecurityOnOperationCheck = True
5b7e05f7-49df-42ca-b7c9-8ae5b06b464f
03.12.2014 15:21:25.45 PowerShell.exe (0x1620)
0x11F4 SharePoint Foundation
Database d0d6
High System.Data.SqlClient.SqlException (0x80131904): Cannot insert duplicate key row in object 'dbo.NavNodes' with unique index 'NavNodes_PK'. The duplicate key value is (6323df8a-5c57-4d3e-a477-09aa8b66100a, 7ae114df-9d52-4b08-affa-8c544cbc27b6,
1000). The statement has been terminated. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj,
Boolean& dataReady) at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior
runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
behavior) at Microsoft.SharePoint.Utilities.SqlSession.ExecuteReader(SqlCommand command, CommandBehavior behavior, SqlQueryData monitoringData, Boolean retryForDeadLock) at Microsoft.SharePoint.SPSqlClient.ExecuteQueryInternal(Boolean
retryfordeadlock) at Microsoft.SharePoint.SPSqlClient.ExecuteQuery(Boolean retryfordeadlock) ClientConnectionId:2bb4004c-aa75-470e-b11e-dbf1c476aaed
5b7e05f7-49df-42ca-b7c9-8ae5b06b464f
03.12.2014 15:21:25.45 PowerShell.exe (0x1620)
0x11F4 SharePoint Foundation
Database ad194
High ExecuteQuery failed with original error 0x80131904
5b7e05f7-49df-42ca-b7c9-8ae5b06b464f
03.12.2014 15:21:25.45 PowerShell.exe (0x1620)
0x11F4 SharePoint Foundation
Database 8z23
Unexpected Unexpected query execution failure in navigation query, HResult -2146232060. Query text (if available): "BEGIN TRAN DECLARE @abort int SET @abort = 0 DECLARE @EidBase int,@EidHome int SET @EidBase
= 0 SET @EidHome = NULL IF @abort = 0 BEGIN EXEC @abort = proc_NavStructAllocateEidBlockWebId @wssp0, @wssp1, @wssp2, @wssp3, @EidBase OUTPUT SELECT @wssp4 = @EidBase, @wssp5 = @abort END IF @abort = 0 BEGIN EXEC @abort = proc_NavStructAddNewNodeByUrl '6323DF8A-5C57-4D3E-A477-09AA8B66100A','7AE114DF-9D52-4B08-AFFA-8C544CBC27B6',1,2072,-1,0,N'sites/impact/default.aspx',N'PersonSøk',N'PersonSøk',NULL,0,0,0,NULL,@EidBase,@EidHome
OUTPUT SELECT @wssp6 = @abort END IF @abort = 0 BEGIN EXEC proc_NavStructLogChangesAndUpdateSiteChangedTime @wssp7, @wssp8, NULL END IF @abort <> 0 BEGIN ROLLBACK TRAN END ELSE BEGIN COMMIT TRAN END IF @abort = 0 BEGIN EXEC proc_UpdateDiskUsed
'6323DF8A-5C57-4D3E-A477-09AA8B66100A' END "
5b7e05f7-49df-42ca-b7c9-8ae5b06b464f
03.12.2014 15:21:25.45 PowerShell.exe (0x1620)
0x11F4 SharePoint Foundation
General 8kh7
High <nativehr>0x8107140d</nativehr><nativestack></nativestack>An unexpected error occurred while manipulating the navigational structure of this Web.
5b7e05f7-49df-42ca-b7c9-8ae5b06b464f
03.12.2014 15:21:25.45 PowerShell.exe (0x1620)
0x11F4 SharePoint Foundation
General aix9j
High SPRequest.AddNavigationNode: UserPrincipalName=i:0).w|s-1-5-21-2030300366-1823906440-2562684930-2106, AppPrincipalName= ,bstrUrl=http://im-sp1/sites/impact ,bstrName=PersonSøk ,bstrNameResource=<null> ,bstrNodeUrl=/sites/impact/default.aspx
,lType=0 ,lParentId=2072 ,lPreviousSiblingId=-1 ,bAddToQuickLaunch=False ,bAddToSearchNav=False
5b7e05f7-49df-42ca-b7c9-8ae5b06b464f
03.12.2014 15:21:25.45 PowerShell.exe (0x1620)
0x11F4 SharePoint Foundation
General ai1wu
Medium System.Runtime.InteropServices.COMException: <nativehr>0x8107140d</nativehr><nativestack></nativestack>An unexpected error occurred while manipulating the navigational structure of this
Web., StackTrace: at Microsoft.SharePoint.Navigation.SPNavigationNode.AddInternal(Int32 iPreviousNodeId, Int32 iParentId, Boolean bAddToQuickLaunch, Boolean bAddToSearchNav) at Microsoft.SharePoint.Navigation.SPNavigationNodeCollection.AddInternal(SPNavigationNode
node, Int32 iPreviousNodeId) at ImpactSharePoint.ConfigureSharePointInstance.NavigationConfig.<ConfigureQuickLaunchBar>b__0() at Microsoft.SharePoint.SPSecurity.<>c__DisplayClass5.<RunWithElevatedPrivileges>b__3()
at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode) at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(WaitCallback secureCode, Object param) at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated
secureCode) at ImpactSharePoint.ConfigureSharePointInstance.NavigationConfig.ConfigureQuickLaunchBar() at ImpactSharePoint.Features.Pages.PagesEventReceiver.FeatureActivated(SPFeatureReceiverProperties properties)
at Microsoft.SharePoint.SPFeature.DoActivationCallout(Boolean fActivate, Boolean fForce) at Microsoft.SharePoint.SPFeature.Activate(SPSite siteParent, SPWeb webParent, SPFeaturePropertyCollection props, SPFeatureActivateFlags activateFlags, Boolean
fForce) at Microsoft.SharePoint.SPFeatureCollection.AddInternal(SPFeatureDefinition featdef, Version version, SPFeaturePropertyCollection properties, SPFeatureActivateFlags activateFlags, Boolean force, Boolean fMarkOnly) at Microsoft.SharePoint.SPFeature.ActivateDeactivateFeatureAtWeb(Boolean
fActivate, Boolean fEnsure, Guid featid, SPFeatureDefinition featdef, String urlScope, String sProperties, Boolean fForce) at Microsoft.SharePoint.SPFeature.ActivateDeactivateFeatureAtScope(Boolean fActivate, Guid featid, SPFeatureDefinition
featdef, String urlScope, Boolean fForce) at Microsoft.SharePoint.PowerShell.SPCmdletEnableFeature.UpdateDataObject() at Microsoft.SharePoint.PowerShell.SPCmdlet.ProcessRecord() at System.Management.Automation.CommandProcessor.ProcessRecord()
at System.Management.Automation.CommandProcessorBase.DoExecute() at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate) at System.Management.Automation.PipelineOps.InvokePipeline(Object
input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext) at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame
frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0) at System.Management.Automation.DlrScriptCommandProcessor.RunClause(Action`1
clause, Object dollarUnderbar, Object inputToProcess) at System.Management.Automation.CommandProcessorBase.DoComplete() at System.Management.Automation.Internal.PipelineProcessor.DoCompleteCore(CommandProcessorBase commandRequestingUpstreamCommandsToStop)
at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate) at System.Management.Automation.Runspaces.LocalPipeline.InvokeHelper()
at System.Management.Automation.Runspaces.LocalPipeline.InvokeThreadProc() at System.Management.Automation.Runspaces.PipelineThread.WorkerProc() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext,
ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()
5b7e05f7-49df-42ca-b7c9-8ae5b06b464f
03.12.2014 15:21:25.45 PowerShell.exe (0x1620)
0x11F4 SharePoint Foundation
Feature Infrastructure 88jm
High Feature receiver assembly 'ImpactSharePoint, Version=1.1.0.0, Culture=neutral, PublicKeyToken=3f4d824fecc0071e', class 'ImpactSharePoint.Features.Pages.PagesEventReceiver', method 'FeatureActivated' for feature
'd8aabd95-076a-4650-a8a6-0aa5bd8ac8d1' threw an exception: Microsoft.SharePoint.SPException: An unexpected error occurred while manipulating the navigational structure of this Web. ---> System.Runtime.InteropServices.COMException: <nativehr>0x8107140d</nativehr><nativestack></nativestack>An
unexpected error occurred while manipulating the navigational structure of this Web. at Microsoft.SharePoint.Library.SPRequestInternalClass.AddNavigationNode(String bstrUrl, String bstrName, String bstrNameResource, String bstrNodeUrl, Int32
lType, Int32 lParentId, Int32 lPreviousSiblingId, Boolean bAddToQuickLaunch, Boolean bAddToSearchNav, String& pbstrDateModified) at Microsoft.SharePoint.Library.SPRequest.AddNavigationNode(String bstrUrl, String bstrName, String bstrNameResource,
String bstrNodeUrl, Int32 lType, Int32 lParentId, Int32 lPreviousSiblingId, Boolean bAddToQuickLaunch, Boolean bAddToSearchNav, String& pbstrDateModified) --- End of inner exception stack trace --- at Microsoft.SharePoint.SPGlobal.HandleComException(COMException
comEx) at Microsoft.SharePoint.Library.SPRequest.AddNavigationNode(String bstrUrl, String bstrName, String bstrNameResource, String bstrNodeUrl, Int32 lType, Int32 lParentId, Int32 lPreviousSiblingId, Boolean bAddToQuickLaunch, Boolean bAddToSearchNav,
String& pbstrDateModified) at Microsoft.SharePoint.Navigation.SPNavigationNode.AddInternal(Int32 iPreviousNodeId, Int32 iParentId, Boolean bAddToQuickLaunch, Boolean bAddToSearchNav) at Microsoft.SharePoint.Navigation.SPNavigationNodeCollection.AddInternal(SPNavigationNode
node, Int32 iPreviousNodeId) at ImpactSharePoint.ConfigureSharePointInstance.NavigationConfig.<ConfigureQuickLaunchBar>b__0() at Microsoft.SharePoint.SPSecurity.<>c__DisplayClass5.<RunWithElevatedPrivileges>b__3()
at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode) at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(WaitCallback secureCode, Object param) at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated
secureCode) at ImpactSharePoint.ConfigureSharePointInstance.NavigationConfig.ConfigureQuickLaunchBar() at ImpactSharePoint.Features.Pages.PagesEventReceiver.FeatureActivated(SPFeatureReceiverProperties properties)
at Microsoft.SharePoint.SPFeature.DoActivationCallout(Boolean fActivate, Boolean fForce)
5b7e05f7-49df-42ca-b7c9-8ae5b06b464f
The code:
using System.Diagnostics;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Navigation;
namespace ImpactSharePoint.ConfigureSharePointInstance
public class NavigationConfig
public void ConfigureQuickLaunchBar(SPWeb web)
SPSecurity.RunWithElevatedPrivileges(delegate
//Delete All Links
web.AllowUnsafeUpdates = true;
for (int i = web.Navigation.QuickLaunch.Count - 1; i > -1; i--)
web.Navigation.QuickLaunch[i].Delete(); // -> Deleting all the links in quick launch
web.QuickLaunchEnabled = true;
EventLog.WriteEntry("Sharepointfeature","Starter");
//Adding Links
SPNavigationNodeCollection nodes = web.Navigation.QuickLaunch;
var sokNode = new SPNavigationNode("Søk", null, false);
nodes.AddAsFirst(sokNode);
sokNode.Update();
EventLog.WriteEntry("Sharepointfeature", "Lagt til søk");
// Personsøk
var personSokNode = new SPNavigationNode("Deltakere", "/sites/impact/default.aspx", false); //TODO: fix hardkoding
sokNode.Children.AddAsFirst(personSokNode);
personSokNode.Update();
EventLog.WriteEntry("Sharepointfeature", "Lagt til node personsøk");
// Udb-søk
var udbSokNode = new SPNavigationNode("UDB-Søk", "/sites/impact/udbsok.aspx", false); //TODO: fix hardkoding
sokNode.Children.AddAsLast(udbSokNode);
udbSokNode.Update();
EventLog.WriteEntry("Sharepointfeature", "Lagt til node udbsøk");
// Kommuner
var kommuneNode = new SPNavigationNode("Kommuner", "/sites/impact/kommunesearch.aspx", false); //TODO: fix hardkoding
sokNode.Children.AddAsFirst(kommuneNode);
kommuneNode.Update();
EventLog.WriteEntry("Sharepointfeature", "Lagt til node kommunesøk");
// Organisasjoner
var virksomhetNode = new SPNavigationNode("Organisasjoner", "/sites/impact/virksomhetsearch.aspx", false); //TODO: fix hardkoding
sokNode.Children.AddAsFirst(virksomhetNode);
virksomhetNode.Update();
EventLog.WriteEntry("Sharepointfeature", "Lagt til node kommunesøk");
// NIR
var nirNode = new SPNavigationNode("Nir", null, false); //TODO: fix hardkoding
nodes.AddAsLast(nirNode);
nirNode.Update();
EventLog.WriteEntry("Sharepointfeature", "Lagt til node Nir");
// Tilskudd
var tilskuddNode = new SPNavigationNode("Tilskudd", "/sites/impact/", false);
nodes.AddAsLast(tilskuddNode);
tilskuddNode.Update();
EventLog.WriteEntry("Sharepointfeature", "Lagt til node Tilskudd");
// Kjøringsoversikt
var showkjoringerNode = new SPNavigationNode("Kjøringsoversikt", "/sites/dev/kjoringoversikt.aspx", false); //TODO: fix hardkoding
tilskuddNode.Children.AddAsFirst(showkjoringerNode);
showkjoringerNode.Update();
EventLog.WriteEntry("Sharepointfeature", "Lagt til node showkjoringerNode");
web.Update();
EventLog.WriteEntry("Sharepointfeature", "Etter update");
//Setting homepage
SPFolder folder = web.RootFolder;
folder.WelcomePage = "default.aspx";
folder.Update();
EventLog.WriteEntry("Sharepointfeature", "Etter homepage");
web.AllowUnsafeUpdates = false;i think you need to debug your code, lookalike the values you trying insert already exist in the database.
these two IDs (6323df8a-5c57-4d3e-a477-09aa8b66100a, 7ae114df-9d52-4b08-affa-8c544cbc27b6).
i would try to run the select command against the content db.
SELECT TOP * FROM [DB Name].[dbo].[NavNodes] where id = '6323df8a-5c57-4d3e-a477-09aa8b66100a'
Please remember to mark your question as answered &Vote helpful,if this solves/helps your problem. ****************************************************************************************** Thanks -WS MCITP(SharePoint 2010, 2013) Blog: http://wscheema.com/blog -
Null Value returned into Hashtable from Vector (after 1.5 compilation )
Sorry i posted the Question with a misleading heading into another thread .
Hi , in the given peice of Code , date1 is a vector while date2 is a hashtable .
I am storing the date from the vector in a hashtable .
The code works fine for java 1.4 but Null value gets stored after compiling in 1.5.
There is no error during compilation .
Hashtable date2 = (Hashtable) date1.elementAt(0);
cat.debug("date2"+date2.get("TO_CHAR(TO_DATE(TO_CHAR(RES_DT,DD-MON-YYYY)),DD-MON-YYYY)"));"TO_CHAR(TO_DATE(TO_CHAR(RES_DT,DD-MON-YYYY)),DD-MON-YYYY)") is the key , there is no error in that .
cat.debug is log4j function used to write log to an text file.
From searchin the net i got the i would have to typecast (not sure if am using the right technical term ) .
protected Hashtable<Object,Object> lNVPair = new Hashtable<Object,Object>();
protected Vector<Object> lNVKeys = new Vector<Object>();But how am i suppose to use it in the above state where with declaration i am assigning value at same time ?..
Hashtable<Object,Object> date2 = (Hashtable<Object,Object>) date1.elementAt(0);Here is more details about date1 :
Vector date1 = mDao.getDate(lcrnno,ltxntype,lbranchCd);Value of date1 is filled by calling a function which in turns queries the database .
Details about the function are below .
public Vector getDate(String pcrnno,String ptxntype,String br_cd)//throws SQLException
Vector lResult=null;
ResultSet lresult = null;
try {
Hashtable linner=new Hashtable();
lResult=new Vector();
//String lstrquery declared containing the query to be executed .
mPstmt = mConn.prepareStatement(lstrquery);
lresult = mPstmt.executeQuery();
ResultSetMetaData lrsmd=null;
lrsmd=lresult.getMetaData();
int lcolCount=lrsmd.getColumnCount();
cat.debug("Number of fields:"+lcolCount);
while(lresult.next())
linner=new Hashtable();
for(int i=1;i<=lcolCount;i++) {
String lkey=lrsmd.getColumnName(i); //column name to be used as key
String lvalue=lresult.getObject(i).toString(); //value
linner.put(lkey,lvalue); //populating the hashtable
}//end of for
lResult.add(linner); //adding to vector
}//end of whileNote I have not added the part of code where query string created and parameters passed .
Hope that should be enough details ... -
I have an Object that I pull from a Hashtable. I don't know what type of Object it is, nor do I care. But I need to make a copy of it and .clone() is protected on Object.
eg.
Object obj1 = hashtable.get(key);
Object obj2 = obj1.clone(); // WILL NOT COMPILE (even in a try block)
Any ideas?If these objects were created by your code, then they each need to implement Cloneable and also implement a public clone() method. If you call the clone() method of Object via super.clone(), then it is a shallow copy and you'll need to copy any embedded objects yourself.
Assuming that all the classes in your Hashtable implement a public clone() method, then you'll need to either cast the reference to the appropriate class , or else use reflection to invoke the clone method.
e.gimport java.lang.reflect.*;
Object obj = yourHashtable.get("key");
try {
Method meth = obj.getClass().getMethod("clone", null);
try {
Object x = meth.invoke(obj, null);
...do something with cloned object x...
} catch (Exception ex) {
System.out.println("cannot call clone method: " + ex);
} catch (NoSuchMethodException nsmex) {
System.out.println("No public clone method exists: " + nsmex);
} -
Sharepoint log files growing huge
Once again a SharePoint question :)
I ran the following script against our SharePoint 2013 farm:
#Specify the location of the CSV file here.
$r = Import-Csv C:\folder\users.csv
foreach($i in $r){
#The following line displays the current user.
Write-Host "The URL is:"$i.Url
#Disables the "Minimal Download Strategy" feature under "Site Features".
#Disable-SPFeature -Identity "MDSFeature" -Url $i.Url -force -confirm:$false
#Enables the "SharePoint Server Publishing" feature under "Site Features".
Enable-SPFeature -Identity "PublishingSite" -Url $i.Url -force -confirm:$false
#Enables the "SharePoint Server Publishing Infrastructure" feature under "Site Collection Features".
Enable-SPFeature -Identity "PublishingWeb" -Url $i.Url -force -confirm:$false
The csv file that is being imported contains about 2000+ rows with users' MySite links where we want to en-/disable several features.
The script does what it is supposed to do, but while running the script and reaching user No. ~15 the log files under "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\LOGS" starts to grow huuuuuuge (~5GB).
They are mostly filled with this:
09/17/2014 11:04:27.72 PowerShell.exe (0x235C) 0x2B44 SharePoint Foundation Performance naqx Monitorable Potentially excessive number of SPRequest objects (18) currently unreleased on thread 6. Ensure that this object or its parent (such as an SPWeb or SPSite) is being properly disposed. This object is holding on to a separate native heap.This object will not be automatically disposed. Allocation Id for this object: {D5F7BC80-8C88-4E17-9985-782F9724F2B9} Stack trace of current allocation: at Microsoft.SharePoint.SPGlobal.CreateSPRequestAndSetIdentity(SPSite site, String name, Boolean bNotGlobalAdminCode, String strUrl, Boolean bNotAddToContext, Byte[] UserToken, SPAppPrincipalToken appPrincipalToken, String userName, Boolean bIgnoreTokenTimeout, Boolean bAsAnonymous) at Microsoft.SharePoint.SPWeb.InitializeSPRequest() at Microsoft.SharePoint.SPWeb.EnsureSPRequest() at Microsof... 5b7cf973-1e3f-4985-bdf8-598eecf86ab6
09/17/2014 11:04:27.72* PowerShell.exe (0x235C) 0x2B44 SharePoint Foundation Performance naqx Monitorable ...t.SharePoint.SPWeb.SetAllowUnsafeUpdates(Boolean allowUnsafeUpdates) at Microsoft.SharePoint.SPPageParserNativeProvider.<>c__DisplayClass1.<UpdateBinaryPropertiesForWebParts>b__0() at Microsoft.SharePoint.SPSecurity.RunAsUser(SPUserToken userToken, Boolean bResetContext, WaitCallback code, Object param) at Microsoft.SharePoint.SPPageParserNativeProvider.UpdateBinaryPropertiesForWebParts(Byte[]& userToken, Guid& tranLockerId, Guid siteId, Int32 zone, String webUrl, String documentUrl, Object& registerDirectivesData, Object& connectionInformation, Object& webPartInformation, IntPtr pWebPartUpdater) at Microsoft.SharePoint.Library.SPRequestInternalClass.EnableModuleFromXml(String bstrSetupDirectory, String bstrFeatureDirectory, String bstrUrl, String bstrXML, Boolean fForceUng... 5b7cf973-1e3f-4985-bdf8-598eecf86ab6
09/17/2014 11:04:27.72* PowerShell.exe (0x235C) 0x2B44 SharePoint Foundation Performance naqx Monitorable ...host, ISPEnableModuleCallback pModuleContext) at Microsoft.SharePoint.Library.SPRequestInternalClass.EnableModuleFromXml(String bstrSetupDirectory, String bstrFeatureDirectory, String bstrUrl, String bstrXML, Boolean fForceUnghost, ISPEnableModuleCallback pModuleContext) at Microsoft.SharePoint.Library.SPRequest.EnableModuleFromXml(String bstrSetupDirectory, String bstrFeatureDirectory, String bstrUrl, String bstrXML, Boolean fForceUnghost, ISPEnableModuleCallback pModuleContext) at Microsoft.SharePoint.SPModule.ActivateFromFeature(SPFeatureDefinition featdef, XmlNode xnModule, SPWeb web) at Microsoft.SharePoint.Administration.SPElementDefinitionCollection.ProvisionModules(SPFeaturePropertyCollection props, SPSite site, SPWeb web, SPFeatureActivateFlags activateFlags, Boole... 5b7cf973-1e3f-4985-bdf8-598eecf86ab6
09/17/2014 11:04:27.72* PowerShell.exe (0x235C) 0x2B44 SharePoint Foundation Performance naqx Monitorable ...an fForce) at Microsoft.SharePoint.Administration.SPElementDefinitionCollection.ProvisionElements(SPFeaturePropertyCollection props, SPWebApplication webapp, SPSite site, SPWeb web, SPFeatureActivateFlags activateFlags, Boolean fForce) at Microsoft.SharePoint.SPFeature.Activate(SPSite siteParent, SPWeb webParent, SPFeaturePropertyCollection props, SPFeatureActivateFlags activateFlags, Boolean fForce) at Microsoft.SharePoint.SPFeatureCollection.AddInternal(SPFeatureDefinition featdef, Version version, SPFeaturePropertyCollection properties, SPFeatureActivateFlags activateFlags, Boolean force, Boolean fMarkOnly) at Microsoft.SharePoint.SPFeatureCollection.CheckSameScopeDependency(SPFeatureDefinition featdefDependant, SPFeatureDependency featdep, SPFeatureDefinition featdefDep... 5b7cf973-1e3f-4985-bdf8-598eecf86ab6
09/17/2014 11:04:27.72* PowerShell.exe (0x235C) 0x2B44 SharePoint Foundation Performance naqx Monitorable ...endency, Boolean fActivateHidden, Boolean fUpgrade, Boolean fForce, Boolean fMarkOnly) at Microsoft.SharePoint.SPFeatureCollection.CheckFeatureDependency(SPFeatureDefinition featdefDependant, SPFeatureDependency featdep, Boolean fActivateHidden, Boolean fUpgrade, Boolean fForce, Boolean fMarkOnly, FailureReason& errType) at Microsoft.SharePoint.SPFeatureCollection.CheckFeatureDependencies(SPFeatureDefinition featdef, Boolean fActivateHidden, Boolean fUpgrade, Boolean fForce, Boolean fThrowError, Boolean fMarkOnly, List`1& missingFeatures) at Microsoft.SharePoint.SPFeatureCollection.AddInternal(SPFeatureDefinition featdef, Version version, SPFeaturePropertyCollection properties, SPFeatureActivateFlags activateFlags, Boolean force, Boolean fMarkOnly) at Microsoft.SharePoint.S... 5b7cf973-1e3f-4985-bdf8-598eecf86ab6
09/17/2014 11:04:27.72* PowerShell.exe (0x235C) 0x2B44 SharePoint Foundation Performance naqx Monitorable ...PFeature.ActivateDeactivateFeatureAtSite(Boolean fActivate, Boolean fEnsure, Guid featid, SPFeatureDefinition featdef, String urlScope, String sProperties, Boolean fForce) at Microsoft.SharePoint.SPFeature.ActivateDeactivateFeatureAtScope(Boolean fActivate, Guid featid, SPFeatureDefinition featdef, String urlScope, Boolean fForce) at Microsoft.SharePoint.PowerShell.SPCmdletEnableFeature.UpdateDataObject() at Microsoft.SharePoint.PowerShell.SPCmdlet.ProcessRecord() at System.Management.Automation.CommandProcessor.ProcessRecord() at System.Management.Automation.CommandProcessorBase.DoExecute() at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate) at System.Management.Automati... 5b7cf973-1e3f-4985-bdf8-598eecf86ab6
09/17/2014 11:04:27.72* PowerShell.exe (0x235C) 0x2B44 SharePoint Foundation Performance naqx Monitorable ...on.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext) at lambda_method(Closure , Object[] , StrongBox`1[] , InterpretedFrame ) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0) at System.... 5b7cf973-1e3f-4985-bdf8-598eecf86ab6
09/17/2014 11:04:27.72* PowerShell.exe (0x235C) 0x2B44 SharePoint Foundation Performance naqx Monitorable ...Management.Automation.DlrScriptCommandProcessor.RunClause(Action`1 clause, Object dollarUnderbar, Object inputToProcess) at System.Management.Automation.CommandProcessorBase.DoComplete() at System.Management.Automation.Internal.PipelineProcessor.DoCompleteCore(CommandProcessorBase commandRequestingUpstreamCommandsToStop) at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate) at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext) at System.Management.Automation.Interpreter.ActionCallInstruction`6.R... 5b7cf973-1e3f-4985-bdf8-598eecf86ab6
09/17/2014 11:04:27.72* PowerShell.exe (0x235C) 0x2B44 SharePoint Foundation Performance naqx Monitorable ...un(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame) at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0) at System.Management.Automation.DlrScriptCommandProcessor.RunClause(Action`1 clause, Object dollarUnderbar, Object inputToProcess) at System.Management.Automation.CommandProcessorBase.DoComplete() at System.Management.Automation.Internal.PipelineProcessor.DoCompleteCore(CommandProcessorBase commandRequestingUpstreamCommandsToStop) at System.Management.Automation.Intern... 5b7cf973-1e3f-4985-bdf8-598eecf86ab6
09/17/2014 11:04:27.72* PowerShell.exe (0x235C) 0x2B44 SharePoint Foundation Performance naqx Monitorable ...al.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate) at System.Management.Automation.Runspaces.LocalPipeline.InvokeHelper() at System.Management.Automation.Runspaces.LocalPipeline.InvokeThreadProc() at System.Management.Automation.Runspaces.PipelineThread.WorkerProc() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart... 5b7cf973-1e3f-4985-bdf8-598eecf86ab6
09/17/2014 11:04:27.72* PowerShell.exe (0x235C) 0x2B44 SharePoint Foundation Performance naqx Monitorable ...() 5b7cf973-1e3f-4985-bdf8-598eecf86ab6
I tried finding something on the internet on this but either my Google Mojo is gone or there is no one else posting about this.
Since we do not want to change the logging behavior of SharePoint (unless it is really necessary), I'd like to know if there is something wrong with my code? Is there some parameter I can use to suspend logging for this script? There must be something I'm
doing horribly wrong :(
Thanks in advance!
(If anything I posted is unclear please let me know since English isn't my first language)
EDIT: There is nothing productive happening on that farm. There is a web application for the MySites and one for a publishing portal (without any significant content).It's because MS did a poor job on the SharePoint object model. You shouldn't need to call a 'dispose' method on any object in .Net, the garbage collector should automatically identify a no-longer required object and remove it. Unfortunately, and there might
be a reason for it, that isn't true for SPWeb or SPSite objects.
Evidently the Enable-SPFeature comandlet contains a SPSite or SPWeb object and fails to dispose of it.
You could try using Start-SPAssignment: http://technet.microsoft.com/en-us/library/ff607664%28v=office.15%29.aspx which some have found to be useful to deal with this. Another option would be to create a process that generates a new thread for each row in
the csv which will result in the objects being destroyed as that process ends.
Maybe you are looking for
-
Automatic creation of Cost Object owner in work flow
Hello Experts, Business requirement background is SREQ Contact person just enter cost object and submit for approval.In all cost object cases he can save the service order and submit. After SREQ FRA reviewer approval, before workflow notification mai
-
Losing ability to download on iMacs.
We have a strange problem here at work. We have a combination of iMacs and PCs and we're having network issues with the iMacs. On the iMacs anytime someone tries to download a larger file (i.e. tries to watch a video on Apple.com) it downloads about
-
HT3576 HOW Do I TURN OFF PUSH NOTIFICATIONS THRU ITUNES
How do I turn off push notifications when using words with friends on my iphone. It tells me to go thru itunes. Where do I do this??
-
Regarding Batch job "RISTRA20" getting fail
Hi, There is one bacaground Job which is active for the past three days with no error it has not gererated an output also, its a standard report "RISTRA20" for PM module. have you got any idea why the job is active such a long time, it has not finish
-
Allowing iPhone through firewall
Hi... We use a Shorewall firewall with very restrictive policies on our network. I'm trying to figure out how to allow the iPhone through the network when connected via the cellular network. I was originally thinking allow it though by MAC address, h