provide a link to navigate to control panel from liferay theme - liferay

I am trying to provide a link to navigate to control panel from my theme.
I used the following piece of code.
<li>Manage Your Profile</li>
This worked fine in my local test environment.
But when I move this to production , I got following error.
10:10:13,998 ERROR [IncludeTag:231] Current URL /group/control_panel/manage?p_p_auth=9AUrwzDp&p_p_id=2&p_p_lifecycle=0&p_p_state=maximized&p_p_mode=view&p_p_col_count=1&refererPlid=25014&_2_struts_action=%2Fmy_account%2Fedit_user&_2_backURL=%2Fgroup%2F19765%2Fdashboard generates exception: An exception occurred processing JSP page /html/portlet/enterprise_admin/init.jsp at line 221
218: boolean isHavingUpdatePermission = false;
219: boolean isHavingAssignUserRolesPermission = false;
220:
221: boolean isOrganization = GroupLocalServiceUtil.getGroup(themeDisplay.getDoAsGroupId()).isOrganization();
222: long orgId = GroupLocalServiceUtil.getGroup(themeDisplay.getDoAsGroupId()).getOrganizationId();
223:
224: List<Role> objRolesList = RoleLocalServiceUtil.getUserGroupRoles(themeDisplay.getUserId(),themeDisplay.getDoAsGroupId());
Stacktrace:
10:10:13,999 ERROR [IncludeTag:154] com.liferay.portal.NoSuchGroupException: No Group exists with the primary key 0
at com.liferay.portal.service.persistence.GroupPersistenceImpl.findByPrimaryKey(GroupPersistenceImpl.java:723)
at com.liferay.portal.service.impl.GroupLocalServiceImpl.getGroup(GroupLocalServiceImpl.java:517)
at com.liferay.portal.dao.jdbc.aop.DynamicDataSourceTransactionInterceptor.invoke(DynamicDataSourceTransactionInterceptor.java:44)
at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
at com.liferay.portal.service.GroupLocalServiceUtil.getGroup(GroupLocalServiceUtil.java:166)
at org.apache.jsp.html.portlet.enterprise_005fadmin.edit_005fuser_jsp._jspService(edit_005fuser_jsp.java:1162)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:551)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:488)
at com.liferay.taglib.util.IncludeTag.include(IncludeTag.java:175)
Please help me to solve this issue .
Thanks In advance

I don't see how do you construct the link, but here is my code which I use for the same task:
#if($themeDisplay.getPermissionChecker().isOmniAdmin())
Control Panel
#end

Related

GW: Null Pointer Exception after click on Approve button

