Finally cause Exception be forgotten
In trying out that finally cause previous return value be forgotten, as described on page 206 of "The Java Programming Language, 3rd edition", I wrote the following code, and tested it with jdk1.3.1. To my supprise, not only the return value was forgotten, the exception was appeared forgotten as well:
class PException extends Exception {
class Final {
void f1(int i) {
int result;
System.out.println("f1("+i+")");
try {
result = f2(i);
System.out.println("result = " + result);
} catch(Exception e) {
System.out.println("caught an Exception: " + e);
try {
result = f3(i);
System.out.println("result = " + result);
} catch(Exception e) {
System.out.println("caught an Exception: " + e);
int f2(int i) throws PException {
try {
if (i == 1) {
System.out.println("generate exception");
throw new PException();
return 1;
} finally {
return 2;
int f3(int i) throws PException {
if (i == 1) {
System.out.println("generate exception");
throw new PException();
return 1;
public static void main(String[] args) {
Final f = new Final();
f.f1(1);
f.f1(2);
f.f1(1);
}Here is the result:
f1(1)
generate exception
result = 2
generate exception
caught an Exception: PException
f1(2)
result = 2
result = 1
f1(1)
generate exception
result = 2
generate exception
caught an Exception: PException
The concern here is that when the
try {
finally {
}pattern is used, without the catch block, purelly for flow control purpose, a return statement in the finally block could be problematic. If a finally block ends with a return statement, any exception that might be thrown in the try block would be ignored. The unhandled exception will not propergate, it simply lost in the midst. Because any code could throw unchecked exception, if the exception cannot afford to be lost, then one should be careful not to use return in the finally block. See the following test code:
class Finally {
void test() {
int result;
System.out.println("test()");
try {
result = f1();
System.out.println("result = " + result);
} catch(Exception e) {
System.out.println("Caught an Exception: " + e);
try {
result = f2();
System.out.println("result = " + result);
} catch(Exception e) {
System.out.println("Caught an Exception: " + e);
try {
f3();
} catch(Exception e) {
System.out.println("Caught an Exception: " + e);
try {
f4();
} catch(Exception e) {
System.out.println("Caught an Exception: " + e);
int f1() {
System.out.println("f1()");
int a = 0;
int b = 0;
try {
a = 1/0; // this generate an unchecked exception
b = 1;
} finally {
return b; // this return clobber the unchecked exception
int f2() {
System.out.println("f2()");
int a = 0;
int b = 0;
a = 1/0; // this generate an unchecked exception
b = 1;
return b;
void f3() {
System.out.println("f3()");
int a = 0;
int b = 0;
try {
a = 1/0; // this generate an unchecked exception
b = 1;
} finally {
return; // this return clobber the unchecked exception
void f4() {
System.out.println("f4()");
int a = 0;
int b = 0;
try {
a = 1/0; // this generate an unchecked exception
b = 1;
} finally {
public static void main(String[] args) {
Finally f = new Finally();
f.test();
/code]
Here are the results:test()
f1()
result = 0
f2()
Caught an Exception: java.lang.ArithmeticException: / by zero
f3()
f4()
Caught an Exception: java.lang.ArithmeticException: / by zero
We see that the devide by zero exception throw by f1() simply vanished, the unintended result 0, instead of the intended result 1, is returned. The test() method did not detect any abnormality in f1(), which is scary. To drive the point home, we try f3() and f4(), which has void return type. A simple return statement in f3() causes exception be lost. The stack frame seems intact, for otherwise, the test() method would exit abruptly before f2() even get a chance to be called.
Similar Messages
-
Digital graph causes exception in 8.5
Wanted to port some of my older LV panels to 8.5. I noticed that LabView would generate the following message when attempting to load one of my panels:
"Unhandled exception at 0x007513e0 in LabVIEW.exe: 0xC0000005: Access violation reading location 0x00000000"
The following is a snippit of code from the debugger:
007513B0 aaa
007513B1 adc esi,dword ptr [ebp]
007513B4 bound edx,qword ptr [ebx]
007513B6 jne 007513B8
007513B8 jnp 007513CD
007513BA jne 007513BC
007513BC xchg eax,esp
007513BD adc esi,dword ptr [ebp]
007513C0 xor ecx,ecx
007513C2 xor eax,eax
007513C4 test edx,edx
007513C6 je 00751461
007513CC mov eax,dword ptr [edx+4]
007513CF test eax,eax
007513D1 push esi
007513D2 mov esi,dword ptr [edx]
007513D4 jle 0075145B
007513DA mov edx,dword ptr [edx+8]
007513DD push edi
007513DE mov edi,eax
007513E0 mov al,byte ptr [esi] <<<<************************************************ Dies here
007513E2 cmp al,2
007513E4 jne 007513EB
007513E6 or ecx,4
007513E9 jmp 00751412
007513EB cmp al,5
Panels like this one are mid sized, containing 10 - 20 sub VIs. I stripped the panel down to try and find what exactly was causing LV 8.5 to crash. It turns out to be the digital graph. I have attached a very simple panel that just contains the digital graph with nothing wired to it. If you try to run this in 8.5 I am guessing it will cause the problem. I tried it on a few PCs and get the same results.
Attachments:
main.vi 20 KBLooking at my disks, version 6 appears to have been the first release to support digital graphs. I remember using as soon as it was available.
I tried several tests to see if I could further narrow down the problem for NI.
I am able to load the raw version 6.0 examples directly into 8.5.
1) I saved version 6.0 example "Simple Digital Waveform Graph" (SDWG) into a seperate VI. It loads in both 6.1 and 8.5 with no exception.
2) Loaded main.vi example and copied it into the SDWG using 6.1. Causes exception in 8.5
3) Connect the two graphs together in example so digital data is shown on both graphs, then saved the values as defaults. This version loads in 8.5 with no exception.
4) Start with main.vi, clear all the waveform data and save as defaults. Causes exception in 8.5
So, problem appears to have nothing to do with the cursors but does appear to be something with the data that had been stored into this graph when the defaults were saved. It is really strange that clearing the data does not solve the problem. Maybe this is a bigger problem than I originally thought.
Message Edited by lecroy on 10-09-2008 01:07 PM -
Hello,
We have an CRM 7.0 system linked to EHP4 ECC.
We have implemented LEAN Order Interface.
Now while saving an ERP Sales Order from CRM Screen, it gives an errror saying "ERP Interfaced stopped / failed unexpectedly".
We have implemented enhancement spot ENH_SPOT_LORD for the same in ECC.
No Detailed error description is appearing, no application log is being written, neither in ECC nor in CRM.
Required Switches are also made activated in SWF5. Mapping Structures are also mapped in LORD_MAPPING and LORD_MAPPING_RO.
error message that I get is : ERP_LORD_GET_HEAD caused exception EXC_LORD_NOT_LOADED
Can some1 please help the BADI's and the mandatory methods that needs to be over written in Enhancement.
Or can some1 please tell where I am going wrong?
Thanks & Regards,
Narendra.Hi Narendra,
Did you get a solution to this please?
Thks,
William -
Code causing exceptions at its own sweet time and place
import java.lang.*;
class newthread implements Runnable
Thread t;
int click=0;
public volatile boolean running=true;
newthread(int p)
t=new Thread(this);
t.setPriority(p);
void start()
t.start();
public void run()
while(running)
click++;
void start1()
running=true;
void stop()
running=false;
class threadpriority2
public static void main(String argv[])
newthread ob1=new newthread(Thread.NORM_PRIORITY+2);
newthread ob2=new newthread(Thread.NORM_PRIORITY-2);
ob1.start();
ob2.start();
try
Thread.sleep(5000);
catch(Exception e)
System.out.println("error detected:"+e);
System.out.println("first one:"+ob1.click);
System.out.println("first one:"+ob2.click);
System.out.println("the priority of ob1 is:"+ob1.t.getPriority());
System.out.println("the priority of ob2 is:"+ob2.t.getPriority());
ob1.stop();
ob2.stop();
ob2.t.setPriority(Thread.NORM_PRIORITY+3);
ob1.t.setPriority(Thread.NORM_PRIORITY-3);
ob1.start1();
ob2.start1();
ob1.start();
ob2.start();
System.out.println("the priority of ob1 is:"+ob1.t.getPriority());
System.out.println("the priority of ob2 is:"+ob2.t.getPriority());
try
Thread.sleep(5000);
catch(Exception e)
System.out.println("error detected:"+e);
ob1.stop();
ob2.stop();
System.out.println("first one:"+ob1.click);
System.out.println("first one:"+ob2.click);
errors during runtime:
Exception in thread "main" java.lang.IllegalThreadStateException
at java.lang.Thread.start(Unknown Source)
at newthread.start(threadpriority2.java:17)
at threadpriority2.main(threadpriority2.java:77)
when i run this code it causes exceptions at its own sweet locations when i run it separately.if once it displays some valid input it would then be followed by the exception
next time if i run it it will throw exception as soon as i run it at the very start without displaying even an iota of valid data like the previous case
is ti because the os is placing restrictions on the threads growth or something else.incase there is an error in my code it should atleast pop up the exceptions at one particular loaction in the output and not give different outputs1) When you post code, please use and tags as described in Formatting tips on the message entry page. It makes it much easier to read.
wasnt aware of it.will keep it in mind i post nexttime.sorry for the inconvenience[\b]
3) You have multiple threads, right? The scheduling of which thread gets how much CPU time when is not subject to your control or prediction, so of course you'll see different timings in subsequent runnings of the same code.[b]actually the problem is not with multiple threads showing different times.whats happening is that exceptions are being thrown randomly at runtime.once when i ran it the exception was displayed at the very beginning of the output and the program snapped.next when i ran it first some output which was slated to be displayed got displayed and then the exceptions appeared in the output.now if the exceptions are thrown at the very beginning its obvious theres some problem at the background coz in the second case that never happened[\b]
i guess the formatting tips have taken effect[:D] -
How to set causing Exception correctly?
I'm trying to nest exceptions. I've written a JUnit tests which does this, but while it works for simple nesting, it doesn't for my more complex Exception.
The following works:
Exception e1 = new Exception("bla");
Exception e2 = new Exception("whatever");
e1.initCause(e2);
Assert.assertEquals(e2, e1.getCause());
Exception e3 = new Exception("yet another exception");
e2.initCause(e3);
Assert.assertEquals(e3, e1.getCause().getCause());
Exception e4 = new Exception("yawn");
e3.initCause(e4);
Assert.assertEquals(e4, e1.getCause().getCause().getCause());The following doesn't:
* The exception to use when a Hibernate transaction can't be ended.
* The causes of this are created according to the given exceptions.
* If <code>exception</code> exists:
* <pre>
* this
* |
* +--> exception
* |
* +--> hibernateException1
* |
* +--> hibernateException2 (if it exists)
* </pre>
* If <code>exception</code> is <code>null</code>:
* <pre>
* this
* |
* +--> hibernateException1
* |
* +--> hibernateException2 (if it exists)
* </pre>
* @param errorMessage The error message to show
* @param exception The exception coming from the business process, which may be <code>null</code>
* @param hibernateException1 The first Hibernate exception, which <strong>must exist</strong>
* @param hibernateException2 The second Hibernate exception, which may be <code>null</code>
public RecoverableSystemException(String errorMessage, Exception exception, HibernateException hibernateException1, HibernateException hibernateException2) {
super(errorMessage, getCause(exception, hibernateException1, hibernateException2));
* Gets the causing exception for {@link #RecoverableSystemException(String, Exception, HibernateException, HibernateException)}.
* @param exception The exception coming from the business process, which may be <code>null</code>
* @param hibernateException1 The first Hibernate exception, which <strong>must exist</strong>
* @param hibernateException2 The second Hibernate exception, which may be <code>null</code>
* @return The causing exception to use for the constructor
private static Exception getCause(Exception exception, HibernateException hibernateException1, HibernateException hibernateException2) {
if (hibernateException2 != null && hibernateException1 != null) {
hibernateException1.initCause(hibernateException2);
if (exception == null) {
return hibernateException1;
else {
if (hibernateException1 != null) {
exception.initCause(hibernateException1);
return exception;
}with the test looking like this:
this.hibernateException1 = new HibernateException("h1");
this.hibernateException2 = new HibernateException("h2");
this.businessProcessException = new Exception("e1");
RecoverableSystemException recoverableSystemException = new RecoverableSystemException("Test", null, this.hibernateException1, this.hibernateException2);
Assert.assertEquals("Checking Hibernate exception 1", this.hibernateException1, recoverableSystemException.getCause());
// THIS FAILS
Assert.assertEquals("Checking Hibernate exception 2", this.hibernateException2, recoverableSystemException.getCause().getCause());Any help would be greatly appreciated!initCause is rarely if ever used. It is possible that the way HibernateException is written does not support the use of this call. Have a look at its source to find out if it does.
-
I need to know how to change my security questions cause I have forgotten them and would like to buy an app but cannot cause I need to answer the questions
The page that you’ve posted from has instructions for how to reset them i.e. if you have a rescue email address set up on your account then steps 1 to 5 half-way down that page should let you reset them.
If you don't have a rescue email address then you will need to contact iTunes Support / Apple to get the questions reset.
Contacting Apple about account security : http://support.apple.com/kb/HT5699
When they've been reset (and if you don't already have a rescue email address) you can then use the steps half-way down the HT5312 page that you posted from to add a rescue email address for potential future use -
JEditorPane PageLoader thread causing exceptions, not on EDT
Hello,
I have a swing GUI that creates a JEditorPane component and loads up an HTML file using the setPage() method to finally display it. I'm occaisionally getting NullPointerExceptions and ArrayIndexOutOfBoundsExceptions when running the GUI. It is apparent that the JEditor pane spawns a page loading process to load up the HTML. When the loading completes, this page loading thread signals the swing JEditorPane component to update its display. Because the signalling is being done from the pageloader thread and not from the EDT it seems to be creating race conditions and therefore the exceptions.
An example of the typical stacktrace thrown is:
Exception in thread "Thread-6" java.lang.NullPointerException
at javax.swing.text.CompositeView.replace(CompositeView.java:200)
at javax.swing.text.CompositeView.loadChildren(CompositeView.java:97)
at javax.swing.text.FlowView$LogicalView.loadChildren(FlowView.java:684)
at javax.swing.text.CompositeView.setParent(CompositeView.java:122)
at javax.swing.text.FlowView.loadChildren(FlowView.java:122)
at javax.swing.text.CompositeView.setParent(CompositeView.java:122)
at javax.swing.text.FlowView.setParent(FlowView.java:272)
at javax.swing.text.html.ParagraphView.setParent(ParagraphView.java:58)
at javax.swing.text.CompositeView.replace(CompositeView.java:200)
at javax.swing.text.BoxView.replace(BoxView.java:164)
at javax.swing.text.CompositeView.loadChildren(CompositeView.java:97)
at javax.swing.text.CompositeView.setParent(CompositeView.java:122)
at javax.swing.text.html.BlockView.setParent(BlockView.java:55)
at javax.swing.text.CompositeView.replace(CompositeView.java:200)
at javax.swing.text.BoxView.replace(BoxView.java:164)
at javax.swing.text.html.TableView$RowView.replace(TableView.java:1457)
at javax.swing.text.CompositeView.loadChildren(CompositeView.java:97)
at javax.swing.text.CompositeView.setParent(CompositeView.java:122)
at javax.swing.text.CompositeView.replace(CompositeView.java:200)
at javax.swing.text.BoxView.replace(BoxView.java:164)
at javax.swing.text.html.TableView.replace(TableView.java:896)
at javax.swing.text.CompositeView.loadChildren(CompositeView.java:97)
at javax.swing.text.CompositeView.setParent(CompositeView.java:122)
at javax.swing.text.html.TableView.setParent(TableView.java:800)
at javax.swing.text.CompositeView.replace(CompositeView.java:200)
at javax.swing.text.BoxView.replace(BoxView.java:164)
at javax.swing.text.CompositeView.loadChildren(CompositeView.java:97)
at javax.swing.text.CompositeView.setParent(CompositeView.java:122)
at javax.swing.text.html.BlockView.setParent(BlockView.java:55)
at javax.swing.text.html.HTMLEditorKit$HTMLFactory$BodyBlockView.setParent(HTMLEditorKit.java:1277)
at javax.swing.text.CompositeView.replace(CompositeView.java:200)
at javax.swing.text.BoxView.replace(BoxView.java:164)
at javax.swing.text.View.updateChildren(View.java:1095)
at javax.swing.text.View.insertUpdate(View.java:679)
at javax.swing.plaf.basic.BasicTextUI$RootView.insertUpdate(BasicTextUI.java:1590)
at javax.swing.plaf.basic.BasicTextUI$UpdateHandler.insertUpdate(BasicTextUI.java:1849)
at javax.swing.text.AbstractDocument.fireInsertUpdate(AbstractDocument.java:185)
at javax.swing.text.DefaultStyledDocument.create(DefaultStyledDocument.java:145)
at javax.swing.text.html.HTMLDocument.create(HTMLDocument.java:281)
at javax.swing.text.html.HTMLDocument$HTMLReader.flushBuffer(HTMLDocument.java:3323)
at javax.swing.text.html.HTMLDocument$HTMLReader.flush(HTMLDocument.java:2127)
at javax.swing.text.html.HTMLEditorKit.read(HTMLEditorKit.java:231)
at javax.swing.JEditorPane.read(JEditorPane.java:557)
at javax.swing.JEditorPane.read(JEditorPane.java:585)
at javax.swing.JEditorPane$PageLoader.run(JEditorPane.java:648) As can be seen from the stack trace, the javax.swing.text.AbstractDocument.fireInsertUpdate(AbstractDocument.java:185) line is called from the PageLoader.run thread which attempts to manipulate the swing component.
I haven't prepared a small compact test case for this yet as it is a race condition and only occurs under certain timings. The GUI on my machine throws these exceptions on almost every second run but far less frequently on another test machine.
I'm using Java 6 u 13 b 3 in linux ubuntu Jaunty.
Is there a way to load the page synchronously or to correctly load the page without causing these exceptions?
Thanks,
Mark
Edited by: Mark_Silberbauer on Jun 9, 2009 11:30 AMI would try to create a HTMLDocument instance and read content there by the kit you use. When the document's filling is finished just call editorPane.setDocument() in EDT.
Regards,
Stas -
Why jsp page cause exceptions in J2EE App. Server
I installed j2ee App Server on my Windows 2000, wrote a simple .jsp, moved the code to domains\domain1\docroot, ran the .jsp from the browser and saw the following exception. I could not find the directory common/lib for my Tomcat server. Please instruct.
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP
No Java compiler was found to compile the generated source for the JSP.
This can usually be solved by copying manually $JAVA_HOME/lib/tools.jar from the JDK
to the common/lib directory of the Tomcat server, followed by a Tomcat restart.
If using an alternate Java compiler, please check its installation and access path.
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:132)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:356)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:420)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:463)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:444)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:557)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:305)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:306)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:253)
javax.servlet.http.HttpServlet.service(HttpServlet.java:861)
sun.reflect.GeneratedMethodAccessor71.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:324)
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:289)
java.security.AccessController.doPrivileged(Native Method)
javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:311)
org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:205)
****************************************************************************************************************This is a known issue.
The error message about the missing Java compiler is very misleading, and
is being caused by a bug in the way compilation error messages are
being propagated.
Following is a detailed explanation of the behaviour you are seeing:
The misleading error message is printed only in the case where a javac
compilation error line number cannot be mapped back to a line number
in the JSP source code.
The internal representation of a JSP element ("JSP node") in the JSP compiler
contains the following info:
- The begin line number of the JSP element in the JSP page
- The begin and end line numbers ("range") of the Java code that was
generated for the JSP element
When attempting to map a javac error line number back to the JSP
source line, we determine the range into which the javac error line
number falls, and retrieve the JSP source number of the JSP element
associated with that range.
However, in some cases, it is impossible to trace a javac error line
number back to the JSP element that caused the error. For example,
consider the following scriptlet:
<%
String query = request.getParameter("query");
if(query != null) {
out.println(query);
} else {
out.println("(null)");
// } // <-- !Missing brace syntax error
%>
Since the JSP compiler wraps the generated code into a
try-catch-finally block, the above syntax error in the scriptlet
causes havoc with that try-catch-finally block, and results in 3 javac
errors:
<file>jsp.java:<line1>: 'catch' without 'try'
} catch (Throwable t) {
^
<file>jsp.java:<line2>: 'try' without 'catch' or 'finally'
try {
^
<file>jsp.java:<line3>: '}' expected
Notice that all of the above javac error numbers are outside the range
of the java line numbers corresponding to the scriptlet that caused the
error, and therefore cannot be mapped back to any line numbers in the
JSP page source.
AS 8.0 PE does not handle this case correctly, and prints out the
misleading error message (though the real error message can be found
in the server log).
Notice that this problem is going to be fixed in AS 8.1, so that if a
javac error line number cannot be mapped back to a JSP page line
number, the javac error is still returned to the client.
As far as your particular JSP page is concerned, I don't see anything
wrong with it, and it compiles just fine for me.
Do you still have any problems with it?
Jan -
SO Wait causes exception occurred within external code called by call library node
when trying to run some old code that used to work ok, i now get this error message:
exception occurred within external code called by call library node
and the vi flagged as calling the exception is SO Wait. the error occurs with different soundcards. does anyone know what is causing this problem?Hi Kreuters
It sounds as if you have a case of memory corruption. Which version of LabVIEW and DAQ (traditonal or DAQmx) are you running and also on which operating system?
would it be possible for you to post your VI on this thread? in some cases there are ways to fix the problem
Regards
YatinM
NIUK -
Some Search Admin Pages Causing Exception 0x80131904
I have a SharePoint 2013 Farm with multiple servers, though most applications, services and sites currently run on the main Front-End system.
I have been tasked with re-building the Search Architecture, so as to distribute search components across some of the other servers. During this process, I have been reviewing & documenting the current Search configuration. However, I keep
running into an error on several of the Search Admin pages. I am able to navigate to the "Search Service Application: Search Administration" page, which shows that everything appears healthy under both 'System Status' and 'Search Application
Topology'
However, I receive a "Sorry, something went wrong" error message, with "Exception from HRESULT: 0x80131904" page when I click on any of the following links: "Crawl Log", "Crawl Health Reports", or "Content
Sources."
All the other Quick Links in the Search Administration page appear to work fine. But other than a "Correlation ID" that I do not know how to use, I can find no other information about this error or how to diagnose it further.
Anyone know how I can restore access to these Search Administration pages?
Thanks in advance,
ElohirHi Elohir,
You can use the Correlation ID to find more detailed information in logging file, the path of the file is : C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\LOGS .
Also , you can see the logging file through Event Viewer (typing Event Viewer in ‘run’).
0x80131904 is generally happened from SQL Server side. It may be caused by tempdb or Content Database is out of space.
In addition, here are some similar posts for you to take a look at:
http://social.technet.microsoft.com/Forums/en-US/62ed2e1f-1d2c-46b2-9a64-ba6b2d65dfdf/exception-from-hresult-0x80131904-in-sharepoint-2013-default-page?forum=sharepointadmin
http://social.technet.microsoft.com/Forums/en-US/66e600ef-4b40-48a3-bd66-3de8b10e01ba/exception-from-hresult-0x80131904-sharepoint-2010-central-admin?forum=sharepointadminprevious
http://vbthineshkumar.blogspot.in/2011/11/sql-express-database-full-error-in.html
http://johanolivier.blogspot.in/2011/04/resolve-sharepoint-errors-caused-by-sql.html
I hope this helps.
Thanks,
Wendy
Wendy Li
TechNet Community Support -
If a SharePoint farm solution is deployed using Sever Object Model or PowerShell calling the SPDiagnosticsServiceBase.GetLocal in the SPFeatureReceiver.FeatureInstalled code causes an exception:
The installation of features failed during deployment of the solution.
CAS_SP : Configsetting with key 'CAS.SharePoint.Common.TypeMappings' could not be set 'CAS.SharePoint.Common.ServiceLocation.ServiceLocationConfigData' with type 'CAS.SharePoint.Common.ServiceLocation.ServiceLocationConfigData'. The technical exception was: CAS.SharePoint.Common.Logging.LoggingException: One or more error occurred while writing messages into the log.\r\nThe error while writing to the EventLog was:An exception has occurred.
ExceptionType: 'SPDuplicateObjectException'
ExceptionMessage: 'An object of the type CAS.SharePoint.Common.Logging.DiagnosticsService named "" already exists under the parent Microsoft.SharePoint.Administration.SPFarm named "SharePoint_Config_c8ae0268-40ff-4bea-82f0-eddcd464e806". Rename your object or delete the existing object.'
StackTrace: ' at Microsoft.SharePoint.Administration.SPConfigurationDatabase.StoreObject(SPPersistedObject obj, Boolean storeClassIfNecessary, Boolean ensure)
at Microsoft.SharePoint.Administration.SPConfigurationDatabase.Microsoft.SharePoint.Administration.ISPPersistedStoreProvider.PutObject(SPPersistedObject persistedObject, Boolean ensure)
at Microsoft.SharePoint.Administration.SPPersistedObject.BaseUpdate()
at Microsoft.SharePoint.Administration.SPDiagnosticsServiceBase.Update()
at Microsoft.SharePoint.Administration.SPDiagnosticsServiceBase.GetLocalToFarm[T](SPFarm farm)
at Microsoft.SharePoint.Administration.SPDiagnosticsServiceBase.GetLocal[T]()
at CAS.SharePoint.Common.Logging.TraceLogger.Trace(String message, Int32 eventId, TraceSeverity severity, String category)
at CAS.SharePoint.Common.Logging.SharePointLogger.WriteToDeveloperTrace(String message, Int32 eventId,
The same solution deployed using Central Administration tool works fine. The code also works fine while executing it from command line application.
I have reproduced this problem on two SharePoint Servers and one Foundation instance.
It seems as a SharePoint bug, but is there any workaround you know? How to report it to the SharePoint developers team ?
MariuszThe farms that you are doing this on, are they multiserver farms (multiple wfes), or have you repro'd on a single server farm? It almost seems as though some config cache is having a problem, or psconfig is clashing with itself (if it involves multiple
servers). -
NAM 3.2 external attribute source policy cause Exception
I tried to use the example in NAM SDK for External Attribute Source
policy, the package is downloaded here:
http://tinyurl.com/4uvb8rp
After following the instruction to enable the policy in IDP, the update
failed, I looked at the log file and found this exception during start:
java.lang.InstantiationException
There is no further information or exception stack trace in the log.
Have any one done this successfully? Any idea what may cause this
problem? I didn't notice that the java class in the examples don't have
default constructor, I tried adding one that cause a different
exception.
Any help is appreciated.
Thanks
Mark
mxu1386
mxu1386's Profile: https://forums.netiq.com/member.php?userid=1361
View this thread: https://forums.netiq.com/showthread.php?t=50412This is solved, I used wrong class name, should use the factory class.
Thanks
Mark
mxu1386
mxu1386's Profile: https://forums.netiq.com/member.php?userid=1361
View this thread: https://forums.netiq.com/showthread.php?t=50412 -
Dynamic JNLP causes exception on 1st run after java install
I have a dynamic JNLP file (php) which runs my software. It works just fine, except for the 1st time it is run after a user has installed Java.
I get the exception; "The following field was missing from the jnlp file: <jnlp>". When I look at the jnlp code in JWS in the "Launch File" tab of the error message, I see that the JNLP is not there - but the page the user would see if he was not logged into the system (as if JWS has cached the file or something).
If I close it down, press F5 to refresh, and run it again everything works fine.
I'm running the dyanmic.jnlp?dummy=randomnumber943934 to prevent caching. In addition, these headers are sent: (php code)
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
// HTTP/1.1
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
// HTTP/1.0
header("Pragma: no-cache");.. so nothing should be cached. But I'm not sure that's where the problem is - cause it only happens the first time after a java install.
Any clues?I think you're dynamicallt created jnlp is invalid in someway; I can use the following without any problems:
<?php
header("Content-type: application/x-java-jnlp-file");
echo "<?xml version=\"1.0\" ?>\n";
$codebase = trim(stripslashes(urldecode($_REQUEST["codebase"])));
$href = trim(stripslashes(urldecode($_REQUEST["href"])));
echo "<jnlp spec=\"1.0+\" codebase=\"$codebase\" href=\"$href\">\n";
?>
</jnlp>
you should try and test the output of your generated code, something like this should work:
test.php
<html>
<body>
<textarea rows=20 cols=70>
<?php
include 'mydynamicscript.php';
?>
</textarea>
</body>
</html>
The first time a jnlp is called it is downloaded into the browser cache and javaws.exe is executed on it from that location, this in turn downloads the jnlp again from the passed codebase & href attributes into the jws cache. Subsequent calls the jnlp are extracted from the copy in the webstart cache, and often downloaded from the codebase & href attributes when it detects possible changes. In your case these jnlp files seem to differ.
- Richard -
BUG: Importing m3u file (playlist) causes exception and crash
iTunes version 7.1.1.5, Windows XP.
iTunes crashes with exception on attempt to import m3u playlist in which one of the lines was 234 characters. Does not crash when the line is removed. Suspect this is a buffer overflow.
How do you go about submitting a bug report to Apple (including the file that caused the problem and the core dump)?
Windows XP ProiTunes version 7.1.1.5, Windows XP.
iTunes crashes with exception on attempt to import m3u playlist in which one of the lines was 234 characters. Does not crash when the line is removed. Suspect this is a buffer overflow.
How do you go about submitting a bug report to Apple (including the file that caused the problem and the core dump)?
Windows XP Pro -
Hi,
I'm trying to add a value to the project custom field. After that I'm calling the checkout function before the queueupdate and queuepublish. While calling the checkout the program is throwing exception as follow:
The exception is as follows: ProjectServerError(s) LastError=CICOCheckedOutToOtherUser Instructions: Pass this into PSClientError constructor to access all error information
Please help me to resolve this issue. I have also tried the ReaProjectentity method i nthe PSI service inrodr to find that project is checked out or not . Still the issue is remains . Anyone please help me for this
flagCheckout = IsProjectCheckedOut(myProjectId);
if (!flagCheckout)
eventLog.WriteEntry("Inside the updatedata== true and value of the checkout is " + flagCheckout);
projectClient.CheckOutProject(myProjectId, sessionId, "custom field update checkout");
Regards,
SabithaStandard Information:PSI Entry Point:
Project User: Service account
Correlation Id: 7ded1694-35d9-487d-bc1b-c2e8557a2170
PWA Site URL: httpservername.name/PWA
SSP Name: Project Server Service Application
PSError: GeneralQueueCorrelationBlocked (26005)
Operation could not completed since the Queue Correlated Job Group is blocked. Correlated Job Group ID is: a9dda7f4-fc78-4b6f-ace6-13dddcf784c5. The job ID of the affected job is: 7768f60d-5fe8-4184-b80d-cbab271e38e1. The job type of the affected job is:
ProjectCheckIn. You can recover from the situation by unblocking or cancelling the blocked job. To do that, go to PWA, navigate to 'Server Settings -> Manage Queue Jobs', go to 'Filter Type' section, choose 'By ID', enter the 'Job Group ID' mentioned in
this error and click the 'Refresh Status' button at the bottom of the page. In the resulting set of jobs, click on the 'Error' column link to see more details about why the job has failed and blocked the Correlated Job Group. For more troubleshooting you can
look at the trace log also. Once you have corrected the cause of the error, select the affected job and click on the 'Retry Jobs' or 'Cancel Jobs' button at the bottom of the page.
This is the error I'm getting now while currently calling the forcehckin, checkout and update. Earlier it was not logging any errors.From this I'm not able to resolve as i cannot filter with job guid
Maybe you are looking for
-
No help from Apple..I have a Windows XP 2002 32bit with service pack 2 and 3..Apple removed my old itunes because i couldn't up date.However they could not down the new verison after trying several times... error mgs reads er
-
There is no address line to put any web site addresses
I have down loaded Fire Fox so many times and each time there is no address line to place any web site addresses. I have a laptop using windows 7
-
Power Adapter alternatives?
Rather than paying $30 for a power adapter for a 5th G 30gb video Ipod, what other non-apple adapters would work with this? I've seen several on Ebay, but I want to make sure they're compatible with the 30gb video Ipod. Anybody use one?
-
IPad Mini and Exchange Issues Using Google 2-step Verification
I cannot get my gmail email, contacts, or calendar to sync with my iPad Mini, and nothing seems to work. I've set it up with Microsoft exchange using all the proper settings of m.google.com and the app specific password from my account, but to no ava
-
Fotoplayer and JAlbum/online galleries on iWeb '08?
I am wanting to set up online photo galleries for clients (weddings in particular), so they can see and buy pictures online. Does anybody know if Fotoplayer (which flash albums and requires the server to support PHP script), and JAlbum can work on a