Jul 27, 2016

Issues During Code Build in Eclipse

Problem

If you are facing issue during Build a project in Eclipse and you cannot see anything in Problems perspective of eclipse after you checkout project from SVN Repository.

Solution

Please follow the steps as below to successfully checkout the project and build in eclipse.
Note : We are not referring to ANT Build in eclipse.
Steps :
  1. Checkout the project from SVN repository. By giving correct SVN path.
  2. On the Select Wizard Screen on eclipse, select as Java Project.
  3. Give Name to the project and select current used JRE and click finish.
  4. After project is successfully check out, right click on the project and select "Properties".
  5. Select Java BUILD Path from Left Menu and click add Folders.
  6. Select all "Src" folders from all modules present in your Project.
  7. Click "OK".
  8. Instead of "Build Automatically" "Clean" Manual Build is Recommended.
  9. Now you can see problems in your perspective.
  10. Go Ahead and add specific libraries required for compilation.

Error Starting Dyn Admin on Prod. ( java.io.IOException: Cannot run program "javac")

Error

Error : The detailed exception is: java.io.IOException: Cannot run program "javac": CreateProcess error=206, The filename or extension is too long
atg.servlet.pagecompile.jsp11.JSPPageProcessor.javaToClass(JSPPageProcessor.java:421) [_DAS_slib_sclasses.jar:]

APPLIES TO:

Oracle Commerce Platform - Version 9.4 and later
Information in this document applies to any platform.

CAUSE

Above error is Java compiler error, where java compiler fails to compile.

SOLUTION

1. Follow the steps in sequence
  • Go to location "servers/atg_config/local_prod1a_cbsbuild/localconfig/atg/dynamo/servlet" in your code base.
  • Add folder pagecompile under servlet.
  • Add two files with name "ExtendedJhtmlPageProcessor.properties" and "PageProcessor.properties"
  • In Extend file add following code snippet
    $class = atg.servlet.pagecompile.jsp11.JSPPageProcessor
    javaCompilerClassName=atg.servlet.pagecompile.SunJavaSourceCompiler 
  • In PageProcessor.properties add following code
    javaCompilerClassName=atg.servlet.pagecompile.SunJavaSourceCompiler
  • Build your project again and restart the server.

java.lang.NoClassDefFoundError: com/sun/tools/javac/Main

error

JBWEB000309: type JBWEB000066: Exception report
JBWEB000068: message JBWEB000248: Servlet execution threw an exception
JBWEB000069: description JBWEB000145: The server encountered an internal error that prevented it from fulfilling this request.
JBWEB000070: exception
javax.servlet.ServletException: JBWEB000248: Servlet execution threw an exception
JBWEB000071: root cause
java.lang.NoClassDefFoundError: com/sun/tools/javac/Main
atg.servlet.pagecompile.SunJavaSourceCompiler.javaToClass(SunJavaSourceCompiler.java:110)
atg.servlet.pagecompile.jsp11.JSPPageProcessor.javaToClass(JSPPageProcessor.java:405)
atg.servlet.pagecompile.PageProcessor.compilePageClass(PageProcessor.java:2437)
atg.servlet.pagecompile.PageProcessor.getPageInfo(PageProcessor.java:1787)
atg.servlet.pagecompile.jsp12.Jsp12PageProcessor.getPageInfo(Jsp12PageProcessor.java:324)
atg.servlet.minimal.MinimalServletContainer.compileServlet(MinimalServletContainer.java:153)
atg.servlet.pagecompile.PageCompileServlet.service(PageCompileServlet.java:306)



APPLIES TO

Oracle Commerce Platform - Version 9.4 and later
Information in this document applies to any platform.


SOLUTION

1. Follow the steps in sequence

  • create folder structure under your jboss/modules as "com\sun\tools\javac\main"
  • Copy and paste attached one file to this location. "module.xml" & Copy tools.jar from jre/lib location on your system.module.xml
  • Copy "tools.jar" to jboss_home/standalone/deployments/<prod_server>.
  • Copy "tools.jar" to code base location "/<module>/<sub-module>/lib"
  • Go to code base location "<project>/<module>/META-INF" and open file "MANIFEST.mf"
  • Add "lib/tools.jar" to ATG-Class-Path in the file.
  • Stop Servers if running & Re-Build the ear's.
  • Restart the server and make sure <module>.<sub-module> is started with parameters in Server Startup.
  • Similar way can fix Pub if there is same error.
  • create folder structure under your jboss/modules as "com\sun\tools\javac\main".