Getting NPE after click on Approve button for the payment activity.And also, getting NPE for Reject button. Even though user is authorized to approve the activity but unable to figure it out from which point it throws null value.
Here are the below logs-
ERROR Displaying to the user an exception message that is not a UserDisplayableException
java.lang.NullPointerException
at com.guidewire.pl.system.entity.proxy.AbstractKeyableBeanProxy.getFieldValue(AbstractKeyableBeanProxy.java:159)
at com.guidewire.pl.system.entity.proxy.BeanProxy.getFieldValue(BeanProxy.java:593)
at com.guidewire.pl.system.graph.AbstractForeignKeyLink.getSourceIdsFromBundleIfPossible(AbstractForeignKeyLink.java:32)
at com.guidewire.pl.system.graph.Chain.getSourceIdsFromBundleIfPossible(Chain.java:139)
at com.guidewire.pl.system.graph.Chain.getSourceIdsFromBundleIfPossible(Chain.java:135)
at com.guidewire.pl.system.graph.Chain.getSourceIdsViaBundleIfPossible(Chain.java:44)
at com.guidewire.pl.system.integration.messaging.events.TopLevelEntityGraph.processChainInBundle(TopLevelEntityGraph.java:79)
at com.guidewire.pl.system.integration.messaging.events.TopLevelEntityGraph.getTopLevelObjectIdsReferringToUpdatedBean(TopLevelEntityGraph.java:43)
at com.guidewire.pl.system.bundle.validation.GraphToValidatableBeansImpl.getTopLevelObjectIdsReferringToUpdatedBean(GraphToValidatableBeansImpl.java:63)
at com.guidewire.pl.system.bundle.validation.RootValidatableBeansFinderImpl.findRootBeansToValidate(RootValidatableBeansFinderImpl.java:145)
at com.guidewire.pl.system.preupdate.PreUpdateHelper.executePreUpdateRules(PreUpdateHelper.java:21)
at com.guidewire.pl.system.database.DatabaseBundleWriter.prepareBundleForWritePreIDGeneration(DatabaseBundleWriter.java:73)
at com.guidewire.pl.system.bundle.BundleWriter.commitBundle(BundleWriter.java:85)
at com.guidewire.pl.system.transaction.SessionImpl.flush(SessionImpl.java:139)
at com.guidewire.pl.system.transaction.SessionImpl.commit(SessionImpl.java:200)
at com.guidewire.pl.system.transaction.TransactionManagerImpl.execute(TransactionManagerImpl.java:115)
at com.guidewire.pl.system.transaction.TransactionManagerImpl.commitBundle(TransactionManagerImpl.java:59)
at com.guidewire.pl.system.bundle.EntityBundleImpl.commitAndGetBeans(EntityBundleImpl.java:1669)
at com.guidewire.pl.system.bundle.EntityBundleImpl.commit(EntityBundleImpl.java:1611)
at com.guidewire.pl.web.navigation.EditControllerImpl.commitChanges(EditControllerImpl.java:63)
at com.guidewire.pl.web.navigation.Location.innerCommitChanges(Location.java:476)
at com.guidewire.pl.web.navigation.Location.commitChanges(Location.java:425)
at com.guidewire.pl.web.navigation.LocationConfigCodeGen$6.handleCall(LocationConfigCodeGen.java:91)
at gw.internal.gosu.runtime.GosuRuntimeMethods.invokeMethodInfo(GosuRuntimeMethods.java:252)
at fragment_.pcffragment.ApprovalDetailWorksheet.ApprovalDetailScreen.ApprovalDetailWorksheet_ApproveButton.ToolbarButton_action_0_6.evaluate(Unknown Source)
at gw.internal.gosu.parser.fragments.GosuFragment.evaluate(GosuFragment.java:485) - ({
beforeCommitAction = \ -> Activity.approve()
CurrentLocation.commit()

Bundle has invalid content in tables.sql:_create table YYY

I'm trying to deploy a service builder module on my Liferay portal. But I'm getting the error below.
Could this be caused because I already have that table on my database? The table was created manually as part of an older project, and now I'm trying to reuse that existing table.
Thanks in advance.
2019-07-24 12:09:47.770 ERROR [pipe-start
998][com_liferay_portal_upgrade_impl:97] Invocation to listener threw
exception com.liferay.portal.kernel.upgrade.UpgradeException: Bundle
com.xxxx.xxxx.service_1.0.0 [998] has invalid
content in tables.sql:_create table dbo.news ( id_ INTEGER not null
primary key,_ title VARCHAR(75) null,_ push_notification
BOOLEAN,_ date_time VARCHAR(75) null,_ short_description VARCHAR(75)
null,_ long_description VARCHAR(75) null,_ picture VARCHAR(75)
null,_ type_ VARCHAR(75) null,_ tag VARCHAR(75) null_); [Sanitized]
at
com.liferay.portal.spring.extender.internal.context.ParentModuleApplicationContextExtender$InitialUpgradeStep.upgrade(ParentModuleApplicationContextExtender.java:220)
at
com.liferay.portal.upgrade.internal.executor.UpgradeExecutor$UpgradeInfosRunnable.run(UpgradeExecutor.java:159)
at
com.liferay.portal.output.stream.container.internal.OutputStreamContainerFactoryTrackerImpl.runWithSwappedLog(OutputStreamContainerFactoryTrackerImpl.java:119)
at
com.liferay.portal.upgrade.internal.executor.UpgradeExecutor.executeUpgradeInfos(UpgradeExecutor.java:110)
at
com.liferay.portal.upgrade.internal.executor.UpgradeExecutor.execute(UpgradeExecutor.java:87)
at
com.liferay.portal.upgrade.internal.release.osgi.commands.ReleaseManagerOSGiCommands$UpgradeInfoServiceTrackerMapListener.keyEmitted(ReleaseManagerOSGiCommands.java:485)
at
com.liferay.portal.upgrade.internal.release.osgi.commands.ReleaseManagerOSGiCommands$UpgradeInfoServiceTrackerMapListener.keyEmitted(ReleaseManagerOSGiCommands.java:474)
at
com.liferay.osgi.service.tracker.collections.internal.map.ServiceTrackerMapImpl$DefaultEmitter.emit(ServiceTrackerMapImpl.java:222)
at
com.liferay.osgi.service.tracker.collections.map.PropertyServiceReferenceMapper.map(PropertyServiceReferenceMapper.java:43)
at
com.liferay.osgi.service.tracker.collections.internal.map.ServiceTrackerMapImpl$ServiceReferenceServiceTrackerCustomizer.addingService(ServiceTrackerMapImpl.java:260)
at
com.liferay.osgi.service.tracker.collections.internal.map.ServiceTrackerMapImpl$ServiceReferenceServiceTrackerCustomizer.addingService(ServiceTrackerMapImpl.java:248)
at
org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:943)
at
org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:1)
at
org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)
at
org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229)
at
org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:903)
at
org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:109)
at
org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:891)
at
org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:804)
at
org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:127)
at
org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:228)
at
org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:469)
at
org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:487)
at
org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:1004)
at
com.liferay.portal.spring.extender.internal.context.ParentModuleApplicationContextExtender$ParentModuleApplicationContextExtension._processInitialUpgrade(ParentModuleApplicationContextExtender.java:613)
at
com.liferay.portal.spring.extender.internal.context.ParentModuleApplicationContextExtender$ParentModuleApplicationContextExtension.start(ParentModuleApplicationContextExtender.java:571)
at
org.apache.felix.utils.extender.AbstractExtender.createExtension(AbstractExtender.java:259)
at
org.apache.felix.utils.extender.AbstractExtender.modifiedBundle(AbstractExtender.java:232)
at
org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:488)
at
org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:1)
at
org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:232)
at
org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:450)
at
org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:908)
at
org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at
org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
at
org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged(EquinoxEventPublisher.java:230)
at
org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:137)
at
org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:129)
at
org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:191)
at org.eclipse.osgi.container.Module.publishEvent(Module.java:476)
at org.eclipse.osgi.container.Module.start(Module.java:467) at
org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:428)
at
org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:447)
at
org.eclipse.equinox.console.commands.EquinoxCommandProvider.start(EquinoxCommandProvider.java:243)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498) at
org.apache.felix.gogo.runtime.Reflective.invoke(Reflective.java:139)
at
org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:91)
at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:599)
at
org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:526)
at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:415)
at org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:416) at
org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229) at
org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59) at
java.util.concurrent.FutureTask.run(FutureTask.java:266) at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748) Caused by:
java.sql.SQLSyntaxErrorException: unexpected token: DBO at
org.hsqldb.jdbc.JDBCUtil.sqlException(JDBCUtil.java:376) at
org.hsqldb.jdbc.JDBCUtil.sqlException(JDBCUtil.java:247) at
org.hsqldb.jdbc.JDBCStatement.fetchResult(JDBCStatement.java:1817) at
org.hsqldb.jdbc.JDBCStatement.executeUpdate(JDBCStatement.java:208)
at
com.zaxxer.hikari.pool.ProxyStatement.executeUpdate(ProxyStatement.java:117)
at
com.zaxxer.hikari.pool.HikariProxyStatement.executeUpdate(HikariProxyStatement.java)
at com.liferay.portal.dao.db.BaseDB.runSQL(BaseDB.java:294) at
com.liferay.portal.dao.db.BaseDB.runSQL(BaseDB.java:264) at
com.liferay.portal.dao.db.BaseDB.runSQLTemplateString(BaseDB.java:452)
at
com.liferay.portal.dao.db.BaseDB.runSQLTemplateString(BaseDB.java:509)
at
com.liferay.portal.spring.extender.internal.context.ParentModuleApplicationContextExtender$InitialUpgradeStep.upgrade(ParentModuleApplicationContextExtender.java:216)
... 59 more Caused by: org.hsqldb.HsqlException: unexpected token:
DBO at org.hsqldb.error.Error.parseError(Error.java:101) at
org.hsqldb.ParserBase.unexpectedToken(ParserBase.java:815) at
org.hsqldb.ParserBase.checkIsIrregularCharInIdentifier(ParserBase.java:335)
at org.hsqldb.ParserDQL.checkIsSchemaObjectName(ParserDQL.java:115)
at org.hsqldb.ParserDQL.readNewSchemaObjectName(ParserDQL.java:5912)
at org.hsqldb.ParserTable.compileCreateTable(ParserTable.java:78) at
org.hsqldb.ParserDDL.compileCreate(ParserDDL.java:156) at
org.hsqldb.ParserCommand.compilePart(ParserCommand.java:236) at
org.hsqldb.ParserCommand.compileStatements(ParserCommand.java:91) at
org.hsqldb.Session.executeDirectStatement(Session.java:1227) at
org.hsqldb.Session.execute(Session.java:1018) at
org.hsqldb.jdbc.JDBCStatement.fetchResult(JDBCStatement.java:1809)
... 67 more
The fact that the table is already existing is surely the issue. Service builder deployment keep track of the "schema" version that is currently deployed, and if there is none, they create it using the sql script.
In your case, I would suggest
renaming or exporting and delete your current table
deploying your new service
move your data back to the new table created
Once this is done, don’t ever touch that data directly in the database, let your new service handle all future interaction. In fact, it might even be better to import the old data using the service API.

