Al Koch

Ranch Hand
+ Follow
since Aug 24, 2011
Al likes ...
Eclipse IDE Firefox Browser Tomcat Server
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
15
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Al Koch

Hello,

I have Wildfly 10 installed and running successfully on Ubuntu 16.04.  (This is on an AWS instance running Ubuntu but I don't think that is an issue).  I need to get this running as a service.  I have found a variety of books and URLs that describe how to do this but they all are for an earlier version of Wildfly and/or an earlier version of Ubuntu and as a result none of them is correct for the current server and OS combination.
I finally found https://dennis.gesker.com/2016/02/09/wildfly-10-on-ubuntu-15-10/ which seems to come close to working.  I already had Wildfly installed so I picked up in the instructions where we "Change ownership of directory and symbolic link to wildfly:"  The problem is as follows:

wildflyuser@ip-172-31-27-23:/etc/init.d? sudo update-rc.d wildfly defaults
wildflyuser@ip-172-31-27-23:/etc/init.d? service wildfly start
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to start 'wildfly.service'.
Multiple identities can be used for authentication:
1.  Ubuntu (ubuntu)
2.  ,,, (wildflyuser)
Choose identity to authenticate as (1-2): 2
Password:
==== AUTHENTICATION COMPLETE ===
Job for wildfly.service failed because the control process exited with error code. See "systemctl status wildfly.service" and "journalctl -xe" for details.

I tried the suggested commands in the last line to see more detail but:
wildflyuser@ip-172-31-27-23:/etc/init.d? systemctl status wildfly.service
? wildfly.service - LSB: WildFly Application Server
  Loaded: loaded (/etc/init.d/wildfly; bad; vendor preset: enabled)
  Active: failed (Result: exit-code) since Mon 2017-07-31 15:34:08 UTC; 20s ago
    Docs: man:systemd-sysv-generator(8)
 Process: 17041 ExecStart=/etc/init.d/wildfly start (code=exited, status=1/FAILURE)


Can anyone tell me:
1) What's going wrong here, OR
2) Point me to a procedure that will let em get Wildfly running as a service?

Thank you.
3 years ago
Thanks.

Here is perhaps an even better solution:

select
C.Day,
C.PantsColorID,
P.Color as 'color of pants',
C.ShirtColorID,
S.Color as 'color of shirt',
C.ColorID
from TableClothes as C
inner join TableColor as P
on C.PantsColorID = P.ColorID
inner join TableColor as S
on C.ShirtColorID = S.ColorID ;


Hello,


I do not know how to formulate a query. To simplify the problem I have created a silly but simple example. Here are the specifics:

- TableColor: this is a table of colors that looks like:

- TableClothes: this is a table that logs the pants and shirt color worn each day that looks like:


How do I define a query to return a dataset that looks like:


This query gets me close:



Of course, this query returns the correct pants color but is shows that same color as the shirt color which is wrong.

How do I construct a query to return the correct color for both pants and shirt?

Thank you.


That was the problem Ron! When I launch with -b=privateipaddress we launch with no errors but we access with http://elasticipaddress:port. As you speculated, they must be NAT'ing the elasicipaddress to point to the "real" (private) IP address that we bind JBoss to.

Thanks very much for your help.
5 years ago
Hi Jaikiran,

Thanks for your ongoing response - I appreciate your help.

This is a valid IP - it is an "Elastic IP" that is a public IP address created by AWS that I associate with the AWS instance running JBoss. If I launch with standalone.bat -b=0.0.0.0 I can connect instantly with http://elasticipaddress:8080. However, if I launch with standalone.bat -b=elasticipaddress I get the "interface public" error I described in my initial post and http://elasticipaddress:8080 just times out.

(I have the Windows Server 2008 Firewall completely turned off in all of these tests.)

