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

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

Related

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

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.

Netbeans wizard for JSF pages doesn't recognize TomEE 1.6 to have Web Profile support

I am creating a Java EE 6 application with the help of Netbeans 8.0 and TomEE 1.6. I have successfully added the server to netbeans and even generated some entity classes. I am currenlty trying to generate some JSF pages using the Netbeans wizard. However I get the following message
Cannot be generated for Java EE 6 sources wihtout server with complete Java EE 6 Web profile support (at least EJB Lite support).
I am using TomEE 1.6.0.2 plus
The problem is Netbeans 8 has a bug in which it fails to find the tomee-common-[version].jar in the [TomEE]/lib directory.
The solution is to simply rename the jar file to an older version.
For example, you have [TomEE]/lib/tomee-common-1.6.0.2.jar or [TomEE]/lib/tomee-common-1.7.1.jar. Rename these files to [TomEE]/lib/tomee-common-1.6.0.jar
This should sort you out :)
you can use tomcatEE 1.7.2 with a few small changes
you find here:
http://zarnisfd.blogspot.com/
I think this also applies to TomEE 1.6
According to the following sites:
http://forums.netbeans.org/ntopic48005.html
https://netbeans.org/bugzilla/show_bug.cgi?id=210835
Tomcat does not support EJB's therefor you would need to use an enterprise server that at least supports EJB Lite. One such server would be GlassFish

Unable to find interface javax.transaction.UserTransaction;

I am trying to setup a new Netbeans project with JPA. The Java SDK version is 1.5.0_22-b03 and J2EE version is J2EE 1.4.I am using TOPLINK Essentials for JPA.
Going by javadoc javax.transaction.UserTransaction interface comes with J2EE 1.4.
Then why it's not able to find javax.transaction.UserTransaction?
The JPA 1.0 specification is meant to cater to Java EE 5 containers and not J2EE 1.4 containers (unless the same also support EJB 3.0 like the erstwhile OC4J containers from Oracle). Likewise JPA 2.0 caters to Java EE 6 containers.
I would suggest using Netbeans with Java EE 5 or Java EE 6, instead of heading for a wild goose chase on getting your JPA 1.0/2.0 provider to work amicably with a J2EE 1.4 container. This isn't merely about placing some JARs in your compile time classpath; your runtime classpath will require classes that are available only in a Java EE 5/6 container.
Either you have an incorrect classpath or you are missing a required jar. What are you using to build?
You have not correctly included the j2ee-1.4.jar in your project classpath. Otherwise you can reference to it. Perhaps you meet problem in setting classpath of your java project in netbeans.
Please check your jar to ensure it is correctly downloaded.
Maybe this is an old question but since no other answer has been posted, I post what I was able to do to make it work.
I found a file at:
C:\Program Files (x86)\NetBeans 8.1\java\modules\ext\hibernate4
Right-click your project >Libraries >Add jar > find your Netbeans installation directory...
usually => C:\Program Files (x86)\NetBeansXXX
find java\modules\ext\hibernate4 and choose jboss-transaction-apixxxxx.jar
hope it helps everyone else,

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.

Database for Java Enterprise Edition

I'm starting to use Java EE developing on Eclipse IDE, using GlassFish and the default Java database. What I should do if I want to change the database to Oracle?
The application runs on Glassfish and Google App Engine. But is there a way from Eclipse to deploy it to my own server?
You should be able to deploy locally to Glassfish and Oracle using Eclipse. (It's easy to do with IntelliJ.)
All you have to do to use Oracle is add the JDBC driver JAR to the appropriate spot in your CLASSPATH, use the new driver .class, and change the connection URL.
The driver JAR should match your JDK (e.g., ojdbc6.jar) and database version. It should come with your database or you can download it here.
I don't know if the JAR should go in your WEB-INF/lib or a server /lib; consult your docs to be sure.
One more thing: it goes without saying that you'll have to set up Oracle (e.g., proper credentials), create the new schema, and add the tables and indexes before you run your Java app. I thought I'd spell it out to be safe.