Showing posts with label development开发. Show all posts
Showing posts with label development开发. Show all posts

2025-12-16

LHDN MyInvoice Error - Validation Error - After added jasperreports 7.0.3


Fixed by exclude <artifactId>jackson-dataformat-xml</artifactId>

<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports-pdf</artifactId>
<version>7.0.3</version>

<exclusions>
<!-- 🚨 Breaks JSON serialization -->
<exclusion>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
</exclusion>
</exclusions>
</dependency>




For Error: 
400 Bad Request on POST request for "https://preprod-api.myinvois.hasil.gov.my/api/v1.0/documentsubmissions": "{<EOL> "error": {<EOL> "code": "ValidationError",<EOL> "message": "JSON is not valid",<EOL> "target": "submission",<EOL> "details": [<EOL> {<EOL> "code": "ValidationError",<EOL> "target": "submission",<EOL> "message": "JSON is not valid"<EOL> }<EOL> ]<EOL> }<EOL>}"

after added jasperreports 













LHDN MyInvoice - preprod.myinvois.hasil.gov.my

 


Document Date
    - max 3 days earlier

Business activity description
    - min length 1 character
oasis.names.specification.ubl.schema.xsd.commonbasiccomponents_21.IndustryClassificationCodeType
com.helger.xsds.ccts.cct.schemamodule.CodeType.setName(String)









LHDN MyInvoice Error - Validation Error - Business activity description is required

 

Validation Error:
- Business activity description is required (Invoice.AccountingSupplierParty.Party.IndustryClassificationCode[@Name=''])

LHDN MyInvoice Error

{
"invoiceCodeNumber": "INV000021",
"error": {
"code": "2",
"message": "Validation Error",
"target": "INV000021",
"propertyPath": null,
"details": [
{
"code": "CF701",
"message": "Business activity description is required",
"target": "BusinessActivityDescription",
"propertyPath": "Invoice.AccountingSupplierParty.Party.IndustryClassificationCode[@Name='']",
"details": null
}
],
"propertyName": null,
"errorCode": "2",
"error": "Validation Error",
"errorMs": "Validation Error",
"innerErrors": null,
"formattedErrorMessage": "Validation Error:\n- Business activity description is required (Invoice.AccountingSupplierParty.Party.IndustryClassificationCode[@Name=''])"
}
}

oasis.names.specification.ubl.schema.xsd.commonbasiccomponents_21.IndustryClassificationCodeType
com.helger.xsds.ccts.cct.schemamodule.CodeType.setName(String)









2023-08-19

git svn clone error An error occurred during SSL communication

 

"git svn clone" APR does not understand this error code: ra_serf: An error occurred during SSL communication at ...\git-svn line 392








2023-04-06

Spring Boot @Scheduled only run 1 thread.

 

Else use fixedRate


Reference URL: https://stackoverflow.com/a/35094357/6462295

But I'm not sure will it queue up the Spring schedule...( yet to get a way to verify... :-\ )

But tested, definitely 


Implementation with @Scheduled with cron

Reference URL: https://stackoverflow.com/a/74900033/6462295

java.util.concurrent.locks.ReentrantLock




https://stackoverflow.com/a/74900033/6462295









[Solved] - object to JSON string exception


Relevant tags:
  1. Spring Boot 2.7.6
  2. JUnit 5
  3. JPA
 

Error Message:

com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class org.hibernate.proxy.pojo.bytebuddy.ByteBuddyInterceptor and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: com.yourcompany.entity.Table$HibernateProxy$3enmhWuU["hibernateLazyInitializer"])


Reference URL: https://stackoverflow.com/a/67354659/6462295

Adding annotation below to your entity.

@com.fasterxml.jackson.annotation.JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
















[Solved] - LazyInitializationException: could not initialize proxy

 