Dynamics CRM 2011 - Can not open a record form although seen in grid

I can see a record in the entity grid but when I click the record to open it's form I get an error saying "The record is not available. The requested record was not found, or that your display privileges are insufficient."
(since my system is in Hebrew-I hope my translation is precise)
I am the System Manger (as per CRM privileges).
After checking the server I realized an SQL error warning in the Event Viewer:
- <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
- <System>
<Provider Name="ASP.NET 4.0.30319.0" />
<EventID Qualifiers="32768">1309</EventID>
<Level>3</Level>
<Task>3</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2015-05-25T18:00:30.000000000Z" />
<EventRecordID>5574520</EventRecordID>
<Channel>Application</Channel>
<Computer>ServerName</Computer>
<Security />
</System>
- <EventData>
<Data>3005</Data>
<Data>An unhandled exception has occurred.</Data>
<Data>25/05/2015 21:00:30</Data>
<Data>25/05/2015 18:00:30</Data>
<Data>cb25f0437bee49deaf1ed75e627b9dda</Data>
<Data>30028</Data>
<Data>6</Data>
<Data>0</Data>
<Data>/LM/W3SVC/1/ROOT-4-130770366125068492</Data>
<Data>Full</Data>
<Data>/</Data>
<Data>C:\Program Files\Microsoft Dynamics CRM\CRMWeb\</Data>
<Data>ServerName</Data>
<Data />
<Data>1428</Data>
<Data>w3wp.exe</Data>
<Data>NT AUTHORITY\NETWORK SERVICE</Data>
<Data>CrmException</Data>
<Data>contact With Id = 69fa903e-f865-df11-b4ad-001ec9e8be31 Does Not Exist at Microsoft.Crm.Application.Platform.ServiceCommands.PlatformCommand.XrmExecuteInternal() at Microsoft.Crm.Application.Platform.ServiceCommands.RetrieveCommand.Execute() at Microsoft.Crm.Application.Platform.EntityProxy.Retrieve(String[] columns, Guid auditingTransactionId, Boolean addRequiredColumns) at Microsoft.Crm.Application.Platform.EntityProxy.Retrieve(String[] columns, Guid auditingTransactionId) at Microsoft.Crm.Application.Platform.EntityProxy.Retrieve(String columnSet, Guid auditingTransactionId) at Microsoft.Crm.Application.Platform.EntityProxy.Retrieve(String columnSet) at Microsoft.Crm.Application.Forms.AppForm.FormLoadEvent() at Microsoft.Crm.Application.Forms.AppForm.RaiseDataEvent(FormEventId eventId) at Microsoft.Crm.Application.Forms.EndUserForm.Initialize(Entity entity) at Microsoft.Crm.Application.Forms.CustomizableForm.Execute(Entity entity, FormDescriptor fd) at Microsoft.Crm.Application.Components.PageHandlers.ContactRecordPageHandler.ConfigureFormHandler() at Microsoft.Crm.Application.Components.PageHandlers.RecordPageHandler.ConfigureFormWrapper() at Microsoft.Crm.Application.Components.Utility.GenericEventProcessor.RaiseEvent(String eventName) at Microsoft.Crm.Application.Controls.PageManager.OnPreRender(EventArgs e) at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)</Data>
<Data>http://ServerName/OrgName/userdefined/edit.aspx?_gridType=2&etc=2&id={69FA903E-F865-DF11-B4AD-001EC9E8BE31}&pagemode=iframe&preloadcache=1432576830146&rskey=882919810</Data>
<Data>/OrgName/userdefined/edit.aspx</Data>
<Data>192.168.30.4</Data>
<Data>Domain User</Data>
<Data>True</Data>
<Data>NTLM</Data>
<Data>NT AUTHORITY\NETWORK SERVICE</Data>
<Data>116</Data>
<Data>NT AUTHORITY\NETWORK SERVICE</Data>
<Data>False</Data>
<Data>at Microsoft.Crm.Application.Platform.ServiceCommands.PlatformCommand.XrmExecuteInternal() at Microsoft.Crm.Application.Platform.ServiceCommands.RetrieveCommand.Execute() at Microsoft.Crm.Application.Platform.EntityProxy.Retrieve(String[] columns, Guid auditingTransactionId, Boolean addRequiredColumns) at Microsoft.Crm.Application.Platform.EntityProxy.Retrieve(String[] columns, Guid auditingTransactionId) at Microsoft.Crm.Application.Platform.EntityProxy.Retrieve(String columnSet, Guid auditingTransactionId) at Microsoft.Crm.Application.Platform.EntityProxy.Retrieve(String columnSet) at Microsoft.Crm.Application.Forms.AppForm.FormLoadEvent() at Microsoft.Crm.Application.Forms.AppForm.RaiseDataEvent(FormEventId eventId) at Microsoft.Crm.Application.Forms.EndUserForm.Initialize(Entity entity) at Microsoft.Crm.Application.Forms.CustomizableForm.Execute(Entity entity, FormDescriptor fd) at Microsoft.Crm.Application.Components.PageHandlers.ContactRecordPageHandler.ConfigureFormHandler() at Microsoft.Crm.Application.Components.PageHandlers.RecordPageHandler.ConfigureFormWrapper() at Microsoft.Crm.Application.Components.Utility.GenericEventProcessor.RaiseEvent(String eventName) at Microsoft.Crm.Application.Controls.PageManager.OnPreRender(EventArgs e) at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)</Data>
</EventData>
</Event>
I can not delete the record nor Deactivate it !
Now I relized I have a few more such records, and all I want is to filter them out an get rid of them for good !!
Please some help :(
Thanx.
I would suggest checking the database to see if the record does not actually exist.
E.g. search on the contact table for contactid = '69fa903e-f865-df11-b4ad-001ec9e8be31'.
If it returns a result, then the record definitely exists. If not then it doesn't. Either way something weird is going on. If you can demonstrate either, I would raise a ticket with Microsoft.
Also worth considering if you have any customisations, that might be interfering with the normal behavior of CRM.
Thanx James :)
You have actually gave me a great hint.
After observing the database I realized that these specific records were present in the ContactsBase table but for some reason (cant figure why) these same record IDs where missing in ContactsExtended.
That is why on the main view I was able to see these records (the view consisted of only fields from ContactsBase) but when actually opening the form it failed!
So creating these records with the missing IDs, in the ContactsExtended table - using the EXCEPT statement (see http://www.sqlusa.com/bestpractices2008/compare-tables/) - did the work :)

Attach a file to a notes document using SSJS

I am trying to attach a file to notes document, but I am getting the following error.
var doc:NotesDocument = DS_EmpDetails.getDocument();
var rtitem:NotesRichTextItem = doc.createRichTextItem("AttachmentField");
var Attachment:String = "C:\\Users\\karthick_m\\Desktop\\PDFIcon.jpg";
var emobj:NotesEmbeddedObject = rtitem.embedObject(NotesEmbeddedObject.EMBED_ATTACHMENT, "", Attachment, null);
doc.save();
I am getting the following error..
[TypeError] Exception occurred calling method NotesRichTextItem.embedObject(number, string, string, string) null
Thanks in Advance...
My Stack Trace
Stack Trace
javax.faces.FacesException: Error while executing JavaScript action expression
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:102)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:210)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:96)
com.ibm.xsp.controller.FacesControllerImpl.execute(FacesControllerImpl.java:250)
com.ibm.xsp.webapp.FacesServlet.serviceView(FacesServlet.java:206)
com.ibm.xsp.webapp.FacesServletEx.serviceView(FacesServletEx.java:189)
com.ibm.xsp.webapp.FacesServlet.service(FacesServlet.java:154)
com.ibm.xsp.webapp.FacesServletEx.service(FacesServletEx.java:137)
com.ibm.xsp.webapp.DesignerFacesServlet.service(DesignerFacesServlet.java:86)
com.ibm.designer.runtime.domino.adapter.ComponentModule.invokeServlet(ComponentModule.java:538)
com.ibm.domino.xsp.module.nsf.NSFComponentModule.invokeServlet(NSFComponentModule.java:1140)
com.ibm.designer.runtime.domino.adapter.ComponentModule$AdapterInvoker.invokeServlet(ComponentModule.java:803)
com.ibm.designer.runtime.domino.adapter.ComponentModule$ServletInvoker.doService(ComponentModule.java:758)
com.ibm.designer.runtime.domino.adapter.ComponentModule.doService(ComponentModule.java:527)
com.ibm.domino.xsp.module.nsf.NSFComponentModule.doService(NSFComponentModule.java:1124)
com.ibm.domino.xsp.module.nsf.NSFService.doServiceInternal(NSFService.java:513)
com.ibm.domino.xsp.module.nsf.NSFService.doService(NSFService.java:342)
com.ibm.designer.runtime.domino.adapter.LCDEnvironment.doService(LCDEnvironment.java:304)
com.ibm.designer.runtime.domino.adapter.LCDEnvironment.service(LCDEnvironment.java:261)
com.ibm.domino.xsp.bridge.http.engine.XspCmdManager.service(XspCmdManager.java:291)
com.ibm.xsp.exception.EvaluationExceptionEx: Error while executing JavaScript action expression
com.ibm.xsp.binding.javascript.JavaScriptMethodBinding.invoke(JavaScriptMethodBinding.java:126)
com.ibm.xsp.application.ActionListenerImpl.processAction(ActionListenerImpl.java:60)
javax.faces.component.UICommand.broadcast(UICommand.java:324)
com.ibm.xsp.component.UIEventHandler.broadcast(UIEventHandler.java:365)
com.ibm.xsp.component.UIDataPanelBase.broadcast(UIDataPanelBase.java:400)
com.ibm.xsp.component.UIViewRootEx.broadcast(UIViewRootEx.java:1490)
javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:307)
javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:428)
com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:94)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:210)
com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:96)
com.ibm.xsp.controller.FacesControllerImpl.execute(FacesControllerImpl.java:250)
com.ibm.xsp.webapp.FacesServlet.serviceView(FacesServlet.java:206)
com.ibm.xsp.webapp.FacesServletEx.serviceView(FacesServletEx.java:189)
com.ibm.xsp.webapp.FacesServlet.service(FacesServlet.java:154)
com.ibm.xsp.webapp.FacesServletEx.service(FacesServletEx.java:137)
com.ibm.xsp.webapp.DesignerFacesServlet.service(DesignerFacesServlet.java:86)
Use Upload control. The way you use SSJS code is working only for file already on server - you did not upload it.
The error message above may be wrong, but it states that the cause is that the 'rtitem' variable is null. Have you checked this in your code?
if (!rtitem) throw new java.lang.Exception("Uh oh!");

