Objects containing objects.Expr cannot be used as an assignment.PLS-00363.
Hi,
My database: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0.
I'm working with Object types containing other object types, and I'm getting the error PLS-00363 (Expression cannot be used as an assignment).
I'm putting exlpicity all 'SELF' parameters as 'IN OUT', but still get the error...
CREATE OR REPLACE TYPE TYP_PERSON AS OBJECT (
strName VARCHAR2(100),
--+
CONSTRUCTOR FUNCTION TYP_PERSON RETURN SELF AS RESULT,
--+
MEMBER FUNCTION getName (SELF IN OUT TYP_PERSON) RETURN VARCHAR2,
MEMBER PROCEDURE setName (SELF IN OUT TYP_PERSON, pNewName VARCHAR2)
+) NOT FINAL;+
+/+
--+
CREATE OR REPLACE TYPE BODY TYP_PERSON AS
--+
CONSTRUCTOR FUNCTION TYP_PERSON RETURN SELF AS RESULT IS
BEGIN
SELF.strName := NULL;
RETURN;
END;
--+
MEMBER FUNCTION getName (SELF IN OUT TYP_PERSON) RETURN VARCHAR2 IS
BEGIN
RETURN SELF.strName;
END;
--+
MEMBER PROCEDURE setName (SELF IN OUT TYP_PERSON, pNewName VARCHAR2) IS
BEGIN
SELF.strName := pNewName;
END;
END;
+/+
--+
CREATE OR REPLACE TYPE TYP_PERSONS AS TABLE OF TYP_PERSON;
--+
CREATE OR REPLACE TYPE TYP_CREW AS OBJECT (
strName VARCHAR2(100),
persons TYP_PERSONS,
--+
CONSTRUCTOR FUNCTION TYP_CREW RETURN SELF AS RESULT,
--+
MEMBER FUNCTION getName (SELF IN OUT TYP_CREW) RETURN VARCHAR2,
MEMBER PROCEDURE setName (SELF IN OUT TYP_CREW, pNewName VARCHAR2),
--+
MEMBER PROCEDURE addPerson (SELF IN OUT TYP_CREW, pPersonName IN VARCHAR2),
MEMBER FUNCTION getPerson (SELF IN OUT TYP_CREW, pIndex IN NUMBER) RETURN TYP_PERSON,
MEMBER FUNCTION getPersons (SELF IN OUT TYP_CREW) RETURN TYP_PERSONS
+) NOT FINAL;+
+/+
--+
CREATE OR REPLACE TYPE BODY TYP_CREW AS
--+
CONSTRUCTOR FUNCTION TYP_CREW RETURN SELF AS RESULT IS
BEGIN
SELF.strName := NULL;
SELF.persons := TYP_PERSONS();
RETURN;
END;
--+
MEMBER FUNCTION getName (SELF IN OUT TYP_CREW) RETURN VARCHAR2 IS
BEGIN
RETURN SELF.strName;
END;
--+
MEMBER PROCEDURE setName (SELF IN OUT TYP_CREW, pNewName VARCHAR2) IS
BEGIN
SELF.strName := pNewName;
END;
MEMBER PROCEDURE addPerson (SELF IN OUT TYP_CREW, pPersonName IN VARCHAR2) IS
BEGIN
SELF.persons.EXTEND();
SELF.persons(SELF.persons.LAST) := TYP_PERSON(pPersonName);
END;
MEMBER FUNCTION getPerson (SELF IN OUT TYP_CREW, pIndex IN NUMBER) RETURN TYP_PERSON IS
BEGIN
IF SELF.persons.COUNT > 0 THEN
RETURN SELF.getPersons()(pIndex);
END IF;
RETURN NULL;
END;
MEMBER FUNCTION getPersons (SELF IN OUT TYP_CREW) RETURN TYP_PERSONS IS
BEGIN
RETURN SELF.persons;
END;
END;
+/+
--+
DECLARE
crew_one TYP_CREW;
BEGIN
crew_one := TYP_CREW();
crew_one.setName('The last crew on Earth');
crew_one.addPerson ('Michael Knight');
crew_one.addPerson ('Agent Mulder');
crew_one.addPerson ('Agent Scully');
crew_one.addPerson ('Frodo Bolson');
for i in crew_one.persons.FIRST..crew_one.persons.LAST LOOP
dbms_output.put_line('Person ['||i||']: '||crew_one.persons(i).getName());
end loop;
crew_one.getPerson(1).setName ('Michael Knight-----');
crew_one.getPerson(2).setName ('Agent Mulder---');
crew_one.getPerson(3).setName ('Agent Scully---');
crew_one.getPerson(4).setName ('Frodo Bolson----');
for i in crew_one.persons.FIRST..crew_one.persons.LAST LOOP
dbms_output.put_line('Person ['||i||']: '||crew_one.persons(i).getName());
end loop;
END;
How can I do this ParentObject().getChildObject().setChildFunction()?
Thanks in advance,
Donato.
You completely misunderstand objects. Use:
DECLARE
crew_one TYP_CREW;
BEGIN
crew_one := TYP_CREW();
crew_one.setName('The last crew on Earth');
crew_one.addPerson ('Michael Knight');
crew_one.addPerson ('Agent Mulder');
crew_one.addPerson ('Agent Scully');
crew_one.addPerson ('Frodo Bolson');
for i in crew_one.persons.FIRST..crew_one.persons.LAST LOOP
dbms_output.put_line('Person ['||i||']: '||crew_one.persons(i).getName());
end loop;
TYP_PERSON.setName (crew_one.persons(1),'Michael Knight-----');
TYP_PERSON.setName (crew_one.persons(2),'Agent Mulder---');
TYP_PERSON.setName (crew_one.persons(3),'Agent Scully---');
TYP_PERSON.setName (crew_one.persons(4),'Frodo Bolson----');
for i in crew_one.persons.FIRST..crew_one.persons.LAST LOOP
dbms_output.put_line('Person ['||i||']: '||crew_one.persons(i).getName());
end loop;
END;
Person [1]: Michael Knight
Person [2]: Agent Mulder
Person [3]: Agent Scully
Person [4]: Frodo Bolson
Person [1]: Michael Knight-----
Person [2]: Agent Mulder---
Person [3]: Agent Scully---
Person [4]: Frodo Bolson----
PL/SQL procedure successfully completed.
SQL> SY.
Similar Messages
-
Hello All,
The code bellow works fine on our production server (WebLogic 5.1 sp12, SQL Server
7), but it fails on our development server (same configuration):
Product.java
383: java.sql.ResultSet rs = null;
384: java.sql.CallableStatement cs = null;
405: cs.execute();
406: rs = cs.getResultSet();
407: while (rs.next()) {
445: cs.getMoreResults();
446: rs = cs.getResultSet();
447: if (rs != null) {
448: while (rs.next()) { <<<<<< ERROR LINE
The trace follows:
java.sql.SQLException: This object was closed() and cannot be used anymore. at
weblogic.jdbcbase.mssqlserver4.BaseHandler.complainIfClosed(BaseHandler.java:115)
at weblogic.jdbcbase.mssqlserver4.TdsResultSet.next(TdsResultSet.java:68) at weblogic.jdbcbase.pool.ResultSet.next(ResultSet.java:158)
at weblogic.jdbc20.rmi.internal.ResultSetImpl.next(ResultSetImpl.java:44) at weblogic.jdbc20.rmi.SerialResultSet.next(SerialResultSet.java:38)
at com.visitrade.Product.getProduct(Product.java:448) at com.visitrade.ProductDetailAction.perform(ProductDetailAction.java:74)
at org.apache.struts.action.ActionServlet.processActionInstance(ActionServlet.java:794)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:702) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:314)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at com.visitrade.VisitradeServlet.service(VisitradeServlet.java:58)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:865) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:120)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:945)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:909)
at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:269)
at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:392)
at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:274) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:130)
Any clues?
Thanks in advance,
Wagner DosAnjos CMC, Tampa, FLWagner DosAnjos wrote:
Hello All,
The code bellow works fine on our production server (WebLogic 5.1 sp12, SQL Server
7), but it fails on our development server (same configuration):
Product.java
383: java.sql.ResultSet rs = null;
384: java.sql.CallableStatement cs = null;
405: cs.execute();
406: rs = cs.getResultSet();
407: while (rs.next()) {
445: cs.getMoreResults();
446: rs = cs.getResultSet();
447: if (rs != null) {
448: while (rs.next()) { <<<<<< ERROR LINEThat looks like a driver bug. Duplicate it in a standalone program using the MS driver.
If getResultSet() returns a non-null, and the first thing yo do afterwards is call rs.next()
it shouldn't throw an exception. Download our latest driver from our site, and make sure it's
ahead of all our server stuff in the weblogic.classpath, by editing the startWeblogic script.
Joe
>
>
The trace follows:
java.sql.SQLException: This object was closed() and cannot be used anymore. at
weblogic.jdbcbase.mssqlserver4.BaseHandler.complainIfClosed(BaseHandler.java:115)
at weblogic.jdbcbase.mssqlserver4.TdsResultSet.next(TdsResultSet.java:68) at weblogic.jdbcbase.pool.ResultSet.next(ResultSet.java:158)
at weblogic.jdbc20.rmi.internal.ResultSetImpl.next(ResultSetImpl.java:44) at weblogic.jdbc20.rmi.SerialResultSet.next(SerialResultSet.java:38)
at com.visitrade.Product.getProduct(Product.java:448) at com.visitrade.ProductDetailAction.perform(ProductDetailAction.java:74)
at org.apache.struts.action.ActionServlet.processActionInstance(ActionServlet.java:794)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:702) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:314)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at com.visitrade.VisitradeServlet.service(VisitradeServlet.java:58)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:865) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:120)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:945)
at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:909)
at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:269)
at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:392)
at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:274) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:130)
Any clues?
Thanks in advance,
Wagner DosAnjos CMC, Tampa, FL -
Hi everybody. I wrote de following type
create or replace TYPE ALMACEN AS OBJECT
id_almacen number(10),
descripcion varchar2(40),
existencias number(6),
precio number(4),
member function movimiento (p_num number) return boolean
create or replace TYPE BODY ALMACEN AS
member function movimiento (p_num number) return boolean AS
v_inf boolean;
n number(6);
BEGIN
if self.existencias+p_num>=0 then
self.existencias:=existencias+p_num;
return TRUE;
else return FALSE;
end if;
END movimiento;
END;
I have Oracle 11g release I.
In previous releases it worked, but now SQLDeveloper marks
self.existencias:=existencias+p_num;
Error PLS 00363 expression "string" cannot be used as an assignment target in sentence
Please, What's wrong?
Thanking in advanceHi,
Not quite a PL/SQL XML question but anyway...
Since the member function modifies the object instance, the implicit argument "self" must be declared explicitly as "IN OUT" :
member function movimiento (self in out nocopy almacen, p_num number) return boolean -
PLS-00363: expression cannot be used as an assignment target
Hi,
Oralce9.2
when I run the insert procedure I get the below error:
Procedure
PROCEDURE proc_one_insert(col1 IN OUT numeric,
col2 IN num,
col3 IN numeric
BEGIN
execute immediate proc_one_insert(2,1,111);
END;
Error
PLS-00363: expression '2' cannot be used as an assignment target
How to solve the above error ?
With Regards
Edited by: user640001 on Dec 2, 2010 3:04 AMArun has shown you an example using PL/SQL. If you want to do something similar in other languages you have to use their style of variable declaration e.g. if you wanted to do it through SQL*Plus, you need to declare the variable within SQL*Plus itself and bind that into your calls e.g.
SQL> create procedure p_inout (p_val in out number) is
2 begin
3 p_val := p_val*10;
4 end;
5 /
Procedure created.
SQL> var mynum number
SQL> exec :mynum := 10;
PL/SQL procedure successfully completed.
SQL> print mynum
MYNUM
10
SQL> exec p_inout(:mynum);
PL/SQL procedure successfully completed.
SQL> print mynum
MYNUM
100
SQL> -
PLS-00363: expression '' cannot be used as an assignment target - HELP :-(
Hi Guys,
This is a procedure I have in the body of a package:
PROCEDURE SUM_EVENTS (p_trial_no IN NUMBER,
p_country_resion IN VARCHAR2,
p_loc_no IN NUMBER,
p_setup_flag IN VARCHAR2,
p_event_changed IN OUT NUMBER) ISWhen I call this in SQLplus with this:
exec DB_CALC.sum_events(340,'USA',1,'Y',3700);I get this:
ERROR at line 1:
ORA-06550: line 1, column 54:
PLS-00363: expression '3700' cannot be used as an assignment target
ORA-06550: line 1, column 7:
PL/SQL: Statement ignoredAny ideas what I'm doing wrong?
Thanks!p_event_changed is declared as an IN OUT parameter. You need to provide a variable in which the OUT values can be written to..
something like
declare
out_val number := 3700;
begin
DB_CALC.sum_events(340,'USA',1,'Y',out_val);
end; -
PLS-00363: expression 'I' cannot be used as an assignment target
Hello all
I have a Package and I have one procedure in it .
I have use dmlset inside this .
Inside that procedure I have a cursor and inside the FOR loop I have mentioned something .
FOR i IN 1 .. No_of_rec LOOP
If....
End if ;
i := i+1 ;
END LOOP;
I have mentioned before end loop i := i+1 ; when i execute this package it is showing this error .
"PLS-00363: expression 'I' cannot be used as an assignment target"
What could be the problem?Of course,
My example is showing that index I in loop is same thing as parameter IN in procedure1. Its value, not reference. I is passed as VALUE to LOOP just like PARAM1 is passed as value to PROCEDURE1. Trying to assignment something to I or PARAM1 will generate same error.
Also another interesting example is
CREATE OR REPLACE
PROCEDURE procedure1(
param1 IN OUT NUMBER)
AS
BEGIN
param1 := 0;
END procedure1;
BEGIN
FOR i IN 1..3
LOOP
procedure1(i);
END LOOP;
END;
In this case procedure1 is correct but loop stmt is not. It will generate same error.
After doing this examples i also concluded that procedure cant return value it can modify existing value of variable which is declared (uninitialized or initialized, OUT or IN OUT ) in upper PLSQL block (named or unnamed PLSQL block) -
Using Container Object in Java Mapping
Hi All,
I need to use a Container object inside a Java Mapping, just like the one wich is used in the Graphical Mapping.
Here is the scenario:
I have an Interface Mapping with three steps on it.
The first step is a Java Mapping just to put some info in the Container. The second step is a XSLT transformation that uses an XSLT file to transforms from IDOC to xCBL. The third step is another Java Mapping that get the info from the Container and insert in the xCBL.
Does any one knows how to do it inside the Java Mapping Code? We cannot make modifications in the XSLT file because of some internal restrictions.
Thanks,Hi,
If you make the container variable is a part of your message (input of Java Mapping) then you can access as normal fields.
Just have a look at these discussions-
How to use Container Variable across Maps
xi 3.0 - Using BPM variables in messages
Hope this helps,
Regards,
Moorthy -
Querying deleted objects container in Active Directory using JNDI
Hi,
I am trying to query deleted objects container using JNDI which fails with error 64.
Has anyone seen this or knows how to query AD using binary data in JNDI.
Seems to me there is some problem with the search base.
search base: <GUID=18E2EA80684F11D2B9AA00C04F79F805,dc=engserver,dc=com>.
filter: objectclass=*
search scope: subtree
This is the error:
Search example failed.
javax.naming.InvalidNameException: <GUID=18E2EA80684F11D2B9AA00C04F79F805,dc=eng
server,dc=com>: [LDAP: error code 64 - 00000057: LdapErr: DSID-0C090563, comment
: Error processing name, data 0, v893 ]; remaining name '<GUID=18E2EA80684F11D2B
9AA00C04F79F805,dc=engserver,dc=com>'
at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2802)
at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2616)
at com.sun.jndi.ldap.LdapCtx.searchAux(LdapCtx.java:1744)
at com.sun.jndi.ldap.LdapCtx.c_search(LdapCtx.java:1667)
at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_search(ComponentDirCon
text.java:368)
at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.search(PartialCom
positeDirContext.java:328)
at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.search(PartialCom
positeDirContext.java:313)
at javax.naming.directory.InitialDirContext.search(InitialDirContext.jav
a:245)
at jSearch.main(jSearch.java, Compiled Code)
Thanks,
ChetanI thought I had posted one of these. How remiss of me !/**
* deleted.java
* 5 July 2001
* Sample JNDI application to search for deleted objects
* Modified December 2004 to add Win2K3 lastKnownParent
import java.util.Hashtable;
import javax.naming.*;
import javax.naming.ldap.*;
import javax.naming.directory.*;
import com.sun.jndi.ldap.ctl.*;
class DeletedControl implements Control {
public byte[] getEncodedValue() {
return new byte[] {};
public String getID() {
return "1.2.840.113556.1.4.417";
public boolean isCritical() {
return true;
public class deleted {
public static void main (String[] args) {
Hashtable env = new Hashtable();
String adminName = "CN=Administrator,CN=Users,DC=ANTIPODES,DC=COM";
String adminPassword = "XXXXXX";
String ldapURL = "ldap://mydc.antipodes.com:389";
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
//set security credentials, note using simple cleartext authentication
env.put(Context.SECURITY_AUTHENTICATION,"simple");
env.put(Context.SECURITY_PRINCIPAL,adminName);
env.put(Context.SECURITY_CREDENTIALS,adminPassword);
//connect to my domain controller
env.put(Context.PROVIDER_URL,ldapURL);
try {
//Create the initial directory context
LdapContext ctx = new InitialLdapContext(env,null);
//Create the search controls
SearchControls searchCtls = new SearchControls();
//Specify the attributes to return
String returnedAtts[]={"distinguishedName","lastKnownParent"};
searchCtls.setReturningAttributes(returnedAtts);
//Specify the search scope
searchCtls.setSearchScope(SearchControls.SUBTREE_SCOPE);
//specify the LDAP search filter
String searchFilter = "(&(objectClass=user)(isDeleted=TRUE))";
//Specify the Base for the search
String searchBase = "DC=antipodes,DC=com";
//initialize counter to total the results
int totalResults = 0;
//specify the Deleted control
Control[] rqstCtls = new Control[] {new DeletedControl()};
ctx.setRequestControls(rqstCtls);
//Search for objects using the filter
NamingEnumeration answer = ctx.search(searchBase, searchFilter, searchCtls);
//Loop through the search results
while (answer.hasMoreElements()) {
SearchResult sr = (SearchResult)answer.next();
totalResults++;
System.out.println(totalResults + ". " + sr.getName().toString());
// Print out some of the attributes, catch the exception if the attributes have no values
Attributes attrs = sr.getAttributes();
if (attrs != null) {
try {
for (NamingEnumeration ae = attrs.getAll();ae.hasMore();) {
Attribute attr = (Attribute)ae.next();
System.out.println("Attribute: " + attr.getID());
for (NamingEnumeration e = attr.getAll();e.hasMore();System.out.println(" " + e.next().toString()));
catch (NullPointerException e) {
System.err.println("Problem listing attributes: " + e);
System.out.println("Deleted objects: " + totalResults);
ctx.close();
catch (NamingException e) {
System.err.println("Problem searching directory: " + e);
} -
"COM object that has been separated from its underlying RCW cannot be used.
I am constantly getting the following error when closing my app if we viewed/printed a report. What do I need to do to correct this error? For the following error, I opened my app, viewed a report on the screen using the 'CrystalReportViewer', closed the report viewer window, closed my app. When closing the app, the following error occurs.
CR version: 11.5.3300.0
VB.NET v2.
System.Runtime.InteropServices.InvalidComObjectException was unhandled
Message="COM object that has been separated from its underlying RCW cannot be used."
Source="mscorlib"
StackTrace:
at System.Runtime.InteropServices.UCOMIConnectionPoint.Unadvise(Int32 dwCookie)
at CrystalDecisions.ReportAppServer.%. {(_ISCDClientDocumentEvents_OnClosedEventHandler u)
at CrystalDecisions.ReportAppServer.%.remove_OnClosed(_ISCDClientDocumentEvents_OnClosedEventHandler value)
at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.DisconnectEventRelay()
at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper. (Boolean \b, Boolean )
at CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Dispose(Boolean bDisposeManaged)
at System.ComponentModel.Component.Dispose()
at CrystalDecisions.CrystalReports.Engine.ReportDocument. (Boolean :)
at CrystalDecisions.CrystalReports.Engine.ReportDocument. (Boolean ;)
at CrystalDecisions.CrystalReports.Engine.ReportDocument.Close()
at CrystalDecisions.CrystalReports.Engine.ReportDocument.
(Object >, EventArgs ?)Hello,
First thing is to install Service Pack 6 which you can get from the download page by clicking on BusinessObjests tab above and then downloads on the left...
When you close your viewer be sure to add/have Youreportobject.close and Youreportobject.Dispose. Adding a GC.Collect may help also.
Thank you
Don -
SCOM 2012 - Use Powershell to put specific server and contained objects into Maintenance Mode
I am still trying to develop what I thought was going to be an easy script, to put a specific server and all it's contained objects into maintenance mode in SCOM 2012. Not a group, but just one specific server and all it's stuff.
My script to START maintenance mode has two parameters:
1. The FQDN. So for example: server1.contoso.com
2. The amount of minutes to put into maintenance mode
Then it does the following to START maintenance mode:
Import-Module OperationsManager
$Instance = Get-SCOMClassInstance -Name $FQDN
If ($Instance)
$newEnd = ((Get-Date).AddMinutes($minutes))
Start-SCOMMaintenanceMode -Instance $Instance -end $newEnd -Reason "PlannedOther" -Comment "Comments here"
This seems to work from what I can tell. I know that when you schedule maintenance mode manually in SCOM, there is an option to apply to "Selected objects and all their contained objects". I do not know if that is occurring based on
my code above. But I think that is what I want to happen. I just want all monitoring and alerting for the specified server to stop. So if you think I need to change the above code so that it gets all the "contained
objects" please let me know.
The second part, which I know for a fact isn't fully working, is intended to stop maintenance mode for a server.
My script to STOP maintenance mode has only one parameter:
1. The FQDN. So for example: server1.contoso.com
Then it does the following to STOP maintenance mode:
Import-Module OperationsManager
$Instance = Get-SCOMClassInstance -Name $FQDN
If ($Instance)
$MMEntry = Get-SCOMMaintenanceMode -Instance $Instance
If ($MMentry)
#basically sends an end time of 1 minute from when the script is run
$newEnd = ((Get-Date).AddMinutes(1))
Set-SCOMMaintenanceMode -MaintenanceModeEntry $MMEntry -EndTime $NewEnd -Comment "Removing from Maintenance Mode"
This part does seem to work partially. It does remove the server from maintenance mode. However, I suspect that it's not removing all the "contained objects" from maintenance mode because when I run the script to stop maintenance
mode on a server, the little maintenance mode icon in SCOM does go away but the overall light for the server stays set to "Not Monitored". It never turns back to the green checkbox and says "Healthy". When I start
and stop maintenance mode manually I can see that the green Healthy checkbox comes back. But when I try to run my above code to do it via script, it stays at "Not Monitored" instead.
Can someone help me out here? Looking for answers to two questions:
1. Does my Start maintenance mode code look ok? Will that put a server and all it's contained objects into maintenance mode?
2. What do I need to hadd to my Stop maintenance mode code, so that it correctly stops maintenance mode on the server and all its objects and everything starts to be monitored again?
Thanks in advance! Please let me know if you need any more information in order to be able to help me!Hello, thanks for your response. Unfortunately, it does not appear that the link you provided works.
As far as not including "selected objects and all their contained objects" I am wondering if there is a way for me to tell for sure. One thing I found was that if I run this script and put the server into maintenance mode, then I go into
SCOM and click on Edit Maintenance Mode for that server, it shows me the details. It has some comment, and my selected reason, based on the code I posted above. It also DOES have "selected objects and all their contained objects"
selected at top. So it seems to me like it is working correctly, and does contain all the objects. If you think that 'Edit' screen would be inaccurate for some reason, please let me know. Or if you know of a way for me to check and
confirm, please let me know that as well.
As for REMOVING it from maintenance mode, I did eventually find a line of code that I think works. Here's what my code looks like now:
Import-Module OperationsManager
$Instance = Get-SCOMClassInstance -Name $FQDN
If ($Instance)
$MMEntry = Get-SCOMMaintenanceMode -Instance $Instance If ($MMentry)
$Instance.StopMaintenanceMode([DateTime]::Now.ToUniversalTime(),[Microsoft.EnterpriseManagement.Common.TraversalDepth]::Recursive);
When I use the above code to STOP maintenance mode, the green checkmark does reappear for the server, and everything seems to be being monitored again. Unlike before, where the maintenance mode icon would go away, but it would never change back
to saying 'Monitored' again. So I think that changing that one line to stop maintenance mode seems to have done the trick.
So I guess my last concern now is just putting in maintenance mode initially, as I was talking about above. If you still think the 'Edit Maintenance Mode' screen is not a good indicator of what my code does, please let me know. -
Hi,
I am trying to create report by writing MDx query. Just one hour back the report was working fine then i have done some changes it started throwing some error like
"An error occured during local report processing
An error has occured during report processing
Query execution failed for dataset'pDate'
The connection cannot be used while an XmlReader object is open."
The report is working withsome date combinations but when ever i am trying to display data with similar dates combinations like startdate: 01-01-2008 and Enddate:01-01-2008 then it is throwing error like this...
Could you please give any idea how to solve this...
Thanks...
maruthispWhile passing the Pdate parameters values to main report query, the parameter values was not proper for the main query. So I checked and modified the main report query to handle all the parameter values when I select from drop down selection.
Maruthi... -
Cannot load callable object container: null
My application is webdynprojava application with GP process.
One of my scenaio was to create a popup window with ok button after completed the action.
First I tried from code where i was written to completd the action
but it did not work because the popcode i was writing before the complete method but it always talking after
completeso results i was getting error .
Then for the same action i created one callable object for display.
That time my application was working after some time I again check
then its showing Cannot load callable object container: <null>
this error for the callable object which I created for popup window with ok button.
(once RM will approve ,popup window will come with ok button ).
Reporting Manager CO Callable Object for Execution
Resignationmanpowerlink Callable Object for Display --I am getting error here
can u please help me why i am getting Cannot load callable object container: <null>
error
Thanks for your time.
Thanks & Regards.
Abhishekh SinghLast time I checked contexts and lookups could return null values. And your code is not checking for a null value return.
-
Guided Procedures "Cannot load callable object container"
I get this error message when ever i initiate the process in the production box, it works fine when i initiate the process in development box.I am talking about the Guided procedures process. the error is "Cannot load callable object container: Failed to get Related Model Object for the object com.sap.caf.eu.gp.ui.actions.decpage.CDecisionPageInterfaceViewdecisionPageUsage1, relation View."
This happens with all processes in production box , it works fine in development box.Hi Fritz,
how did you resolve the problem? thanks a lot!
Nicola -
The object contains an unrecognized argument: "JobId"
Hi all,
I'm trying to push configuration on two nodes using WMF 5.0 Preview February 2015 but it is failing to create job on one the second node. Would appreciate any advise on how to resolve this issue.
Command:
Start-DscConfiguration -Path C:\MOF\AzurePackAdmin -Verbose -Wait -Force
Error:
The WinRM client cannot process the request. The object contains an unrecognized argument: "JobId". Verify that the spelling of the argument name is correct.
+ CategoryInfo : MetadataError: (root/Microsoft/...gurationManager:String) [], CimException
+ FullyQualifiedErrorId : HRESULT 0x803381e1
+ PSComputerName : node02.domain.labTry and delete the content of the c:\MOF\AzurePackAdmin folder, generate the MOFs again and try to apply the configuration. If that is unsuccessfull, reboot the nodes if you have not tried that. If the error persist, create a dummy configuration like this:
configuration Telnet
Param(
[String[]]$Computername
Foreach ($computer in $computername)
Node "$computer"
WindowsFeature TelnetClient
Ensure = "Absent"
Name = "Telnet-client"
Try and apply that configuration to the nodes. If the configuration gets applied, then there is most likely an error in WMF5, the DSC resource/module or the configuration.
Cheers
Tore -
XPATH - Scope of BPM container objects
Hi,
I have a question.
When we declare container objects in BPM, the scope is mentioned as "Process".
Does this mean that I can use any container objects declared within the process anywhere.
What I am trying to do is, after a SYNC step, I have a ASYNC step. I have to use the response from the SYNC step in the ASYNC step.
The problem is that the interface of SYNC's response differs from ASYNC's request.
So I was wondering if I could mention the XPATH of SYNC's response while doing the receiver determination for ASYNC.
I tried and it does not work. But technically I assume it has to work.
Could someone point out where I am going wrong ( My understanding / Steps that I am following ).
Thank you team.When you do the mapping outside of BPM (which is recommended anyway)
then you send the sync response directly as async request and do receiver det. and mapping. to the new structure.
when you do mapping and receiver det. inside BPM, you should be able to access all container elements, but I do not have experience with this.
Maybe you are looking for
-
I subscribed to a news paper and am having too much trouble with the app to continue using it. I'd like to cancel the subscription, but can't figure it out.
-
USB Flash Drive Issue On iMac - 1.1 on iMac, 2.0 on any other Mac
I have a Core i7 27" Late 2009 iMac. I just noticed this issue today. I have a couple of Patriot XPorter XT USB Flash drives that I use among my Macs to transfer big files around. Hooking one of the 8GB flash drives to my iMac, the one listed above,
-
Moving photos from gravity to iTouch
Is there a way to move a photo from my samsung gravity to my iTouch? I know they both have bluetooth, but when I try it on my own, it will not sync up. But I am also not an expert in this topic so it could be human error.
-
I have been using bullzip printer for years with Foxfire. I am now using a version 7_1_1_0_1218 of bullzip printer I downloaded in March 2011. I am using Windows Vista Service pak 2 with all latest updates.
-
Can't send files on windows 8.1 skype app
I don't know why it says 'waiting' and the file is not sending...when i tried to send a photo 2 days ago it was good, and now i can't...with the same person... Attachments: Screenshot (115).png 289 KB