T cast(Object obj)
Hi,
What is the actual use of this method T cast(Object obj) that "casts an object to the class or interface represented by this Class object." ?
If we pass the class token as a parameter then we already know what type it is and this seems to be the only way to to determine the concrete type at runtime. How is this method used ?
Thanks,
Mohan
Class.cast helps you avoid an "Unchecked" warning. That's about all there is to it. Example:
import java.util.HashMap;
import java.util.Map;
public abstract class Factory<T> {
public abstract T newInstance();
public static <TT> TT createObject(Class<TT> clazz) {
Factory<?> factory = factories.get(clazz);
if(factory == null)
throw new IllegalArgumentException("invalid class "+clazz.getName());
return (TT)factory.newInstance(); // Unchecked warning
public static <TT> void registerFactory(Class<TT> clazz, Factory<? extends TT> factory) {
factories.put(clazz, factory);
private static final Map<Class<?>, Factory<?>> factories = new HashMap<Class<?>, Factory<?>>();
}The line with the comment will trigger an "Unchecked" warning, which could be avoided by using
return clazz.cast(factory.newInstance());
Similar Messages
-
I have some Oracle Tables with sequences for primary key and stored procs in packages to wrap up the insert commands. The sequences field are all declared as NUMBER.
I also have Datasets based on the tables and a DataAdapter for each package. The Datasets see the primary keys as System.Decimal. The DataAdapter sees the output primary key parameter to the stored procs as OracleDecimal.
tmp.Parameters.Add(new OracleParameter("P_ID", Oracle.DataAccess.Client.OracleDbType.Decimal, ParameterDirection.Output));
tmp.Parameters["P_ID"].SourceColumn = "ID";
When I call the Update on the DataAdapter the update happens on the DB and then I get the following error
System.ArgumentException : Unable to cast object of type 'Oracle.DataAccess.Types.OracleDecimal' to type 'System.IConvertible'.Couldn't store <231> in ID Column. Expected type is Decimal.
----> System.InvalidCastException : Unable to cast object of type 'Oracle.DataAccess.Types.OracleDecimal' to type 'System.IConvertible'.
If I change the Oracle parameter to Oracle.DataAccess.Client.OracleDbType.Int32 or Oracle.DataAccess.Client.OracleDbType.Int64 it works fine - any ideas why that would be ? I would expect System.Decimal to map to Oracle.DataAccess.Types.OracleDecimal.Hi,
If I change the Oracle parameter to Oracle.DataAccess.Client.OracleDbType.Int32 or Oracle.DataAccess.Client.OracleDbType.Int64 it works fine - any ideas why that would be ? I would expect System.Decimal to map to Oracle.DataAccess.Types.OracleDecimal.
I'm trying to do the same, but no matter what I do, I get the OracleDecimal error. Parameter is defined as:
bq. this._adapter.InsertCommand = new global::Oracle.DataAccess.Client.OracleCommand(); \\ this._adapter.InsertCommand.Connection = this.Connection; \\ this._adapter.InsertCommand.CommandText = "INSERT INTO PERSON\r\n (ID, SURNAME, NAME, BIRTHCITY, EMSO)\r\nV" + \\ +"ALUES (:ID, :SURNAME, :NAME, :BIRTHCITY, :EMSO) RETURNING ID INTO :ID";+ \\ this._adapter.InsertCommand.CommandType = global::System.Data.CommandType.Text; \\ param = new global::Oracle.DataAccess.Client.OracleParameter(); \\ param.ParameterName = "ID"; \\ param.DbType = global::System.Data.DbType.Int32; \\ param.OracleDbType = global::Oracle.DataAccess.Client.OracleDbType.Int32; \\ param.Direction = global::System.Data.ParameterDirection.Output; \\ param.IsNullable = true; \\ param.SourceColumn = "ID"; \\ this._adapter.InsertCommand.Parameters.Add(param);
But no luck... -
Unable to cast object of type OracleXmlType to type XmlDocument
Hello All:
I have an Oracle Procedure that is taking an XML Document as an output parameter.
oCommand.Parameters.Add("errorrecord", OracleDbType.XmlType).Value = System.DBNull.Value;
oCommand.Parameters["errorrecord"].Direction = System.Data.ParameterDirection.Output;
When I try to cast this as an XmlDocument so I can set it to my ErrorRecord variable (defined as XmlDocument) and pass it back out of the Web-Service
ErrorRecord = (XmlDocument)oCommand.Parameters["p_errorrecord"].Value;
I get the following error: "Unable to cast object of type 'Oracle.DataAccess.Types.OracleXmlType' to type 'System.Xml.XmlDocument'"
How do I cast / convert the Oracle XMLType back to a .Net XMLDocument to pass out of the function?
ThanksNo, I have not tried that yet, but I admit I don't fully understand the syntax in the document posted.
oCommand.Parameters.Add("p_errorrecord", OracleDbType.XmlType).Value = System.DBNull.Value;
ErrorRecord = GoCommand.Parameters["errorrecord"].Value; (this is returned as XmlType)
I don't quite understand the syntax in the posted URL:
Declaration
// C#
public XmlDocument GetXmlDocument();
How am I to use this to get the XMLDocument? -
Unable to cast object of type InfoObject to DestinationPlugin
I have created a web application to show the list of scheduled reports and with their destination Info using Business objects sdk. Locally on my computer i am able to show all the reports and the Ftp information. But when i move this application to QA server the application returns an error with a message.
"Unable to cast object of type 'CrystalDecisions.Enterprise.InfoObject' to type 'CrystalDecisions.Enterprise.DestinationPlugin"
I have noticed that the returned type of Object by the query on QA server is of type "InfoObject" and on localbox "CrystalDecisions.Enterprise.Dest.Ftp"
Query
Select * from ci_systemobjects where SI_NAME= ''", "CrystalEnterprise.Ftp"
Assemblies required by application are registered in the GAC with same version and same public token
Please let me know if anyone has a answer for this casting exception.Snippet:
Dim ftp As New Ftp(infoObject.PluginInterface)
Dim ftpOptions As New FtpOptions(ftp.ScheduleOptions)
You wouldn't be doing a direct runtime cast.
Sincerely,
Ted Ueda -
Hi All,
We just migrated from BPC 5.1 to BPC 7.0 SP6. But when we want to run a package in the data manager we get the following error:
Exception Text **************
System.InvalidCastException: Unable to cast object of type 'System.Xml.XmlText' to type 'System.Xml.XmlElement'.
at OSoft.Consumers.DataMgr.PackageModify50.PackageDetail.LoadDetail(String strXMLString)
at OSoft.Consumers.DataMgr.PackageModify50.PackageDetail.GetPackageDetailfromServer(String strPackageName, String strPackageFilePath, String strTeamID)
at OSoft.Consumers.DataMgr.PackageModify50.frmMain.PackageListClickEvent(String strPackageID, String strPackageFileName, String strTeamID)
at OSoft.Consumers.DataMgr.PackageModify50.frmMain.SetStartUp()
at OSoft.Consumers.DataMgr.PackageModify50.frmMain.frmMain_Load(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Any idea?
Br
StevenHi,
If you were running 5.1 version, that would also mean that you were running packages under SQL 2005.
And if you are now running SQL 2008 with BPC 7.0, you should also review all your customized packages. In fact, BPC tasks in SSIS are not the same between SQL 2005 and SQL 2008.
In addition, I would recommend to upgrade your SQL server version to SQL 2008 SP1 cumulative update package 6 (prerequisite). Not sure if you're still running this CU.
Hope this will help.
Best Regards,
Patrick -
Unable to cast object of type 'Microsoft.Xrm.Sdk.Entity' to type
when I using below code :
using (ServiceContext svcContext = new ServiceContext(service))
var creditNote = svcContext.new_credit_noteSet.Where(c => c.new_credit_noteId == cnid).FirstOrDefault();
got this error:
System.InvalidCastException: Unable to cast object of type 'Microsoft.Xrm.Sdk.Entity' to type 'TCT.CRM.Model.new_credit_note'.
at System.Linq.Enumerable.<CastIterator>d__b1`1.MoveNext()
at Microsoft.Xrm.Sdk.Linq.PagedItemCollection`1.MoveNext()
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
at System.Linq.Queryable.FirstOrDefault[TSource](IQueryable`1 source)
at HP.Crm2013.Plugins.ServiceManage.sm_credit_note_update_post.CalculateTotalAmount(IOrganizationService service, Guid cnid)
at HP.Crm2013.Plugins.ServiceManage.sm_credit_note_update_post.Execute(IServiceProvider serviceProvider)
any help?
AwenHi Awen,
This kind of error usualy occur if we dont have enable proxytype for the CRM service.
Add the below line in your code after creating the service proxy and check :
_serviceProxy.EnableProxyTypes();
Thanks,
Seban -
same code worked fine under Support Pack 8 (v. 13.0.8.1216).
When we upgraded to newest service pack 13, we started getting an error Unable to cast object of type 'FileStreamDeleteOnClose' to type 'System.IO.MemoryStream'
Dim rpt As New MemoryStream()
Using ProfileRpt As New test.CrystalReport()
ProfileRpt.SetDataSource(ds)
rpt = DirectCast(ProfileRpt.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat), MemoryStream)
End Using
similar as
http://scn.sap.com/thread/3714796
http://scn.sap.com/thread/2020974
http://scn.sap.com/thread/3283915
http://scn.sap.com/thread/3680358Same answer, we never supported MemoryStream, convert to IO.Stream then it should work.
http://scn.sap.com/thread/3322762 -
Unable to cast object of type ?
Hi ,
i try to compile sample aspx page using plugin but it throws the error
Unable to cast object of type 'asp.catalog_sample_aspx' to type 'netpoint.classes.NPbasepage'
why this type error shows?
pls guide me.here is an example of a page that inherits NPBasePage.
<%@ Page Language="C#" MasterPageFile="~/masters/common.master" Inherits="netpoint.classes.NPBasePage" %>
<%@ Import Namespace="netpoint.classes" %>
<%@ Import Namespace="netpoint.api.account" %>
<asp:Content ContentPlaceHolderID="mainslot" runat="server" ID="main">
<asp:PlaceHolder ID="phMainSlot" runat="server">
<scrip t language="c#" runat="server">
protected void Page_Load(object sender, System.EventArgs e)
NPBasePage bp = (NPBasePage)Page;
NPUser u = new NPUser(bp.UserID);
txtBox.Text = u.FirstName + " " + u.LastName;
</script>
<div>
<asp:TextBox ID="txtBox" runat="server"></asp:TextBox>
</div>
</asp:PlaceHolder>
</asp:Content> -
Unable to cast object of type infostore to type report
Hi all,
Does anyone know what causes the message:-
system.invalidcastexception: unable to cast object of type 'crystaldecisions.enterprise.infoobject' to type 'crystaldecisions.desktop.report'
Everything works perfectly in my development environment but as soon as I try to put the code live I get the error.
it is happening in the following lines of code:-
Dim CEinfoObjects As InfoObjects
Dim CEReport As Report
Dim CEParameters As ReportParameters
Dim CEParameter As ReportParameter
CE_SQL = "SELECT SI_PROCESSINFO.SI_PROMPTS "
CE_SQL += "FROM CI_INFOOBJECTS "
CE_SQL += "WHERE SI_ID = " & ReportID
CEReports = ceInfoStore.Query(CE_SQL)
CEReport = CEinfoObjects(1)
CEParameters = CEReport.ReportParameters
I tried changing the ceReport type to an InfoObject type and the system then fails trying to get the parameters. (ReportParameters is not a member of InfoObject)
The only differences I can see is that my dev machine has Crystal XI SP4, Crystal 2008 SP0 and Crystal Server XI SP4 installed while the live environment only has Crystal XI SP4.
I tried installing the 2008 runtime to see if that would make a difference but it has not.
I tried reinstalling the XI runtime but it has not worked either.
Is there something that needs to be changed on the enterprise server? This is also running on XI SP4 and the files match the dates and times on my dev machine.
Any help or pointers would be appreciated.' Add the Scheduling Information
' 0-0 Once, Now
' 0-1 Once, At a specific time
' 1-0 Daily, Once each day
' 1-1 Daily, Every X hours and N minutes
' 1-2 Daily, Every X days
' 2-0 Weekly, Every week on
' 3-0 Monthly, On the Nth day of the month
' 3-1 Monthly, On the Nth X of the month
' 3-2 Monthly, Every N months
Select Case ScheduleRow("RecurrenceType").ToString
Case 0
Select Case ScheduleRow("RecurrencePattern").ToString
Case 0
ceScheduleInfo.Type = CeScheduleType.ceScheduleTypeOnce
ceScheduleInfo.RightNow = True
Case 1
ceScheduleInfo.Type = CeScheduleType.ceScheduleTypeOnce
ceScheduleInfo.RightNow = False
ceScheduleInfo.BeginDate = ScheduleRow("StartDate").ToString
End Select
Case 1
Select Case ScheduleRow("RecurrencePattern").ToString
Case 0
ceScheduleInfo.Type = CeScheduleType.ceScheduleTypeDaily
ceScheduleInfo.RightNow = False
ceScheduleInfo.BeginDate = ScheduleRow("StartDate").ToString
ceScheduleInfo.EndDate = ScheduleRow("EndDate").ToString
Case 1
ceScheduleInfo.Type = CeScheduleType.ceScheduleTypeHourly
ceScheduleInfo.RightNow = False
ceScheduleInfo.BeginDate = ScheduleRow("StartDate").ToString
ceScheduleInfo.EndDate = ScheduleRow("EndDate").ToString
ceScheduleInfo.IntervalHours = ScheduleRow("X_Hours").ToString
ceScheduleInfo.IntervalMinutes = ScheduleRow("N_Minutes").ToString
Case 2
ceScheduleInfo.Type = CeScheduleType.ceScheduleTypeDaily
ceScheduleInfo.RightNow = False
ceScheduleInfo.BeginDate = ScheduleRow("StartDate").ToString
ceScheduleInfo.EndDate = ScheduleRow("EndDate").ToString
ceScheduleInfo.IntervalDays = ScheduleRow("X_Days").ToString
End Select
Case 2
ceScheduleInfo.Type = CeScheduleType.ceScheduleTypeCalendar
ceScheduleInfo.RightNow = False
ceScheduleInfo.BeginDate = ScheduleRow("StartDate").ToString
ceScheduleInfo.EndDate = ScheduleRow("EndDate").ToString
If ScheduleRow("Monday").ToString = True Then
ceScheduleInfo.CalendarRunDays.Add(CDate(ScheduleRow("StartDate").ToString).Day, _
CDate(ScheduleRow("StartDate").ToString).Month, _
CDate(ScheduleRow("StartDate").ToString).Year, _
CDate(ScheduleRow("EndDate").ToString).Day, _
CDate(ScheduleRow("EndDate").ToString).Month, _
CDate(ScheduleRow("EndDate").ToString).Year, _
CeDayOfWeek.ceDayMonday, 0)
End If
If ScheduleRow("Tuesday").ToString = True Then
ceScheduleInfo.CalendarRunDays.Add(CDate(ScheduleRow("StartDate").ToString).Day, _
CDate(ScheduleRow("StartDate").ToString).Month, _
CDate(ScheduleRow("StartDate").ToString).Year, _
CDate(ScheduleRow("EndDate").ToString).Day, _
CDate(ScheduleRow("EndDate").ToString).Month, _
CDate(ScheduleRow("EndDate").ToString).Year, _
CeDayOfWeek.ceDayTuesday, 0)
End If
If ScheduleRow("Wednesday").ToString = True Then
ceScheduleInfo.CalendarRunDays.Add(CDate(ScheduleRow("StartDate").ToString).Day, _
CDate(ScheduleRow("StartDate").ToString).Month, _
CDate(ScheduleRow("StartDate").ToString).Year, _
CDate(ScheduleRow("EndDate").ToString).Day, _
CDate(ScheduleRow("EndDate").ToString).Month, _
CDate(ScheduleRow("EndDate").ToString).Year, _
CeDayOfWeek.ceDayWednesday, 0)
End If
If ScheduleRow("Thursday").ToString = True Then
ceScheduleInfo.CalendarRunDays.Add(CDate(ScheduleRow("StartDate").ToString).Day, _
CDate(ScheduleRow("StartDate").ToString).Month, _
CDate(ScheduleRow("StartDate").ToString).Year, _
CDate(ScheduleRow("EndDate").ToString).Day, _
CDate(ScheduleRow("EndDate").ToString).Month, _
CDate(ScheduleRow("EndDate").ToString).Year, _
CeDayOfWeek.ceDayThursday, 0)
End If
If ScheduleRow("Friday").ToString = True Then
ceScheduleInfo.CalendarRunDays.Add(CDate(ScheduleRow("StartDate").ToString).Day, _
CDate(ScheduleRow("StartDate").ToString).Month, _
CDate(ScheduleRow("StartDate").ToString).Year, _
CDate(ScheduleRow("EndDate").ToString).Day, _
CDate(ScheduleRow("EndDate").ToString).Month, _
CDate(ScheduleRow("EndDate").ToString).Year, _
CeDayOfWeek.ceDayFriday, 0)
End If
If ScheduleRow("Saturday").ToString = True Then
ceScheduleInfo.CalendarRunDays.Add(CDate(ScheduleRow("StartDate").ToString).Day, _
CDate(ScheduleRow("StartDate").ToString).Month, _
CDate(ScheduleRow("StartDate").ToString).Year, _
CDate(ScheduleRow("EndDate").ToString).Day, _
CDate(ScheduleRow("EndDate").ToString).Month, _
CDate(ScheduleRow("EndDate").ToString).Year, _
CeDayOfWeek.ceDaySaturday, 0)
End If
If ScheduleRow("Sunday").ToString = True Then
ceScheduleInfo.CalendarRunDays.Add(CDate(ScheduleRow("StartDate").ToString).Day, _
CDate(ScheduleRow("StartDate").ToString).Month, _
CDate(ScheduleRow("StartDate").ToString).Year, _
CDate(ScheduleRow("EndDate").ToString).Day, _
CDate(ScheduleRow("EndDate").ToString).Month, _
CDate(ScheduleRow("EndDate").ToString).Year, _
CeDayOfWeek.ceDaySunday, 0)
End If -
Unable to cast object of type 'System.DBNull' to type 'System.String'.
Hi,
I am getting Below error:
Unable to cast object of type 'System.DBNull' to type 'System.String'.Hello,
Please confirm whether you are using sharepoint or not. If you are getting this error in sharepoint then Could you share your code with us? and also tell where you are getting this error.
Hemendra:Yesterday is just a memory,Tomorrow we may never see
Please remember to mark the replies as answers if they help and unmark them if they provide no help -
UNABLE TO CAST OBJECT OF TYPE 'PROFILECOMMON' TO TYPE 'PROFILECOMMON'
I have four web application configured on the IIS with .Net Framework 2.0
All the applications are working fine except one.
If the system / server, restarted. The Application throws an error message "UNABLE TO CAST OBJECT OF TYPE 'PROFILECOMMON' TO TYPE 'PROFILECOMMON'"
When I searched for the issue, they have mentioned that the temporary
Profile class clashes with your ProfileCommon class.
By setting <profile enabled="false"> you are telling it to NOT generate the dynamic, temporary Profile
class and use your own instead.
On every restart, I need to change the attribute value to make it work.
Can you please let me know, why it crashed on server restart? How it can be resolved ?
Root cause???
Please help on this.
MJ - Man of Joy (Rajkumar) Techno GeekHello,
Try located at c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\<your app name>\87f549dc\aa62540\Sources_App_Code\profile.cdcab7d2.cs
This temporary Profile class clashes with your ProfileCommon class. By setting <profile enabled="false"> you are telling it to NOT generate the dynamic, temporary Profile class and use your own instead.
if the reply help you mark it as your answer.
Free Managed C#
Word, PDF , Excel Component(Create,
Modify, Convert & Print) -
Crystal Reports Server Error - Unable to cast object of type
Hi Everyone,
Not sure if this is the right place to post this question but couldn't find a Crystal Reports Server section.
After doing a windows update on my crystal reports server the following error now occurs when trying to log into .Net InfoView -
An error has occurred: Unable to cast object of type 'CrystalDecisions.Enterprise.InfoObject' to type 'BusinessObjects.Enterprise.Desktop.InfoView'.
I found the following article which I followed and re-installed the .net components as well as ensured all services are enabled.
Article: https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes/sdn_oss_boj_bip/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333233303335333433323337%7D.do
The error still occurs.
I did some further investigation and found that a similar error occurs in the Admin Console when I try and open the Crystal Report DataSources.
This is the error page that comes up
Server Error in '/businessobjects/Enterprise11/WebTools' Application.
Unable to cast object of type 'CrystalDecisions.Enterprise.InfoObject' to type 'CrystalDecisions.Enterprise.Desktop.Report'.
+Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information
about the error and where it originated in the code.+
+Exception Details: System.InvalidCastException:
Unable to cast object of type 'CrystalDecisions.Enterprise.InfoObject' to type 'CrystalDecisions.Enterprise.Desktop.Report'.+
Source Error:
+The source code that generated this unhandled exception can only be shown when compiled in debug mode.
To enable this, please follow one of the below steps, then request the URL:+
1. Add a "Debug=true" directive at the top of the file that generated the error. Example:
<%@ Page Language="C#" Debug="true" %>
or:
2) Add the following section to the configuration file of your application:
<configuration>
<system.web>
<compilation debug="true"/>
</system.web>
</configuration>
+Note that this second technique will cause all files within a given application to be compiled in debug mode.
The first technique will cause only that particular file to be compiled in debug mode.+
+Important: Running applications in debug mode does incur a memory/performance overhead.
You should make sure that an application has debugging disabled before deploying into production scenario.+
Stack Trace:
InvalidCastException: Unable to cast object of type 'CrystalDecisions.Enterprise.InfoObject' to type 'CrystalDecisions.Enterprise.Desktop.Report'.
+CrystalDecisions.Enterprise.WebContent.WebSamples.DataSources.Common.datasourceInfoFromReports(ArrayList reports) 226
+CrystalDecisions.Enterprise.WebContent.WebSamples.DataSources.Datasources.Main() 1821
+ASP.websamples_datasources_datasources_aspx.__Render__control1(HtmlTextWriter __w, Control parameterContainer) 531
+System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) 98
+System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) 20
+System.Web.UI.Page.Render(HtmlTextWriter writer) 26
+System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) 25
+System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) 121
+System.Web.UI.Control.RenderControl(HtmlTextWriter writer) 22
+System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 2558
Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433
Any information on how I can fix this is greatly appreciated.
Regards
Paul
Edited by: Paul Griscti on Sep 3, 2008 2:52 AMI'd try creating a new Application Pool just for running businessobjects and crystalreportviewers11 and nothing else.
Although the apps are .NET, it uses COM Interop for functionality, so using a common app pool with other versions will collide.
Beyond that - if you have a SAP Business Objects support contract - you might open a new SAP Incident ticket.
Sincerely,
Ted Ueda -
UnsupportedOperationException with List.add(Object obj)
List statusCodes = Arrays.asList(OcsCustomDicInfo.acctRefundStatusCodes);
List statusNames = Arrays.asList(OcsCustomDicInfo.acctRefundStatusNames);
// Add an additional item statusCodes.add(Integer.toString(statusCodes.size())); statusNames.add("All");
String[] statusCodesArray = (String[]) statusCodes.toArray();
String[] statusNamesArray = (String[]) statusNames.toArray();I used the Arrays.asList to convert an Array(which is String[]) to a List,then add one item to the List with add(Object obj).
But when the debuger run to the "statusCodes.add(Integer.toString(statusCodes.size())); " breakpoint, it throws UnsupportedOperationException.
I checked the API, the relative statement is:
UnsupportedOperationException - if the add method is not supported by this list.
Why? Doesn't the Arrays.asList() return a "List" Interface,and "List" support "add()" operation,but why not support in this case?Sorry,i have made a mistake when posting the code.
This is the code:
List statusCodes = Arrays.asList(OcsCustomDicInfo.acctRefundStatusCodes);
List statusNames = Arrays.asList(OcsCustomDicInfo.acctRefundStatusNames);
// Add an additional item
statusCodes.add(Integer.toString(statusCodes.size()));
statusNames.add("All");
String[] statusCodesArray = (String[]) statusCodes.toArray();
String[] statusNamesArray = (String[]) statusNames.toArray(); -
TreeMap's containsValue(Object obj)
In the Map interface there is a method called containsValue(Object obj) that returns a boolean. My question is, does this method call the objects equal method? or does it have some other way to check for the object in the map?
* Returns <tt>true</tt> if this map maps one or more keys to the
* specified value. More formally, returns <tt>true</tt> if and only if
* this map contains at least one mapping to a value <tt>v</tt> such
* that <tt>(value==null ? v==null : value.equals(v))</tt>. This
* operation will probably require time linear in the Map size for most
* implementations of Map.
* @param value value whose presence in this Map is to be tested.
* @return <tt>true</tt> if a mapping to <tt>value</tt> exists;
* <tt>false</tt> otherwise.
* @since 1.2
public boolean containsValue(Object value) {
return (root==null ? false :
(value==null ? valueSearchNull(root)
: valueSearchNonNull(root, value)));
private boolean valueSearchNull(Entry n) {
if (n.value == null)
return true;
// Check left and right subtrees for value
return (n.left != null && valueSearchNull(n.left)) ||
(n.right != null && valueSearchNull(n.right));
private boolean valueSearchNonNull(Entry n, Object value) {
// Check this node for the value
if (value.equals(n.value))
return true;
// Check left and right subtrees for value
return (n.left != null && valueSearchNonNull(n.left, value)) ||
(n.right != null && valueSearchNonNull(n.right, value));
}Hope that helps :) -
Hi everyone, I have recently installed a trial version of SDL Trados (a computer-assisted translation software) and at some point (when I try to create a new translation memory) this error message appears: Unable to cast object of type 'System.DBNull' to type 'System.String' Is this a problem with the software or the laptop ? If it's the laptop, can you please help me solve this ? Thank you,Caroline
Actually there was not problem witg the laptop ! Please ignore this topic. Thanks.
Maybe you are looking for
-
I had to reformat my PC and now it wont let me add music to my iphone.
I recently had to reformat my PC since I got a nasty virus. After getting my comp up and running again I went online to download itunes. I installed it without any problems, but when I tried to hook my phone up to it, I found out I can't put any addi
-
Problem with Mac OS X aliases in Dreamweaver
I have a folder full of MP3s in the Music folder in my User directory. I'm planning to use these MP3s on several different websites I own, and rather than copying each MP3 to several different Site folders, this seems like a perfect use for an alias.
-
HINCREMP/Claims Disbursement report
Hi Experts, I am running this report for disbursement of unclaimed medical allowances; it updates infotype 267 for an offcycle payment. but i want it to update IT 15 for a regular payroll run. Can please some one tell how i can achive this. its very
-
Dear All, Is there any way to delete material document in the test client permanently. Regards, qsm sap
-
Looking for a examples of a podcast from a law enforcement agency
Hi, I am looking for podcast examples from a law enforcement agency. Any suggestions?