Encrypting datasource passwords: java.lang.SecurityException: Unauthenticated caller:null

I'm trying to encrypt my database password using a JBOSS security domain.
The datasource is defined in oracle-ds.xml as follows:
<datasources>
<local-tx-datasource>
<jndi-name>OracleDS</jndi-name>
<connection-url>jdbc:oracle:thin:#dbhost:1521:db</connection-url>
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<!-- app works fine when you use unencrypted password like this
<user-name>username</user-name>
<password>unencrypted_pass</password>
-->
<!-- Use the security domain defined in conf/login-config.xml for username and encrypted password-->
<security-domain>Encrypt-my-Password</security-domain>
....etc
The login-config.xml file contains this entry:
<application-policy name="Encrypt-my-Password">
<authentication>
<login-module
code="com.mycompany.global.er.util.ErSecureIdentityLoginModule"
flag="required">
<module-option name="username">databaseUsername</module-option>
<module-option name="password">232487h4873hf4</module-option>
<module-option name="managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=OracleDS</module-option>
</login-module>
</authentication>
</application-policy>
NB the ErSecureIdentityLoginModule is a class already used to encrypt / decrypt DB passwords in another application, where it works fine.
As soon as I started using this config the application throws an exception as follows when you try to access the datasource:
java.lang.SecurityException: Unauthenticated caller:null
org.jboss.security.integration.JBossSecuritySubjectFactory.createSubject(JBossSecuritySubjectFactory.java:92)
org.jboss.resource.connectionmanager.BaseConnectionManager2.getSubject(BaseConnectionManager2.java:687)
org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:495)
org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:941)
org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:89)
org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:92)
org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:111)
org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2101)
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1325)
org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)
org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:126)
javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:52)
javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:34)
com.mycompany.er.batch.data.DbHelper.createEntityManager(DbHelper.java:30)
com.mycompany.er.batch.data.DbHelper.createAndBegin(DbHelper.java:49)
com.mycompany.er.basman.HibernateTransactionFilter.doFilter(HibernateTransactionFilter.java:53)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
I downloaded the source code for jboss 5.0.1GA and debugged with TRACE enabled. There is an interesting stack trace produced:
2012-03-12 18-13-40:Login failure
javax.security.auth.login.LoginException: java.lang.NullPointerException
at org.jboss.resource.security.SubjectActions$AddPrincipalsAction.run(SubjectActions.java:101)
at java.security.AccessController.doPrivileged(Native Method)
at org.jboss.resource.security.SubjectActions.addPrincipals(SubjectActions.java:139)
at org.jboss.resource.security.ConfiguredIdentityLoginModule.login(ConfiguredIdentityLoginModule.java:98)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at javax.security.auth.login.LoginContext.invoke(LoginContext.java:769)
at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
at javax.security.auth.login.LoginContext$4.run(LoginContext.java:683)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)
at javax.security.auth.login.LoginContext.login(LoginContext.java:579)
at org.jboss.security.plugins.auth.JaasSecurityManagerBase.defaultLogin(JaasSecurityManagerBase.java:552)
at org.jboss.security.plugins.auth.JaasSecurityManagerBase.authenticate(JaasSecurityManagerBase.java:486)
at org.jboss.security.plugins.auth.JaasSecurityManagerBase.isValid(JaasSecurityManagerBase.java:365)
at org.jboss.security.plugins.JaasSecurityManager.isValid(JaasSecurityManager.java:160)
at org.jboss.security.integration.JBossSecuritySubjectFactory.createSubject(JBossSecuritySubjectFactory.java:9
0)
The NullPointerException refers to this line of code in org.jboss.resource.security.SubjectActions:
static class AddPrincipalsAction implements PrivilegedAction
{
Subject subject;
Principal p;
AddPrincipalsAction(Subject subject, Principal p)
{
this.subject = subject;
this.p = p;
}
public Object run()
{
subject.getPrincipals().add(p);
return null;
}
}
However this doesn't help much, and I can't understand what I'm doing wrong.
Help!
I have since got this working. I had to remove a shedload of optional jboss components but it's not 100% clear how I fixed it exactly. One possibility is that the password encryption was not correct - ie I was using the wrong library to encrypt it, so it wasn't being decrypted correctly.

Resources