Could not load definitions from resource net/sf/antcontrib/antcontrib.properties

error

When click on build.xml and running ant build. Getting following error :
[taskdef] Could not load definitions from resource net/sf/antcontrib/antcontrib.properties. It could not be found.

APPLIES TO:

Oracle Commerce Platform - Version 9.4 and later
Information in this document applies to any platform.

Solution

Please follow the steps below to get rid of above issue.
Important steps to be followed and are mandatory.

  1. Install ANT on to your machine drive.
  2. Make sure class path for ant is set to ANT_HOME
  3. In lib folder of ANT_HOME copy jar file names "ant-contrib-0.6".
  4. In build.xml at line number <exact line number> where it say's "
    <taskdef resource="net/sf/antcontrib/antcontrib.properties">
    <classpath>
    <pathelement location="" /> <taskdef>
  5. Give correct location of jar files. e.g "C:\apache-ant-1.8.4\lib\ant-contrib-0.6.jar".
  6. Try running ANT build again.

java.io.StreamCorruptedException: unexpected block data

Error

We were getting below error when we try to start the ACC in our local VM
java.io.StreamCorruptedException: unexpected block data
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1364)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1990)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1915)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
at atg.core.util.UnsynchronizedHashtable.readObject(UnsynchronizedHashtable.java:623)
at sun.reflect.GeneratedMethodAccessor42.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream

APPLIES TO:

Oracle Commerce Platform - Version 9.4 and later
Information in this document applies to any platform.


Cause

Some of the SQLrepositories were modified with custom properties descriptors and ACC is not able to find them while start up.

SOLUTION

Please configure the application module with the following entries in the module's MANIFEST.MF file:
ATG-Client-Class-Path: A listing of the jar files that will added to the ACC client's classpath
Name: The filename of each jar file entry in the ATG-Client-Class-Path that needs to be downloaded
ATG-Client-Update-File: A true or false flag whether or not the filename should be downloaded by the ACC
ATG-Client-Update-Version: Optional version string used to force the ACC to update the specified filename
If you see the MANIFEST.MF file in PCIencryption module and it doesn't have the above entry. So please add the below 3 entries in the MANIFEST.MF file of PCIencryption Module.
ATG-Client-Class-Path: bin/
Name: bin/
ATG-Client-Update-File: true
ATG-Version is not required.  Do a build and start the server and try to access ACC through script or dyn/admin . You should be able to access it.

SEVERE: Caught an exception while invoking method 'run' on object 'BaselineUpdate'

Error:

Getting following error during ./basline_update.sh

Error : 

[[

8| Dgidx.cleanDirs();
9|
10| // run crawl and archive any changes in dvalId mappings
11| CAS.runBaselineCasCrawl("CBS-last-mile-crawl");
12| CAS.archiveDvalIdMappingsForCrawlIfChanged("CBS-last-mile-crawl");
13|
14| // archive logs and run the indexer

]]

[05.14.16 07:48:39] SEVERE: Caught an exception while invoking method 'run' on object 'BaselineUpdate'. Releasing locks.

Caused by java.lang.reflect.InvocationTargetException
sun.reflect.NativeMethodAccessorImpl invoke0 - null
Caused by com.endeca.soleng.eac.toolkit.exception.AppControlException
com.endeca.soleng.eac.toolkit.script.Script runBeanShellScript - Error executing valid BeanShell script.
Caused by com.endeca.soleng.eac.toolkit.exception.CasCommunicationException
com.endeca.eac.toolkit.component.cas.ContentAcquisitionServerComponent startBaselineCasCrawl - Error starting baseline crawl 'CBS-last-mile-crawl'.
Caused by com.endeca.cas.wsdl.CrawlNotFoundFault
sun.reflect.NativeConstructorAccessorImpl newInstance0 - null

[05.14.16 07:48:39] INFO: Released lock 'update_lock'.


APPLIES TO:

Oracle Commerce Platform - Version 10.2 and later
Information in this document applies to any platform.

CAUSE

Dimension Values are not rightly configured and imported into CAS components. Which results with above error during execution of baselineUpdate.sh on endeca APP.



SOLUTION

Note:  Exercise caution when directly modifying the versioned database schema.  For assistance identifying this problem and implementing the solution, please open an SR with Oracle Support.

