My Shitty Code

Embracing the Messiness in Search of Epic Solutions

Home

Welcome to my encyclopedia of shitty code!

  • java.lang.OutOfMemoryError: PermGen space When Running Maven on IntelliJ

    NOTE This is not a Groovy related problem, but I’m using it to illustrate my problem and solution here. PROBLEM I recently tried mixing some Groovy code into my existing JEE project. I created a simple POGO that looks as sophisticated as this:- Then, I configured one of my controllers to invoke that POGO:- After […] Read More…

  • “tree” Command on Mac OS X

    So, I have been drawing the ASCII file structure tree by hand lately… and that is dumb and time consuming. After digging around, I found a great way to do so. First, if you don’t have Homebrew, install it first. Run the following command to install the tree command:- Now, you can run the following […] Read More…

  • java.lang.NoSuchMethodError: javax/persistence/OneToMany.orphanRemoval()Z

    PROBLEM You configure Hibernate using annotations and set orphanRemoval property in @OneToMany. When you run the application, the application server throws the following exception:- In my case, I’m getting this exception when I run on Websphere Application Server (WAS) 7.5. SOLUTION The orphanRemoval property in @OneToMany requires JPA 2.x to work. If you already have […] Read More…

  • Understanding How Maven Dependencies Work

    Let’s assume we have the following dependencies:- In this example, both dbunit and spring-core have a dependency on commons-logging, but they rely on a different version:- Based on the above configuration, what version of commons-logging does Maven choose? If your answer is v1.1.1, then you are absolutely right…. that you need to read the Maven […] Read More…

  • The message with Action ” cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher

    PROBLEM You get this error message when invoking a web service:- org.springframework.ws.soap.client.SoapFaultClientException: The message with Action ” cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the […] Read More…

  • Cannot process the message because the content type ‘application/soap+xml; charset=utf-8’ was not the expected type ‘text/xml; charset=utf-8’

    PROBLEM You are getting this exception when invoking a web service:- org.springframework.ws.client.WebServiceTransportException: Cannot process the message because the content type ‘application/soap+xml; charset=utf-8’ was not the expected type ‘text/xml; charset=utf-8’. [415] SOLUTION You are using the wrong SOAP version. SOAP v1.1 uses text/xml while SOAP v1.2 uses application/soap+xml. If you are using Spring Web Services, add […] Read More…

  • Using Spring Web Services and JAXB to Invoke Web Service Based on WSDL

    There are several ways to consume a web service based on a WSDL from Java. After trying a couple of approaches, I’m currently leaning towards Spring Web Services and JAXB. The biggest advantage of using both Spring Web Services and JAXB to consume a web service is the flexibility to change the web service URL […] Read More…

  • Configuring Quartz Scheduler to Run in Clustered Environment

    The goal of running a Quartz job in the clustered environment is NOT to have duplicate running jobs. The triggered job should run just one time regardless of the number of nodes in the clustered environment. Download Quartz and extract the file. Navigate to quartz-x.x.x -> docs -> dbTables and run the database SQL script […] Read More…

  • Configuring Remote UPS Shutdown on Mac OS X

    PROBLEM I have APC Smart-UPS SMT1500. It contains a SmartSlot that accepts a network management card that allows the UPS to be connected to the switch (or router) instead of plugging the USB cable from the UPS to a computer. That said, I also have APC AP9630 UPS Network Management Card 2. My goal is […] Read More…

About Author

This author has 20+ years of experience in software engineering and cloud engineering. In an industry where knowledge becomes obsolete in the next three months, he learns anything that crosses his path with no mercy. He codes Java while drinking Espresso and writes Spock specifications while listening to Groovy beats. He masters Google Cloud Platform just like he masters the art of predicting the movement of dark clouds over his backyard, where 60% of the time, he is right every time.

This author suffers from the Dunning-Kruger effect, where he overestimates his competence and underestimates his ignorance. Technology buzzwords never scare him, for he does not know what to be afraid of in the first place. GCP, GCS, GCR, GKE, GWT, JWT… they all sound the same to him. This author is a jack of all trades but a master of none. He writes like he knows all the answers, yet he googles for better solutions from elsewhere. He fakes it until he makes it, and if he doesn’t, that’s okay because he has the attention span of a squirrel.

By now, you should know this author is full of shit, and he apologizes in advance if you are trying to solve your company’s real problems with his shitty solutions.