Create a P6 XML file using MPXJ java library - mpxj

I have a json having all the information of my project, its activities, dependencies / relationships and the calendar. Using the MPXJ java library am trying to generate a corresponding Primevera P6 XML file that can be imported in Oracle primevera. I have been successful in creating an xml but when I import it in P6 it is giving me the below error.
*Microsoft.Practices.Prism.Modularity.ModuleInitializeException: An exception occurred while initializing module 'CommandLineModule'.
The exception message was: Object reference not set to an instance of an object.
The Assembly that the module was trying to be loaded from was:
Primavera.Mercury.CommandLineModule, Version=15.2.0.15383, Culture=neutral, PublicKeyToken=null
Check the InnerException property of the exception for more information. If the exception occurred while creating an object in a DI container, you can exception.GetRootException() to help locate the root cause of the problem.
---> System.NullReferenceException: Object reference not set to an instance of an object.
at Primavera.Mercury.Importer.ImportCleaner.CleanupActivities(EntityContext sourceContext)
at Primavera.Mercury.Importer.ImportCleaner.CleanSourceContext(EntityContext sourceContext, IVenusDataServiceContext targetContext, ILoggerFacade logger, ImportProjectSettings importProjectSettings, Dictionary`2 initialKeyDictionary)
at Primavera.Mercury.CommandLineModule.ExecuteImportExport.DoImport()
at Microsoft.Practices.Prism.Modularity.ModuleInitializer.Initialize(ModuleInfo moduleInfo)
--- End of inner exception stack trace ---
Failed to load type for module CommandLineModule.
Error was: An exception occurred while initializing module 'CommandLineModule'.
- The exception message was: Object reference not set to an instance of an object.
- The Assembly that the module was trying to be loaded from was:Primavera.Mercury.CommandLineModule, Version=15.2.0.15383, Culture=neutral, PublicKeyToken=null
Check the InnerException property of the exception for more information. If the exception occurred while creating an object in a DI container, you can exception.GetRootException() to help locate the root cause of the problem.*

Related

Import/Export Recipe in Orchard CMS

I have been facing many issues whenever I try to import the changes.
We have three orchard instances for different environments. Changes made in one should be migrated to remaining two instances. For this, I am using import/export module in orchard CMS(v 1.6.0.0).
The export file contains only the changes I made in CMS1 => CMS1.xml and those which are already there are deleted from the file. If I update Resource text ie., "Export Untouched" to "Export Modified" and save changes to the XML file, then when I import this file to CMS2 and CMS3 instances, those imports are not working.
NOTE: I did not change the Key, I just updated the value.
Exception:
thread:[11] ERROR - NullReferenceException thrown from <>f__AnonymousType4`2 by <>f__AnonymousType4`2
[[Orchard.ContentManagement.ContentPart, Orchard.Framework, Version=1.6.0.0, Culture=neutral, PublicKeyToken=null],
[Orchard.ContentPicker.Fields.ContentPickerField, Orchard.ContentPicker, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]
server: XXX.YYY.com operation : /XXXCMS/Admin/ImportExport/Export exception: System.NullReferenceException: Object reference not set to an instance of an object.
at Orchard.ContentManagement.DefaultContentManager.GetItemMetadata(IContent content) in d:\Builds\29\XXX\MP_2_0_XXXCMS_Support\Sources\XXX\Main\Source\Webs\Webx\XXXX_YYYYY2.0\Orchard\ContentManagement\DefaultContentManager.cs:line 513 at Orchard.ContentPicker.Drivers.ContentPickerFieldDriver.<Exporting>b__13(ContentItem x) at System.Linq.Enumerable.
<>c__DisplayClass7_0`3.<CombineSelectors>b__0(TSource x) at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext() at System.Linq.Buffer`1.
.ctor(IEnumerable`1 source) at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source) at Orchard.ContentPicker.Drivers.ContentPickerFieldDriver.Exporting(ContentPart part, ContentPickerField field, ExportContentContext context) at Orchard.ContentManagement.Drivers.ContentFieldDriver`1.<>c__DisplayClass1c.<Orchard.ContentManagement.Drivers.IContentFieldDriver.Exporting>b__1b(ContentPart part, TField field)
in d:\Builds\29\XXX\MP_2_0_XXXCMS_Support\Sources\XXX\Main\Source\Webs\Webx\XXX2.0\Orchard\ContentManagement\Drivers\ContentFieldDriver.cs:line 67 at
Orchard.ContentManagement.Drivers.ContentFieldDriver`1.<>c__DisplayClass25.<Process>b__23(<>f__AnonymousType4`2 pf) in
d:\Builds\29\XXX\MP_2_0_XXXCMS_Support\Sources\XXX\Main\Source\Webs\Webx\XXXX_YYYY2.0\Orchard\ContentManagement\Drivers\ContentFieldDriver.cs:line 80 at
Orchard.InvokeExtensions.Invoke[TEvents](IEnumerable`1 events, Action`1 dispatch, ILogger logger) in d:\Builds\29\XXX\MP_2_0_XXXX_Support\Sources\XXX\Main\Source\Webs\Webx\Project 2.0\Orchard\InvokeExtensions.cs:line 17

Validation with DynamicJAXBContext

How could I turn on validation during unmarshalling? [moxy 2.6.0]
First intresting thing is that I need to put schema which should be already in DynamicContext. But even with setting schema to unmarshaller again it gives me an error.
I've tried to use this one:
final JAXBUnmarshaller unmarshaller = dynamicJAXBContext.createUnmarshaller();
//unmarshaller.setSchema();
final Schema schema = schemas.get(type);
unmarshaller.setSchema(schema);
unmarshaller.setValidating(true);
And it gives an exception. Looks like part which broke this are some elements which are put there from DynamicContext
Exception Description: An error occurred resolving the XML Schema.
Internal Exception: java.lang.NullPointerException
Exception [EclipseLink-25012] (Eclipse Persistence Services - 2.6.0.v20150309-bf26070): org.eclipse.persistence.exceptions.XMLMarshalException
Exception Description: An error occurred resolving the XML Schema.
Internal Exception: java.lang.NullPointerException
at org.eclipse.persistence.exceptions.XMLMarshalException.errorResolvingXMLSchema(XMLMarshalException.java:186)
at org.eclipse.persistence.oxm.schema.XMLSchemaClassPathReference.getURL(XMLSchemaClassPathReference.java:48)
at org.eclipse.persistence.oxm.XMLUnmarshaller.initializeSchemas(XMLUnmarshaller.java:211)
at org.eclipse.persistence.oxm.XMLUnmarshaller.setValidationMode(XMLUnmarshaller.java:155)
at org.eclipse.persistence.jaxb.JAXBUnmarshaller.setValidating(JAXBUnmarshaller.java:756)
The problem here is that the schema was not found. You set null instead of Schema instance.
Btw. method
javax.xml.bind.Unmarshaller#setValidating
is deprecated since JAXB 2.0. Using method
javax.xml.bind.Unmarshaller#setSchema
will do the job.

when I run my jsp pgogram I got this exception error type Exception report

type Exception report
message Unable to compile class for JSP:
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:
An error occurred at line: 44 in the jsp file:
/jsp/ShoppingCart/AddBook.jsp The method getValue(String) is undefined
for the
type HttpServletRequest
int int_BookID,int_CategoryID,int_Price,int_Quantity;
String str_Title, str_Author, str_Publisher,str_Edition,str_Description;
int_BookID=(int)(10000*Math.random()+1);
int_CategoryID=Integer.parseInt(request.getValue("cat"));
str_Title=request.getParameter("title");
str_Author=request.getParameter("author");
str_Publisher=request.getParameter("pub");
request.getValue("cat") is the problem here.
I suppose the 'cat' is a parameter.
Instead , use request.getParameter("cat")
PS- I recommend you to read the basics of JSP first try the HeadFirst series.

SPException: Catastrophic failure (Exception from HRESULT: 0x8000FFF (E_UNEXPECTED) in Sharepoint

I've been trying to programmatically copy custom content type and its custom columns from one web to another for some time now, and I always get different errors or exceptions every time. After yet more tries, I received more strange and cryptic exception from Sharepoint after clicking onto a newly copied custom column in a custom content type. I checked the logs, and this is what I got:
Unknown SPRequest erorr occurred. More information: 0x80070002
Unable to locate the xml-definition for FieldName with FieldId 'guid without braces', exception: Microsoft.SharePoint.SPException: Catastrophic failure (Exception from HRESULT: 0x8000FFF (E_UNEXPECTED)) ---> System.Runtime.InteropServices.COMException...
... at Microsoft.SharePoint.Library.SPRequestInternalClass.GetGlobalContentTypeXml(String bstrUrl, Int32 type, UInt 32 lcid, Object varIdBytes...
Failed to find the content type schema for ct-1033-0x1000blahblahblahcontenttypeId while caching feature data.
Unknown SPRequest error occurred. More informationL 0x8000ffff
Unable to locate the xml-definition for CType with SPContentTypeId '0x0100MorecontenttypeId', exception: Microsoft.SharePoint.SPException: Catastrophic failure(Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED)) ---> System.Runtime.InteropServices.COMException (0x8000FFFF): Catastrophic failure...
... at Microsoft.SharePoint.Library.SPRequestInternalClass.GetGlobalContentTypeXml(String bstrUrl, Int32 type, UInt 32 lcid, Object varIdBytes...
It failed to find quite a few content type schema. I'm confused with what Sharepoint is trying to do here, and why a simple process of copying a custom content type from one web to another just wouldn't work in contrast to the information found on the web e.g. this.
Appreciate any help to get over this problem. Thanks.
Content types are defined in XML files that has to reside on the file system (in the 12 hive). If you want to copy a content type from a web application to another, you must make sure that these definitions are also copied.
I would recommend you to install the feature that contains these custom content types on each of your target web applications.
Regards,
M

Weird Silverlight Designer Error

I get the following exception loading any Xaml in my project:
'/Microsoft.VisualStudio.Xaml;Component/MS/Internal/Designer/PropertyEditing/Resources/StylesCore.Constants.xaml' value cannot be assigned to property 'Source' of object 'System.Windows.ResourceDictionary'. Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one of its dependencies. The system cannot find the file specified. Error at object 'ResourceDictionary_2' in markup file 'Microsoft.VisualStudio.Xaml;component/MS/Internal/Designer/PropertyEditing/Resources/StylesCore.xaml'.
at System.Windows.Markup.XamlParseException.ThrowException(String message, Exception innerException, Int32 lineNumber, Int32 linePosition, Uri baseUri, XamlObjectIds currentXamlObjectIds, XamlObjectIds contextXamlObjectIds, Type objectType)
at System.Windows.Markup.XamlParseException.ThrowException(ParserContext parserContext, Int32 lineNumber, Int32 linePosition, String message, Exception innerException)
at System.Windows.Markup.BamlRecordReader.ThrowExceptionWithLine(String message, Exception innerException)
at System.Windows.Markup.BamlRecordReader.ReadPropertyRecordBase(String attribValue, Int16 attributeId, Int16 converterTypeId)
at System.Windows.Markup.BamlRecordReader.ReadPropertyConverterRecord(BamlPropertyWithConverterRecord bamlPropertyRecord)
at System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord)
at System.Windows.Markup.BamlRecordReader.Read(Boolean singleRecord)
at System.Windows.Markup.TreeBuilderBamlTranslator.ParseFragment()
at System.Windows.Markup.TreeBuilder.Parse()
at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
at System.Windows.Application.LoadBamlStreamWithSyncInfo(Stream stream, ParserContext pc)
at System.Windows.Application.LoadComponent(Uri resourceLocator, Boolean bSkipJournaledProperties)
at System.Windows.Application.LoadComponent(Uri resourceLocator)
at MS.Internal.Designer.PropertyEditing.Resources.PropertyInspectorResources.GetResources()
at MS.Internal.Designer.PropertyEditing.PropertyInspectorHost.get_Host()
at MS.Internal.Designer.VSDesigner.VSDesignerClientImpl.get_PropertyWindow()
at MS.Internal.Designer.VSDesignerClient.get_PropertyWindow()
at MS.Internal.Designer.DesignerPane.LoadDesignerView()
This occurs even when I generate a new SilverLight project inside my solution, but not in a brand new solution. I've found that I am not the only person with this issue, and was wondering if you had any ideas for me.
Here is a post of someone with the same error, from Google Cache.
The stack trace is indicating you don't have a reference to the specified log4net assembly in your project. The solution would be to add a reference to it, although unless you get a log4net assembly that has been compiled against the Silverlight agCLR runtime you won't be able to.
The alternative if you are not trying to use log4net in your Silverlight app is to remove the sections of code attempting to use it. Again from the stack trace it looks like you are setting up some kind of resource that initialises log4net. Try opening your Windox.xaml and take a look in the reources section. If you see any signs of log4net there remove them and see if it helps.
I also am getting this error. I have gone through the application and made sure I am referencing the correct version. There is no use of log4net in the silverlight application, only in the web project containing a wcf service that the app uses. It looks like log4net has to be replaced with something safer. The log4net dll is also causing mstest projects to stop working.
'/Microsoft.VisualStudio.Xaml;Component/MS/Internal/Designer/PropertyEditing/Resources/StylesCore.Constants.xaml' value cannot be assigned to property 'Source' of object 'System.Windows.ResourceDictionary'. Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one of its dependencies. The system cannot find the file specified. Error at object 'ResourceDictionary_2' in markup file 'Microsoft.VisualStudio.Xaml;component/MS/Internal/Designer/PropertyEditing/Resources/StylesCore.xaml'.
I have no idea what the couse of the problem is. If anyone knows I would be interested find out!
I have a workaround though which solved it for me:
Remove the reference from the Silverlight project to whatever is using log4net
Remove that project using log4net from the solution.
Reload the XAML-pages and save the solution.
Finally add the project using log4net and the reference again.
Henrik

Resources