1. Follow the steps in sequence

  • Check you have Crawler available at http://localhost:8500 with the same name. e.g. <app>-last-mile-crawl.
  • Generally this error occurs if you haven't initialized services.
  • After deploying application to specified folder with help of deploy.xml
  • Make sure you have <app>-data.xml and <app>-dimvals.xml available at location /test_data/basline folder.
  • Goto application_directory/control and execute
    1. ./initialise_services.sh
    2. ./import_site.sh
    3. execute load_basline_test_data.sh
    4. ./baseline_update.sh
  • Your issue will be resolved.



ENDECA_MDEX_ROOT is required for this component,but eac.properties

Error

Caused by: An error occurred while trying to start the component: ENDECA_MDEX_ROOT is required for this component,but eac.properties does not contain a valid ENDECA_MDEX_ROOT definition.: ENDECA_MDEX_ROOT is required for this component,but eac.properties does not contain a valid ENDECA_MDEX_ROOT definition.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at java.lang.Class.newInstance(Class.java:374)
at org.apache.axis.encoding.ser.BeanDeserializer.(BeanDeserializer.java:104)
at org.apache.axis.encoding.ser.BeanDeserializer.(BeanDeserializer.java:90)
at com.endeca.eac.client.EACFault.getDeserializer(EACFault.java:75)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)



Cause

This is problem is because one of MDEX properties in eac.properties file is missing or overwritten in installation.

SOLUTION

Please follow the steps below
  1. Navigate to <endeca_installation> directory.
  2. Search for eac.properties file.
  3. Check each file with MDEX environment variable and update the property with correct path to MDEX with version directory. eg. C:/endeca/MDEX/11.1

Export / Import Endeca App between Different Environments

APPLIES TO:


Oracle Commerce Platform - Version 10.2 and later
Information in this document applies to any platform.

Export endeca Application Steps

1. Record Store - Click here to get more details. This Step can be optional if baseline triggers using /atg/commerce/endeca/index/ProductCatalogSimpleIndexingAdmin Component

2. Dimension Value Id Manager - Navigate To CAS Bin folder and run following commands to export
CAS_Installation_Path/CAS/11.1.0/bin->./cas-cmd.[bat|sh] exportDimensionValueIdMappings -m <> -f /home/atg/dimvalid.csv


3. Endeca Pipeline - Copy Endeca_App/config/mdex folder

4. Editors Config - Copy Endeca_App/config/ifcr/configuration/tools/xmgr folder

5. Workbench Application - Navigate To Endeca Application control folder and run following commands to export content

       <>/control->./runcommand.[bat|sh] IFCR exportApplication
This would generate the zip/exploded folder.


6. Index-Config - Navigate To Endeca Application control folder and run following commands to export index-config.json
     <>/control->./index_config_cmd.[bat|sh] get-config -o all-File_Path/index-config.json



Import ENDECA APPLICATION STEPS

1. Record Store Click here to get more details. This Step can be optional if baseline triggers using /atg/commerce/endeca/index/ProductCatalogSimpleIndexingAdmin Component.

2. Dimension Value Id Manager - Run below command to import dimension values
/CAS/11.1.0/bin->./cas-cmd.[bat|sh] importDimensionValueIdMappings -m <> -f /home/atg/dimvalid.csv

3. Endeca Pipeline - Use the backup of <>/config/mdex folder and move pipeline.

4. Editors Config - Copy editors_config from step 5 and change host and post information based on environment under each json file and run the following command
         <>/control -> set_editors_config.[bat|sh]

5. Index-Config - Run below command to import index-config.json
<>/control->./index_config_cmd.[bat|sh] set-config -o all -f File_path/index-config.json


6. Endeca Baseline Update-  Run below Command

      <>/control -> ./baseline_update.[bat|sh]

7. Workbench Content - Run below command to import workbench content
        <>/control->./runcommand.sh IFCR importApplication <>

8. Promote Content - Run the following command to promote content from Authoring to Live. Promote content can be run the Workbench as well.
           <>/control -> ./promote_content.[bat|sh]


    Important step to be performed in end

    In the Last Do base line indexing from Store Dyn/admin from ProductCatalogSimpleIndexingAdmin component. This will help in creating exact dim mapping , data and dim vals for endeca schema. These files will not be visible for you to check the mappings.