I have also tested the above cases (after enabling and starting the telnet server on Server 2008) with telnet elasticipaddress and I can connect so all of this indicates that the elasticipaddress is correct and seems "normal". (Just FYI, an AWS instance is completely "locked down" to start with so I have to always modify the Security Group settings to explicitly allow a particular type of access. However, I don't see how that could in any way trigger the JBoss server throwing an error on start up when I use standalone.bat -b=elasticipaddress.)

Also, since I had initially made some port assignment changes and had set up a manged data source I refreshed the whole JBoss configuration folder with the original from the installation. Unfortunately, this "fresh" configuration made no difference.

Note that I have installed JBoss 7 on my LAN and can launch it with -b= specific IP address and we have no error on launch and can connect. This makes me start to wonder if there is something "strange" about the AWS Elastic IP address. It is described by Amazon as just a "normal" public IP address and that seems true in all regards - as I said, I can connect (when I launch with -b=0.0.0.0) and can telnet with no problems - but could JBoss's use in the -b option perhaps fail because of something "strange" since it's an Elastic IP? I am sure many other people are running JBoss on an AWS instance (however, this is Server 2008 and not Linux).

I am very perplexed but i am hoping you can help!

Thanks.
5 years ago
Hi Jaikiran,

Thanks for your reply! I have learned that an machine can have multiple IP addresses (something I had forgotten!) so this now makes sense. Thanks for your link which led to your blog post - that is helpful info.

Perhaps you can answer this follow on question. I am running JBoss on Windows server 2008R2 on an Amazon AWS instance. If I start with standalone -b=0.0.0.0 I can access the server. However, if I start with standalone -b=aaa.bbb.ccc.ddd where aaa.bbb.ccc.ddd is the Public IP address assigned to the AWS instance the server crashes on start up with
...
11:48:54,459 INFO [org.jboss.as.mail.extension] (MSC service thread 1-1) JBAS015400: Bound mail session [java:jboss/mail/Default]
11:48:54,475 INFO [org.jboss.as.server.deployment.scanner] (MSC service thread1-1) JBAS015012: Started FileSystemDeploymentService for directory C:\jboss-as-7
.1.1.Final\standalone\deployments11:49:00,403 INFO [org.jboss.as.controller] (Controller Boot Thread) JBAS014774
: Service status reportJBAS014777: Services which failed to start: service jboss.network.public: org.jboss.msc.service.StartException in service jboss.network.public: JBAS015810: failed to resolve interface public

11:49:00,419 INFO [org.jboss.as] (Controller Boot Thread) JBAS015954: Admin console is not enabled
11:49:00,419 ERROR [org.jboss.as] (Controller Boot Thread) JBAS015875: JBoss AS7.1.1.Final "Brontes" started (with errors) in 9142ms - Started 119 of 214 services (44 services failed or missing dependencies, 49 services are passive or on-demand)

>>> Note the error: JBAS015810: failed to resolve interface public.


The IP address is the only difference. Can you help me find the problem? Thanks again very much!
5 years ago
Hello,

I am confused about the meaning of launching JBoss 7 with the -b=nnn.nnn.nnn.nnn option.

I know that if we want the server to respond to "remote" accesses (i.e., from other than localhost) we have to launch with the -b=nnn.nnn.nnn.nnn option (such as "standalone.bat -b=nnn.nnn.nnn.nnn"). However, I don't understand why this is necessary.

I am coming to the use of JBoss from a prior use of Tomcat. With Tomcat we can specify a port that Tomcat is to listen on and if a remote system directs a query to the IP address of the machine running Tomcat (on the right port) Tomcat responds to the query. I can understand the idea of having a switch that tells JBoss if it should ignore or respond to a remote request but the -b=nnn.nnn.nnn.nnn option would appear to do more than that. As I understand, this tells JBoss to respond to queries directed at the specifc IP address represented by "nnn.nnn.nnn.nnn". My question is "what other IP address would it respond to other than the IP address of the machine where it is running?" Does this option mean that if JBoss is running on a machine @ 123.456.789.001 we can launch it with -b=999.999.999.111 and it would (only) respond to queries direct to 999.999.999.111? That is, a query of 999.999.999.111:nnnnn/servletname/... would trigger a response? If not, then why the form -b=nnn.nnn.nnn.nnn? On the other hand, if we can, what in the world does that even mean?

In a related question, what does -b=0.0.0.0 mean?

What are the use cases for 0.0.0.0 and for using -b with an IP address other than the machine where JBoss is running?

Thank you.
5 years ago
Hello,

I have an AWS (T2-small) Instance that is running Windows Server2008R2. I have installed JBoss 7.1.1 (from jboss-as-7.1.1.Final.zip) and am able to launch it with "standalone.bat". In this case I am able to access the server with a local browser @ http://localhost:8080 and http://localhost:9990.

However, if I try to launch the server for remote access with "standalone.bat -b=PublicIPAddressOfTheAWSInstance" an attempt to reach to reach the server from a remote system using http://PublicIPAddressOfTheAWSInstance:8080 results in a "Timeout" and we don't connect. Further, using a local browser:
http://localhost:8080 still connects
http://PublicIPAddressOfTheAWSInstance:8080 does not connect
http://localhost:9990 no longer connects
http://PublicIPAddressOfTheAWSInstance:9990 does not connect

What may be an important hint is that I see the following error in the console log:
...
11:48:54,459 INFO [org.jboss.as.mail.extension] (MSC service thread 1-1) JBAS015400: Bound mail session [java:jboss/mail/Default]
11:48:54,475 INFO [org.jboss.as.server.deployment.scanner] (MSC service thread1-1) JBAS015012: Started FileSystemDeploymentService for directory C:\jboss-as-7
.1.1.Final\standalone\deployments11:49:00,403 INFO [org.jboss.as.controller] (Controller Boot Thread) JBAS014774
: Service status reportJBAS014777: Services which failed to start: service jboss.network.public: org.jboss.msc.service.StartException in service jboss.network.public: JBAS015810: failed to resolve interface public

11:49:00,419 INFO [org.jboss.as] (Controller Boot Thread) JBAS015954: Admin console is not enabled
11:49:00,419 ERROR [org.jboss.as] (Controller Boot Thread) JBAS015875: JBoss AS7.1.1.Final "Brontes" started (with errors) in 9142ms - Started 119 of 214 services (44 services failed or missing dependencies, 49 services are passive or on-demand)

>>> Note the error: JBAS015810: failed to resolve interface public.

Additional info: The AWS Instance is deployed in the default VPC and an AWS Security Group is defined to permit access to PublicIPAddressOfTheAWSInstance from all IP addresses using TCP on 8080. Also, the Windows Firewall is disabled.

I am guessing that "interface public" failing to resolve is related to why I can't get remote access.

Note that if I launch with "standalone.bat -b=0.0.0.0" EVERYTHING WORKS! There is no error in the log and remote access is available. However, using 0.0.0.0 is not advisable for production.

Can anyone help me understand why this is failing if I specify the AWS Public address?

Thank you.
5 years ago
Found the problem! I discovered that in a @OneToOne relationship with a composite key, using a separate FK class to manage the composite key in both entities causes the error. The problem is shown in my original posting where I define and use StudentsPK and DormRoomsPK! Once I changed to use a single "PK" class instead of these two my problem was eliminated. (This doesn't appear to be a well documented requirement!)
I am using Hibernate and have two tables, STUDENTS and DORM_ROOMS, that are related with a composite key:

The relationship is one to one because a student can be associated with exactly one dorm room and and a dorm room is associated with one student (wow - a private room!). However, not all students have a dorm room.

My initial code (stripped down) looks like:

Assume that the database schema is already defined and created. In particular, CAMPUS+STUDENT_ID is a PK for STUDENTS and CAMPUS+STUDENT_ID is a FK for DORM_ROOMS that serves as the PK in that table. At this point I can successfully insert a row into STUDENTS and a row into DORM_ROOMS. I can also retrieve any student from STUDENTS even if the student does not have a dorm room. However, I have not yet "informed" Hibernate about the relationship between the two tables. That is where I am confused.

I tried to "relate" the two tables by using a "JOIN" annotation but I discovered that this causes any attempt to fetch a student that has no dorm room to return an empty result set. I suppose that makes since if "JOIN" states that the tables are to always be viewed as joined then joining a student having no dorm room with no matching rows in the DORM_ROOMS table would result in an empty result set.

Since using a "JOIN" annotation doesn't work, how do I modify my code to describe the relationship between the two tables but still allow me to fetch students that have no matching dorm rooms?

Thank you.
Hi H Paul,

GOT IT!!! The problem with the <property> was that there was a trailing "." on the value! That is, I had <property name="hibernate.ejb.interceptor" value="com.MyCom.model.HibernateInterceptor."/> My keystrokes for copying this from the file somehow missed that last dot and that is why it wasn't shown in my posting!

I apologize for that mistake. The interceptor is now running just fine.

Let me take a moment to say that I REALLY appreciate all of the time you took and for staying with this problem till it was solved. I've been in a lot of support forums over many years and you are one of the very few people who have shown such commitment to helping someone out. (Why can't I "award" you points of some type on this site?)

May I ask you a final question? I have been scrambling to get up to speed on Hibernate and have been reading a lot of blog posts and forum posts but it has all been rather haphazard. You have obviously mastered Hibernate so is there a book or other resource (in addition to the formal docs) you would recommend for me to read?

Again, thank you very much for all of your time and help!

Hi Dave,

Thanks for the suggestion but as you said "gotta move on"! Plus, once I isolate where the bug is, tehn I would have to get SAP to do something about it!

Here it is. (I included a little bit of console output prior to the error to provide a little context:



The error I have telling you about is at line 30.

If I remove <property name="hibernate.ejb.interceptor" value="com.MyCom.model.HibernateInterceptor"/> from persistence.xml all of my JPA/Hiberbate actions are working. I can fetch and insert so I think that my Persistence Unit is being managed correctly by JBoss and it seems that Hibernate is working properly. It's just when I include the <property> that we have a problem.

Thank you.
Hi H Paul,

Thanks for all of the info in your posts. Unfortunately I am missing what you feel I am doing wrong because I think I am doing what you suggest.

1) I am implementing from EmptyHibernator as:

2) I am annotating as you suggest:

3) I am using the <property> in persistence.xml that you suggest:


The problem is that upon deployment to JBoss 7 I get:


Can you see why this class is not being found? (Is there an annotation on HibernateInterceptor I am missing?)

Thank you!