org.hibernate.LazyInitializationException: could not initialize proxy [com.yourcompany.entity.Table#123456] - no Session


relevant tags:
  1. Spring Boot 2.7.6
  2. JUnit 5
  3. JPA

Resolved by both below:

1. Adding annotation below to your test function:
Reference URL: https://stackoverflow.com/a/72863346/6462295
@org.springframework.transaction.annotation.Transactional(readOnly = true)





2. Adding configuration into application.properties
Reference URL: https://stackoverflow.com/a/38690930/6462295

spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true






2023-03-08

SVN with eclipse 2022-12 R & 2023-06 R




20230801_pm112144
Rerun all Phase #1, #2 for: Eclipse IDE 2023-06 R Packages

Checkout old project successfully after resolved old SSL issue by removing "TLSv1, TLSv1.1, ".




Check on 20230926_pm023105: 2023-09

Last check on 20230308_am120205: still with version 

Installer 2022‑12 R



Also: https://download.eclipse.org/technology/subversive/4.8/release/latest/



Phase 1 - Installation of the Subversive Plug-In



Ouch, Install Remediation Page...









Phase 2 - Installation of Subversive SVN Connectors











After restart and trying to check out out project from old SVN repo.









resolved by: remove "TLSv1, TLSv1.1"


Reference URL: https://stackoverflow.com/a/71050085

You can set it in JRE inside SoapUI (if you are using it): Remove "TLSv1, TLSv1.1" from "jdk.tls.disabledAlgorithms" property in file ${soapui_home}/jre/conf/securityjava.security.




File Path at: .\Eclipse\eclipse-jee-2022-12-R-win32-x86_64\plugins\org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_17.0.6.v20230204-1729\jre\conf\security\java.security





After removed "TLSv1, TLSv1.1, " from file: java.security

Then restart eclipse








SCM Connector


Attempt #1



scm | Eclipse Plugins, Bundles and Products






Failed:




Attempt #2:




Failed:

An error occurred while collecting items to be installed

session context was:(profile=epp.package.jee, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=).

No repository found containing: osgi.bundle,com.ibm.icu.base,58.2.0.v20170418-1837

No repository found containing: osgi.bundle,javax.transaction,1.1.1.v201105210645








Attempt #3

subclipse


https://subclipse.github.io/updates/subclipse/4.3.x/







Trust Unsigned:








Found subclipse will have scm connector as printscreen below, although as SVN in dropdown list.



==========



Subversive:


Project physical folder named by SVN url.

Pros:



Cons:
  1. after check out from SVN, u hv to "convert" into maven project by right click on project, then look for Configure > Convert to Maven Project.



Subsclipse:


Project physical folder named by eclipse config during your project initialization.

Pros:
  1. direct check out from repo, with proper config for maven project
  2. Crucial feature for huge project: Show Revision Graph.

Cons:
  1. u can't revert file during commit screen, u hv leave commit window/screen, go back to project explorer, then right click your project, looks for Team > Revert to trigger revert process.






Archive remote info:

Installation Instructions

Here you can find instructions on how to install Subversive using different types of Subversive distributions.

Introduction

The Subversive (SVN) installation consists of installing the Subversive plug-in and a Subversive SVN Connector. The Subversive plug-in is developed as an Eclipse official project with an EPL license and is distributed from the Eclipse website. A Subversive SVN Connector uses a SVN library to communicate with SVN repositories. Currently, there is only the connector which uses the SVNKit library. This library is developed as open-source project, but since its license is not EPL-compatible, the whole connector has to be distributed from an external website.

In order to use Subversive, you have to install the Subversive plug-in and the connector that is compatible with your operating system (OS) and the used SVN version.

Phase 1 - Installation of the Subversive Plug-In

You can install Subversive using its online or archived update site.

Phase 2 - Installation of Subversive SVN Connectors

Once the Subversive plug-in is installed and Eclipse is rebooted, Subversive automatically displays the dialog that shows Subversive SVN Connectors compatible with the installed version of the plug-in. Alternatively, you can install Subversive SVN Connectors from online and archived update sites for connectors.

  • Run Eclipse and select Help > Install New Software... from the main menu.
  • In the Install dialog that appears, press the Add... button and enter the URL of the following update site: https://osspit.org/eclipse/subversive-connectors/.
  • Select the required features to install and follow the standard plug-in installation procedure. Reboot Eclipse after installation is complete.




















2022-12-13

Solved - ClassNotFoundException: org.springframework.boot.configurationprocessor.json.JSONObject

 
Exception:
java.lang.ClassNotFoundException: org.springframework.boot.configurationprocessor.json.JSONObject



Artifact below won't be included into maven install

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>



replaced

org.springframework.boot.configurationprocessor.json.JSONObject

by

org.json.JSONObject



 

2022-12-06

how to get mylyn task for eclipse

 



how to get mylyn task for eclipse



https://www.eclipse.org/mylyn/downloads/

Add URL into eclipse: http://download.eclipse.org/mylyn/releases/latest






Tried, outdate, not working.
https://people.cs.vt.edu/~gback/eclipse/configuration/org.eclipse.osgi/bundles/171/1/.cp/Mylyn/FAQ/Installation.html





2022-10-14

SVN with eclipse 2022-09




 



Attempt# 1 - failed:

Name: SVN

Location: http://download.Eclipse.org/technology/subversive/4.0/update-site/


reference URL: https://www.softwaretestinghelp.com/eclipse/configuring-svn-and-eclipse/



Attempt# 2


Last comment in: https://bugs.eclipse.org/bugs/show_bug.cgi?id=576745

https://www.eclipse.org/subversive/installation-instructions.php



Looks alright.


resolved by: remove "TLSv1, TLSv1.1"


Reference URL: https://stackoverflow.com/a/71050085

You can set it in JRE inside SoapUI (if you are using it): Remove "TLSv1, TLSv1.1" from "jdk.tls.disabledAlgorithms" property in file ${soapui_home}/jre/conf/securityjava.security.




Path at: .\Eclipse\eclipse-jee-2022-12-R-win32-x86_64\plugins\org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_17.0.6.v20230204-1729\jre\conf\security\java.security








For later versions: 




 

2022-10-13

Resolved - Unable to make field private final java.util.Comparator java.util.TreeMap.comparator accessible

 


Error:
Unable to make field private final java.util.Comparator java.util.TreeMap.comparator accessible: module java.base does not "opens java.util" to unnamed module @3d201878



By referring to:
https://stackoverflow.com/a/72616180



Added into <properties> section in pom.xml:

<maven-war-plugin.version>3.3.1</maven-war-plugin.version>
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>





Added on 20230823_pm092210:
To resolve:
- Maven Configuration Problem - java.lang.ExceptionInInitializerError
- Unable to make field private final java.util.Comparator








2022-08-22

Corrupted GitLab 15.2 was back to online.

 




GitLab 15.2 was corrupted due to whatever reasons...


finally service back to running by:

sudo gitlab-ctl reconfigure
















2022-08-03

Resolved: has been injected into other beans in its raw version as part of a circular reference

 
Resolved by referring to:
  1. https://www.baeldung.com/circular-dependencies-in-spring#2-use-lazy
  2. https://blog.51cto.com/u_13478207/3336383



has been injected into other beans in its raw version as part of a circular reference, but has eventually been wrapped. This means that said other beans do not use the final version of the bean. This is often the result of over-eager type matching - consider using 'getBeanNamesOfType' with the 'allowEagerInit' flag turned off, for example.



structure to tell the story...

@Service
public class MainService{

    @Autowired
    private ServiceParent
}

@Service
public class ServiceParent{

    @Autowired
    private ServiceChild
    
}

@Service
public class ServiceChild{

    @Autowired
    private ServiceParent
    
}



then will hit the exception while maven run the application locally/at server.





@Service
public class ServiceChild{

    @Autowired
    @Lazy
    private ServiceParent
    
}
















2022-07-12

eclipse added hotkey for svn actions are not working.


It may be due to this breaking change in Eclipse 3.6:

http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.platform.doc.isv/porting/3.6/incompatibilities.html?view=co#objectContribution

EDIT:

Looks like it definitely is. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=309074. Here's the fix:

In the "Customize Perspective" dialog, go to the "Command Groups Availability" tab and check "Team" and "SVN".

In Eclipse Mars.2 (4.5.2) this is under Window->Perspective->Customize Perspective... dialog, "Action Set Availability" tab. (Try to restart Eclipse if it doesn't work after you change it). Customize Perspective dialog screenshot







Right click on current perspective:




Click on Customize...

Click on "Action Set Availability"



From Available action sets column:



Tick / Check the SVN checkbox, then Apply and Close.

Tested without restart eclipse, the hot key is working now.

























2022-07-06

Resolved - @PreUpdate not working in JUnit test.

 



javax.persistence.PreUpdate





object need to be "dirty" to trigger...


obj.setColumn01("text");
repo.save(obj);


then make obj "dirty" before save to trigger @PreUpdate


obj.setColumn01("new text);
repo.save(obj);




Solution

As you said, the callback method is called the second time, if the entity is detached or fetched again from DB.

I cannot explain it exactly, but can think of the scenario described here, when no dirty fields are identified before the second save() call and thus the @PreUpdate callback not called. Or it may be simply a bug within your version of EclipseLink.

2022-07-01

Setup local Keycloak for development

 




https://stackoverflow.com/a/72600716






Keycloak 18.0.2 doesn't required "/auth" as endpoint


new config:

keycloak.auth-server-url=http://localhost:8080

would be enough




We are sorry... page not found... error


Mandatory Config in Keycloak



while hitting we are sorry page not found error

was using http://localhost:8080/auth for keycloak.auth-server



while testing with https://www.keycloak.org/app/

hit error if didn't fill: https://www.keycloak.org/app/
to:

Root URL: https://www.keycloak.org/app/




If config below never in place, will trigger error: Invalid parameter: redirect_uri


Valid Redirect URIs: *








Respective Keycloak role in Spring Boot authRole config

 





keycloak.securityConstraints[0].authRoles[0]=xyz





Respective config in Keycloak (18.0.2)

In user Role mappings:





subclipse.tigris.org no longer available...

 

http://subclipse.tigris.org/update_1.10.x
http://subclipse.tigris.org/update_1.6.x

above are not reachable...








Found a post telling to get from Eclipse Marketplace

Help > Eclipse Marketplace...





But during installation, but still retrieve resource from:

- 











2022-04-20

JasperReport, always get blank PDF?

 
line below with new JREmptyDataSource() will get pdf as per expected.

jasperPrint = JasperFillManager.fillReport(report, jrParam, new JREmptyDataSource());



vs

where as using static _DATA_SOURCE_EMPTY, will always get blank pdf.

private static JREmptyDataSource _DATA_SOURCE_EMPTY = new JREmptyDataSource();

...
jasperPrint = JasperFillManager.fillReport(report, jrParam, _DATA_SOURCE_EMPTY);
...










Google Referrals