ClassNotFoundException:com.microsoft.sqlserver.jdbc.SQLServerDriver after migration to liferay 7 from liferay 6.2 - liferay-7

I get below error in console when deploying each portlet after migration to liferay 7 which was working fine with liferay 6.2
ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver cannot be found by MAIPF_MyAccount-portlet_7.0.0.1
SQLException: No suitable driver found for jdbc:jtds:sqlserver://IDPLaptop/MAIPF2012_dev_VR7

My guess is that you fell into a common issue I keep seeing on StackOverflow when people try to upgrade to Liferay 7: libraries within the server's lib are not visible for all portlets.
With the ability to code OSGi modules,if one moves their portlet to an OSGi bundle, they need to keep track of the dependencies that module require.
As the jar you are using is not a bundle, you will need to create a uber bundle or use compileInclude to create a fat jar for your module.

Liferay 7, out of the box, does only support open source databases. As you state that you're using Service Builder, you might need to install Antonio's SQLServer integration or move to the commercial offering, Liferay DXP.
Check Victor's answer as well. I commonly use open source databases and DXP anyways, so the nitty-gritty-details that are hidden here are only my theoretical knowledge, I rarely get to experience this in practice.

Related

Eclipse unable to generates classes while using AWS SWF

I am following hello world application of Amazon Web Services Simple Workflow Service. According to description #Activities annotation should have been able to generate two classes GreeterActivitiesClient and GreeterActivitiesClientImpl. But these classes has not been generated.
I have Enable annotation processing in project properties. I am using Eclipse Mars with Jdk 1.8. I have also installed AWS toolkit for eclipse, aspectj.
Can someone see where the problem is?
Some versions of Eclipse, (notably Mars and Neon), may fail to fetch the latest artifacts due to a bug in old versions of the Oomph plugin. To work around this issue:
Make sure that you’re using https://aws.amazon.com/eclipse/site.xml as the AWS Toolkit for Eclipse update site.
Delete the ~/.eclipse/org.eclipse.oomph.p2/cache/ directory to remove cached content.
Install the latest version of Oomph (Eclipse Installer).
Reference: Set up the Toolkit

jBPM and JBoss web app

Ok I'm having quite some issues setting both jbpm and jboss working together...something as simple as running the jbpm process from a servlet is trunning to be a pain and all because jBoss can't find classes.
I made a Dynamic Web Project and didn't use Maven project so things are cleaner...and because it should work.
I just want to load a jbpmn2.0 from the repository in a servlet and run it using a WorkItemHanlder....but I get this:
java.lang.ClassNotFoundException: org.drools.runtime.process.WorkItemHandler
For some reason jBoss can't find a class from jBPM that should work on JBoss. What I did....and I think it's not the right solution...was add the knowledge-api.jar to the WEB-INF/lib. Although I can now deploy the app when I try to run it I get:
Error Unable to instantiate service for Class 'org.drools.builder.KnowledgeBuilderFactoryService'
I Honestly don't get why is it so hard to make a Jboss Web app using jBpm.
You need to make sure all dependencies are on your classpath, this is the same for all Java applications (not just jbpm) and application servers (not just JBossAS).
Which jars did you add? Depending on which features you are using, there could be quite a number of jars that you need to add. One option would for example would be to extract the jars in the jBPM runtime zip that is part of the jBPM downloads into your WEB-INF/lib.
If you use Maven, you would be able to automatically derive all required jars.
Kris

cannot find AppservRealm class in NetBeans6.9 with glassfish3 Community Edition

I am trying to write custom Realm class, but cannot import package which contains it. May be its because of Community version of glassfish which does not contain specific tools for JAAS ? But I cannot find any mention about it in Internet or Oracle site.
I also cannot find ProgrammaticLogin class.
P.S. I use JavaEE1.4 because need use BMP beans, but JAAS is being included in EE since 1.3 as addons and since 1.4 as part.
I have GlassFish Server Open Source Edition 3.1 Build 43 installed. I was able to find com.sun.appserv.security.AppservRealm in the file glassfish3/glassfish/modules/security.jar.
ProgrammaticLogin is in the same jar.
HTH

Cannot find OpenPortal Portlet Container 2.x when creating a new server runtime environment in eclipse

I just started learning portlet and got stuck in the first place. I have installed JavaEE 6 SDK, Eclipse Helios and GlassFish Server 3.0.1. I also successfully configured OpenPortal Portlet Container (OPC) for GlassFish by running command:
java -jar portlet-container-configurator.jar
The problem come up when I wanted to create a new server runtime environment of OPC, there was no "OpenPortal Portlet Container 2.x" node like the tutorial said. I googled and found that I needed to install Eclipse Portal Pack but the link was dead.
Any suggestion, please?
Best Regard.
If you want to develop portlets, I strongly recommend downloading Apache Pluto instead of using the open portlet container; you can download a version of Tomcat bundled with Pluto from their site: http://portals.apache.org/pluto
Actually, Pluto has a few quirks that you need to get past (for example, it wants you to run an 'assembly' step to add some entries to your web.xml) but once you do it is probably the best way. You could also try Liferay or JBoss' GateIn for development, but if you are ultimately targeting a vendor supplied platform like WebSphere, you might find that these actually have features that aren't as portable, whereas Pluto is really just a simple implementation of the portlet spec.
I have found the .jar file on Internet. Thanks for watching.

Eclipse EAR module publish log

I am using weblogic worshop to develop my spring based application. Basically it takes lot of time to publish the application to weblogic server. Is there any way to find out what’s going on when eclipse try to build and deploy the project? Basically does it maintain any log file?
Thanks ,
Manoj
Weblogic does a stupid thing according to my experience. If you deploy some WAR, it extracts the libraries in it, and does some analysis in them. You can avoid this behaviour by removing the "static" (not changed by you during work) libraries from the war during development. After removal, add them to system classpath of the domain. It will publish and start a lot faster.
You will find better support for developing Spring applications for WebLogic Server if you migrate to Oracle Enterprise Pack for Eclipse. Workshop is legacy software that is no longer being actively developed. Using Workshop is only necessary for those developing with the deprecated Apache Beehive framework.
http://www.oracle.com/technetwork/developer-tools/eclipse/overview/index.html
OEPE includes a much newer publisher implementation, so you may find your issue resolved. If not, please post to OEPE forum for direct access to people who can answer you question.
Cannot post a forum link, but you can find it from the above URL or via Google.
Thanks Konstantin and Gabor for replying to my question.
Konstantin - I am using Oracle Weblogic workshop 10.3 and I am restricted to use this IDE only.I guess it has OEPE correct me if I am wrong.Also I tried the FastSwap action but everytime I save the changes to a java file the server says -'Publish' and I have to republish the entire application which is taking lot of time.
Thanks,
Manoj